2012 May 04 9:54 PM
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
2012 May 04 9:58 PM
Check in your IDOC Data internal table if hierarchy levels are correclty populated?
2012 May 05 10:24 AM
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.
2012 May 05 3:38 PM
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.
2012 May 05 7:46 PM
Hi Kirthi,
check SAP standard program
which uses the FM
Clemens
2012 May 11 11:34 AM
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.