Skip to Content
author's profile photo Former Member
Former Member

Custom Segment Idoc Hierarchy Error

Hi Guys,

I have been asked to create a pick confirmation idoc to be called from within the MB_POST_DOCUMENT exit, using the Master Idoc distribute FM. I am required to add 2 new segments to the existing idoc, which I have done.

My idoc extension is ZSHPCONX based on the DELVRY03 idoc of message type SHPCON. The structure, including my new segments is as follows:






The extended message type has been added to WE82, against the SHPCON/DELVRY03 message type, and the WE20 output profile has been updated accordingly.

Before I went on leave 10 days ago, everything worked fine. Now, I've added data to the E1EDL37 segment, and I've lost my hierarchy. It now comes out as all at the same level, and this is causing a syntax error on the idoc create.

In WE02 or BD87, the control fields are showing all the necessary data: comparing a successful version of the idoc before my leave to the newly failed version shows all control data is the same.

The E1EDL37 code changes were copied from my existing code, which goes like this:

move 'E1EDL37' to z_idoc_data-segname.
move l_hu to ZE1EDL37-exidv.
move ZE1EDL37 to z_idoc_data-sdata.
append z_idoc_data to IDOC_DATA.
clear z_idoc_data.

I'd be greatful if anyone could point out how I've lost my hierarchy structure. Points will be awarded for a solution to this problem.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 06:47 AM

    yes stephan u have handle this logic through coding in user exit

    as follows...

    LOOP AT idoc_data.

    IF idoc_data-segnam = 'E1EDL24'.

    g_cnt24 = g_cnt24 + 1.



    LOOP AT idoc_data.

    g_itind = sy-tabix.

    IF idoc_data-segnam = 'E1EDL24'.

    g_cnt = g_cnt + 1.

    READ TABLE data-tab_likp INTO lx_likp INDEX 1.

    READ TABLE data-tab_lips INTO lx_lips INDEX g_cnt.

    READ TABLE data-tab_vbak INTO lx_vbak INDEX 1.

    READ TABLE data-tab_vbap INTO lx_vbap INDEX g_cnt.


    • Logic for filling E1EDL12 data into proper place *


    IF g_cnt24 = 1 OR g_cnt = g_cnt24.

    g_fapp = 'X'.

    ELSE .

    g_fins = 'X'.


    IF i_itab_l12 IS NOT INITIAL .

    g_insind = g_itind.

    LOOP AT i_itab_l12 INTO lx_itab_l12.

    INSERT lx_itab_l12 INTO idoc_data INDEX g_insind.

    g_insind = g_insind + 1.


    CLEAR i_itab_l12[].



    • Processing logic for Delivery Date *


    idoc_data-segnam = 'E1EDL12'.

    w_eiedl12-atinn = '9999999402'.

    w_eiedl12-atnam = 'LOBM_LFDAT'.

    w_eiedl12-atbez = 'Delivery Date'.

    w_eiedl12-atwrt = lx_likp-lfdat.

    MOVE w_eiedl12 TO idoc_data-sdata.

    IF g_fapp = 'X'.

    APPEND idoc_data.


    IF g_fins = 'X'.

    APPEND idoc_data TO i_itab_l12.


    maintain two flags one for append if there is no E1EDL37 seg

    else it will be insertion after E1EDL12...


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.