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

Modify field from idocs segment

Former Member
0 Likes
8,126

Hi

I am new with Idocs and i have to change 2 fields from a segment in my idoc.Is this possible.If yes,how can they be modified?

Also i tried to place a break-point in my FM that generates the idoc but the debugger does not stop in my FM,eventhough the idoc is generated with succes.Help please.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
2,048

Hi,

Creating Custom IDoc type and Message type

All the objects created should be present on both source as well as target system(s).

1. Create segments - Transaction WE31

Create a segment ZRZSEG1

Add all fields of table ZCUSTOMERS to it

Save the segment

Release it using the menu path Edit -> Set Release

Similarly create two more segments given below

Seg. ZRZSEG2 - to hold all fields of table ZSOHEADERS

Seg. ZRZSEG3 - to hold all fields of table ZSOITEMS

2. Create Basic IDoc type - Transaction WE30

Create a Basic type ZRZORDER

Add the created segments in the hierarchy shown

Maintain attributes for each of the segments

Save the object and go back

Release the object using the menu path Edit -> Set Release

3. Create/Assign Message type - Transactions WE81/WE82

Go to WE81

Create a new Message type ZRZSO_MT

Save the object

Go to WE82 and create new entry

Assign the message type ZRZSO_MT to the basic type ZRZORDER

Also specify the Release Version

Save the object

Thus we have defined the IDoc structure which will hold the data to be transferred.

Please Refer Following Link of IDOCS,

https://wiki.sdn.sap.com/wiki/display/ABAP/ALE+IDOCS

https://wiki.sdn.sap.com/wiki/display/ABAP/ALE%2CIDOC

For Debugging IDOC.

Execute transaction WE19 , in Existing Idoc give the Idoc number and Execute it will take you to another screen. In this press the Inbound Function Module tab , Give the Function Module and check the check box Call in Debugging Mode , and process In ForeGround.

Thanks & Regards,

ShreeMohan

Thanks & Regards,

\ShreeMohan

6 REPLIES 6
Read only

alex_m
Active Contributor
0 Likes
2,048

Do you have to change the datas of the segment or needs to change the segment defenition?... Whats the Idoc type its inbound or outbound?

Read only

Former Member
0 Likes
2,048

Hi,

It is type 2 Inbound and i have to change the segments definition,not the content of the fields.

thanks

Read only

alex_m
Active Contributor
0 Likes
2,048

You cant modify the std segment, but I hope yours is custom segment.

WE31--> Segment name --> Add Version then you can modify the segment defenition.

Read only

Former Member
0 Likes
2,048

Hello Seba,

if it is standard function module then you need to find some exit which is called before IDOC generation were you can modify

IDOC fields. In this case you need to locate correct exit and create enhancement project in CMOD transaction and then you

can write code in include provided for that exit.

If this is Z program then you can access IDOC just like any other internal table and modify it's content.

Thanks,

Augustin.

Read only

0 Likes
2,048

Hello Seba,

Sorry I though you want to change data.

For changing segment if it is standard you can create new zsegment in WE31 and create extension of standard IDoc in WE30 and assign newly created zsegment to it.

Check if this helps,

Thanks,

Augustin.

Read only

Former Member
2,049

Hi,

Creating Custom IDoc type and Message type

All the objects created should be present on both source as well as target system(s).

1. Create segments - Transaction WE31

Create a segment ZRZSEG1

Add all fields of table ZCUSTOMERS to it

Save the segment

Release it using the menu path Edit -> Set Release

Similarly create two more segments given below

Seg. ZRZSEG2 - to hold all fields of table ZSOHEADERS

Seg. ZRZSEG3 - to hold all fields of table ZSOITEMS

2. Create Basic IDoc type - Transaction WE30

Create a Basic type ZRZORDER

Add the created segments in the hierarchy shown

Maintain attributes for each of the segments

Save the object and go back

Release the object using the menu path Edit -> Set Release

3. Create/Assign Message type - Transactions WE81/WE82

Go to WE81

Create a new Message type ZRZSO_MT

Save the object

Go to WE82 and create new entry

Assign the message type ZRZSO_MT to the basic type ZRZORDER

Also specify the Release Version

Save the object

Thus we have defined the IDoc structure which will hold the data to be transferred.

Please Refer Following Link of IDOCS,

https://wiki.sdn.sap.com/wiki/display/ABAP/ALE+IDOCS

https://wiki.sdn.sap.com/wiki/display/ABAP/ALE%2CIDOC

For Debugging IDOC.

Execute transaction WE19 , in Existing Idoc give the Idoc number and Execute it will take you to another screen. In this press the Inbound Function Module tab , Give the Function Module and check the check box Call in Debugging Mode , and process In ForeGround.

Thanks & Regards,

ShreeMohan

Thanks & Regards,

\ShreeMohan