Skip to Content
avatar image
Former Member

IDOC status 26 ( Get details from previous status records with status 26 )

Hi All,

I have extended the standard IDOC and tried to populate the custom segment as child segment of parent segment of E1MASTM using user exit . But this custom segment appended at the end of all segments in a idoc ,instead of child segment of E1MASTM and got the status 26. ( Outbound )

Code as below.

LOOP AT idoc_data .

CASE idoc_data-segnam.

when 'E1MASTM'.

lc_wa_e1mastm = idoc_data-sdata.

select single verid

from MKAL

into l_verid

where matnr = lc_wa_e1mastm-matnr

and werks = lc_wa_e1mastm-werks

and STLAL = lc_wa_e1mastm-stlal

and STLAN = lc_wa_e1mastm-stlan.

IF sy-subrc eq 0.

idoc_data-segnam = 'ZE1MASTM'.

idoc_data-sdata = l_verid.

append idoc_data .

clear idoc_data.

ENDIF.

ENDCASE.

endloop.

Thanks - Vinay.

Edited by: Vinay parakala on Mar 24, 2010 7:24 AM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 24, 2010 at 03:13 PM

    Hi Vinay parakala

    Code what you are using is wrong one...

    Try with this code

    Data: lv_edidd LIKE edidd.

    Data: c_ZE1MASTM LIKE z1edl44 VALUE 'ZE1MASTM'.

    Data: lr_ZE1MASTM LIKE ZE1MASTM .

    LOOP AT idoc_data .

    CASE idoc_data-segnam.

    when 'E1MASTM'.

    lc_wa_e1mastm = idoc_data-sdata.

    select single verid

    from MKAL

    into l_verid

    where matnr = lc_wa_e1mastm-matnr

    and werks = lc_wa_e1mastm-werks

    and STLAL = lc_wa_e1mastm-stlal

    and STLAN = lc_wa_e1mastm-stlan.

    IF sy-subrc eq 0.

    lr_ZE1MASTM-verid = l_verid.

    Endif.

    lv_edidd-segnam = c_ZE1MASTM.

    lv_edidd-sdata = lr_ZE1MASTM.

    APPEND lv_edidd TO idoc_data.

    clear : l_verid.

    ENDIF.

    ENDCASE.

    endloop.

    Above Code will solve your problem...Let me know if you have any question on this...

    Thanks

    Ramesh

    302 290 5677

    Edited by: Ramesh on Mar 24, 2010 8:43 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vinay

      Did you define data type correctly

      Data: c_ZE1MASTM LIKE ZE1MASTM VALUE 'ZE1MASTM'.

      let me know what is the error

      Thanks

      RAMESH

      You can call me 302 290 5677

  • avatar image
    Former Member
    Mar 24, 2010 at 09:08 AM

    Vinay,

    Try copying ur code in BTE: CS000160

    ---

    Reddy

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 24, 2010 at 09:18 AM

    Hi VInay,

    Try inserting the custom segment into the idoc_data table directly after the E1MASTM segment, instead of appending.

    Cheers

    Alex

    Add comment
    10|10000 characters needed characters exceeded