Application Development 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: 

idoc hierarchy distorted

Former Member
0 Kudos
969

Hi Experts,

I am using FM IDOC_INBOUND_WRITE_TO_DB to create an inbound idoc. the idoc basic type is qality02 However, the hierarchy between the segment seems to be all messed up. every segment is appearing at hierarchy level 1. ie there is no child segment.

Please give your valuable inputs how to keep the hierarchy as default for Qality02 type.

Regards,

Kirti Pathak

5 REPLIES 5

former_member189779
Active Contributor
0 Kudos
151

Check in your IDOC Data internal table if hierarchy levels are correclty populated?

0 Kudos
151

Hi Vinit,

I checked the hierarchy level and the parent segment num in the input data internal table. However, everything seems to be fine in that.

Let me elaborate the issue a little. I have a failed idoc in the system. I have to copy this idoc into a new idoc and add teh missing segments and process it. I am reading the idoc data directly from the idoc tables EDIDC and EDID4 into the input_data internal table for new idoc creation. Then I add the missing segments into the input_data internal table. I have rechecked the HLEVEL and PSEGNUM fields in the internal tables. everything is fine. The I use the IDOC_INBOUND_WRITE_TO_DB function module to create the new idoc and IDOC_START_INBOUND to process the process code of the inbound idoc.

The idoc is created by idoc_inbound_write_to_db successfully. However, the hierarchy is distorted. each segment appears at 1 level. I guess its the default hierarchy. I have given the parent segments also.

0 Kudos
151

Can you try doing it through WE19? You can put existing idoc in there and start inbound FM again. It will generate new Idoc.

Copy an existing IDOC, preferably one from the same vendor, but which has previously been successfully processed, and which contained ALL the required segments.  Then, edit the data of your newly created copy so as to match the data contained in the FAILED IDOC.

Ideally your partner should send the corrected Idoc again.

0 Kudos
151

Hi Kirthi,

check SAP standard program

RFEBKAT4

which uses the FM

Clemens

Former Member
0 Kudos
151

Solution accomplished by adding the missing segments at the correct index of the internal table. Also the maxsegnum in the control data was deleted.

Thanks everyone for there valuable inputs.