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

Adding parent and child segments to Idoc while processing

Former Member
0 Likes
2,708

Hello all,

i have the following requirement, please help me to find the solution.

while processsing the idoc i need to check the data present in the data segments, if the required information is not found in the idoc then i need to add the data (as parent and child segments) from the custom table maintained by the user.

is it possible to add data segments or status segments while prtocessing the idoc, here we are not modifying the structure of the idoc, just we need to add the data for the segments which are already defined while creating the idoc type.

thanks in advance,

Sippy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,253

Hi Sippy,

You can always use the userexits of the idoc processing to add the segments as you want in idoc processing.

You need to take care about when you want to put the segment, and check for the previous segment name in the IDOC_TABLE structure.

What idoc are you processing ?

Thanks,

Siddharth

10 REPLIES 10
Read only

Former Member
0 Likes
2,254

Hi Sippy,

You can always use the userexits of the idoc processing to add the segments as you want in idoc processing.

You need to take care about when you want to put the segment, and check for the previous segment name in the IDOC_TABLE structure.

What idoc are you processing ?

Thanks,

Siddharth

Read only

0 Likes
2,253

hi Siddharth,

thx for the reply. am using idoc type oilmat05. i need to check for the parent segment E1MARCM, if it doesn't exist then i need to add it along with its child segment E1OILMC with data. here am creating the materal by using the message type OILMAT.

i found the user exit for this EXIT_SAPLMV02_002, but i dont have idea how to proceed further.

thx for ur help.

Read only

0 Likes
2,253

Hi,

It appears you are dealing with IS Oil.I do not see this IDoc type in my R3 system.But nevertheless, can you check in debug if you get the IDoc_table filled up in the and see all the segments till then.Then you can check for the segment after the segment which you want to populate, if it has not been populate then you can populate the segment and insert into the IDoc_table.

Regards,

Siddharth

Read only

0 Likes
2,253

hi,

exactly, it is related to is-oil. am finding idoc data in internal table IDOC_DATA . so u mean to say in the user exit, add the segments to this internal table at the appropriate place , will fulfill the requirement.

Read only

0 Likes
2,253

Hi Sippy,

Yes, that should help.But be careful when you add the segments.They ahve to be added in the right sequence as the Idoc structure else you would get an error idoc with a syntax error.

Regards,

Siddharth

Read only

0 Likes
2,253

hi,

i have analysed the function module IDOC_INPUT_MATMAS01, i found it is checking for the segment name first two charactes, if it is not E1 then it is allowing to execute the user exit implementation. am not sure when the required segment data is missing, how the idoc_data table is populated, means if the segments are missing in the idoc, then the same hierarchy of the idoc is maintained in the idoc_data table, without having segment name and data.

thx for ur help.

Read only

0 Likes
2,253

Hi Sippy,

I can now see that you are trying to process an inbound idoc for FM, IDOC_INPUT_MATMAS01.

Why do not you try creating a wrapper FM of the same import/export parameters of IDOC_INPUT_MATMAS01, where you read the idoc and insert the segments in the IDOC_TABLE and then pass it for processing in FM IDOC_INPUT_MATMAS01.

Keep in mind though that any change you would do in the idoc structure at run time in the wrapper FM or the user exit,would not be visible in the actual idoc you would later see in WE02.

Regards,

Siddharth

Read only

0 Likes
2,253

hi Siddharth,

can u plz explain a littile bit more, am unable to get the point u explained. its a standard FM, my understanding is w'll create a custom funtion modulewith the same parametets of standard, this custom FM will be called when processing the idoc, within this after modification to idoc data standard fm will be called.

thx in advance.

Sippy.

Read only

0 Likes
2,253

Hi Sippy,

In transactions BD51 and WE57 we specify what function modules to be used to process the IDoc with the inbound message type, OILMAT in your case.

And in the standard config probably you would see that yuo have FM IDOC_INPUT_MATMAS01 maintained against OILMAT.What I was suggesting is creating a new custom FM lets say Z_IDOC_INPUT_MATMAS01 and maintain it against OILMAT in there and you call IDOC_INPUT_MATMAS01 inside this FM.

Then you have place to play around in the IDoc structure in the "preprocessing part" before the IDOC_INPUT_MATMAS01 is called and you need not use the user exit.

Regards,

Siddharth

Read only

0 Likes
2,253

Hi Siddharth,

thx for ur help, i understood what need to be done.

Regards,

Sippy.