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

Program to update idoc segments

Former Member
0 Likes
1,968

Hello,

Is there any SAP program to update idoc segments? User needs to update hundreds of idocs.

1 REPLY 1
Read only

Former Member
0 Likes
792

by using the Tcode WE31

you can update the Segments Idoc Data in the following way:

Step1:Open doc to edit

call function 'EDI_DOCUMENT_OPEN_FOR_EDIT'

Step2:Loop at itab_edidd and change data

Step3a:Change data segments

Call function 'EDI_CHANGE_DATA_SEGMENTS'

Step3b:Change control record

Call function 'EDI_CHANGE_CONTROL_RECORD'

Step4:Close Idoc

*UPDATE IDOC STATUS

Call function 'EDI_DOCUMENT_CLOSE_EDIT'

IDOC_OUTPUT_ORDRSP will create all the segments needed as per the source data automatically. You need to populate your segment in a user exit

So, if you only needed half of the standard idoc's (ORDERS05) segments populated, you would need to write code in a customer exit (FM IODC_OUTPUT_ORDRSP) to filter out the unnecessary data/segments?

the easiest place to strip out all the unwanted segments would be in your Middleware. Otherwise, you should be able to strip the segments out by creating an include in one of the Customer Functions in IDOC_OUTPUT_ORDRSP, i.e.

CALL CUSTOMER-FUNCTION '004'

CALL CUSTOMER-FUNCTION '001'

CALL CUSTOMER-FUNCTION '003'

steps to create Z IDOC and segments required for it.

and also the sample code (program) to poplulate the data into those segemnts from a (excel/csv file )or tables.

1. Create the segments thru we31.

2. Create an idoc with the above created segments from WE30.

3. Do settings from WEDI tcode.

4. Do partner profile settings in we20

5. Write a report program which reads data from spreadsheet and send the idoc withMASTER_IDOC_DISTRIBUTE FM

Check the below links:

http://help.sap.com/saphelp_sm32/helpdata/EN/52/16ae16543311d1891c0000e8322f96/content.htm

http://idocs.de/www5/EDI/HTML/IDocBook.htm#_Toc8400384

http://www.sapgenie.com/sapedi/idoc_abap.htm

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.allsaplinks.com/idoc_sample.html

http://www.allsaplinks.com/idoc_sample.html