We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-other] How To Download An IDOC in XML Format

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from IvanBe on Jan 22 at 7:03 AM
REPORT ZMBC_IDOC_TO_XML.

PARAMETERS: p_idoc TYPE edidc-docnum MATCHCODE OBJECT IDOC_STD.
PARAMETERS: p_file type rlgrap-filename obligatory default 'C:\wrk\idocxxx.xml'.
parameters: p_save as checkbox.

DATA: o_idoc_xml TYPE REF TO cl_idoc_xml1.
DATA: gv_string TYPE string.
DATA: gt_string TYPE TABLE OF string.

data: filename type string.

*Create IDoc object
CREATE OBJECT o_idoc_xml
EXPORTING
docnum = p_idoc
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
WRITE: /'Error creating idoc object'.
EXIT.
ENDIF.

*Get IDoc data as string
CALL METHOD o_idoc_xml->get_xmldata_as_string
IMPORTING
data_string = gv_string.

APPEND gv_string TO gt_string.

IF sy-subrc NE 0 OR o_idoc_xml IS INITIAL.
WRITE: /'Error getting xml data as string'.
EXIT.
ENDIF.

*Download IDoc data as XML file
filename = p_file.

if p_save is not initial.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
TABLES
data_tab = gt_string.
endif.

exit.
*

---------------Original Message---------------
From: George
Sent: Friday, January 22, 2016 5:03 AM
Subject: How To Download An IDOC in XML Format

How can you download an IDOC in XML format ?

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
© 2016 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
IvanBe  
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language