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 status 26 ( Get details from previous status records with status 26 )

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Vinay,

Try copying ur code in BTE: CS000160

---

Reddy

0 Kudos

Hi VV reddy,

I think CS000160 is for inbound processing. Please clarify me.

Thanks,

Vinay.

alex_cook
Active Participant
0 Kudos

Hi VInay,

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

Cheers

Alex

Former Member
0 Kudos

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

0 Kudos

Hi Ramesh,

Thanks for your response ! But I am getting the same problem with your code also. Please help.

Thanks

Vinay.

0 Kudos

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