Application Development and Automation 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: 
Read only

internal table update

Former Member
0 Likes
409

hi,

I have a internal table ITAB it has

MATERIAL abcd

PLANT Get from PO line item in SAP

STGE Get from PO line item in SAP

MOVE_TYPE 101

ENTRY_QNT 1

PO_NUMBER 4506007300

PO_IT 00001

MVT_IND B

in this internal table i dont have plant and storage location so i was using

select ebeln ebelp werks lgort into JTAB from ebap for all entries in ITAB

where ebelp = ITAB-ebelp.

so now i got the plant and storage location in JTAB.

so can any one send the logic how i can modify ITAB with plant and storage location with respect to po line item.

thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
384

hi pavan ..

loop at jtab.

read table itab with key ebeln = jtab-ebeln

ebelp = jtab-ebelp.

if sy-subrc = 0.

itab-werks = jtab-werks.

itab-lgort = jtab-lgort.

modify itab transporting werks lgort

where ebeln = jtab-ebeln

ebelp = jtab-ebelp

endif.

endloop.

hope this helps

regards,

vijay<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm">modify</a>

check this for clear understanding

Message was edited by: Vijay

2 REPLIES 2
Read only

Former Member
0 Likes
385

hi pavan ..

loop at jtab.

read table itab with key ebeln = jtab-ebeln

ebelp = jtab-ebelp.

if sy-subrc = 0.

itab-werks = jtab-werks.

itab-lgort = jtab-lgort.

modify itab transporting werks lgort

where ebeln = jtab-ebeln

ebelp = jtab-ebelp

endif.

endloop.

hope this helps

regards,

vijay<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm">modify</a>

check this for clear understanding

Message was edited by: Vijay

Read only

Former Member
0 Likes
384

Hi Pavan,

try following code.

loop at itab.

  • select plant, storage location into itab-werks, itab-lgort.

if sy-subrc = 0.

modify itab transporting werks lgort index sy-tabix.

endif.

endloop.

-Anu