Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDOC

Former Member
0 Likes
375

Hi,

I need to write a IDOC data to a flat file. How do i do this?

Is there any standard function module to read IDOC and write to file?

Pls help

Thanks

Hi,

I need to write a IDOC data to a flat file. How do i do this?

Is there any standard function module to read IDOC and write to file?

Pls help

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
348

Hi

You need to do following -

1. first create a variable for structure EDIDC which will hold the control record information, if you are putting multiple IDOC's then this can be an internal table.

2. Create an internal table for EDIDD, which will hold the segment data.

4. Open a file in text mode.

5. Then for each IDOC first fill the EDIDC variable and write to the file.

6. For each IDOC fill the EDIDDD internal table as follows -

i) For each segment create a variable and fill the variable (structure) with relevant data.

ii)For each segment fill EDIDD work area and put that into SDATA field of EDIDD.

7. Write all records of internal table to the file.

8. Repeat 5-7 if there are more IDOC's to be written.

9. Close the file.

Hope this helps.

Regards,

RAVISH

<b>PLZ DONT FORGET TO REWARD POINTS IF HELPFUL</b>

Read only

Former Member
0 Likes
348

Hi,

You can use the following FM.

IDOC_READ_COMPLETELY (Read IDoc Data)

IDOC_TYPE_COMPLETE_READ (Read IDoc Structure and Segments)

<b>

reward points if useful</b>

Regards

Ashu