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 generation from ABAP program

Harsh_Jain2512
Participant
0 Likes
2,961

Hi

I have to object in which I have to Z program which will generate the idoc and pass it to PI system. Can anyone guide me in how to generate IDOC through ABAP custom program. Just need a little guidance in how to create IDOC from an ABAP report.

Any help would be greatly acknowledged.

Thanks!!


7 REPLIES 7
Read only

Former Member
0 Likes
2,303

Hello Harsh,

You need to use FM 'MASTER_IDOC_DISTRIBUTE' to generate the idoc through custom program. There are many blogs available over scn which will give you step by step procedure the generate idoc.

Regards.

Deepti

Read only

former_member201275
Active Contributor
0 Likes
2,303

DN is correct there are many links for this. here one:

http://wiki.scn.sap.com/wiki/display/Snippets/ABAP+Program+To+Generate+IDoc

Read only

buddhika_krishantha
Active Participant
2,303

There are many links in internet.

try this.

ABAP Program To Generate IDoc - Code Gallery - SCN Wiki

Read only

Harsh_Jain2512
Participant
0 Likes
2,303

Hi I tried to use the program as suggested by Buddhika and Glen, but found error over the statement below:

i_data-sdata = header_segment_data.

Highlighted below in code snap. These two fields are not mutually convertible.

Any suggestions on this.

Read only

0 Likes
2,303

This is really a seperate issue to the original.

Please post the data declaration code here for both these variables.

Read only

0 Likes
2,303

Hi,

HEADER_SEGMENT_DATA should be of type EDIDD-SDATA.

Regards,

Lingaraj

Read only

Harsh_Jain2512
Participant
0 Likes
2,303

It can't be possible in this scenario as Header_segment_data is a structure type while EDIDD-SDATA is not structured type.