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

report

Former Member
0 Likes
485

HI,

Please help for the following:

when there are multiple location codes(lgort) for a particular material no.(matnr) then goto table MCHB fetch staorage location where mchb-matnr = resb-matnr and mchb-werks=resb-matnr.then check the first character of the field CHARG of table mchb if it is NE '3' then fetch storage location (lgort) and sum up stock quantity(CLABS) for each location code.

when there is only one storage loc'n then goto Mard table and fetch lgort where mard-matnr = resb-matnr and mard-werks=resb-werks.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
456

Hi Ramya,

What help do u need. Be clear wid tht.

Regards,

Ramya

Read only

0 Likes
456

hi,

My doubt is how to check if there are multiple entries for a particular material no. i am not getting how to write this logic.

Read only

0 Likes
456

pick all the storage loc for all the materials (for ur selelction) in one shot then SORT and loop the int. table

have a variable COUNT and use the AT END MATNR to proceed further

Read only

Former Member
0 Likes
456

Hai Ramya,

1st step - select the all stroage location(LGORT) from MARD for ur input MATNR and WERKS to internal table itab_mard .

2nd step - select the batch number-CHARG and quantity from MCHB using for all entries in ITAB_MARD-MATNR and ITAB_MARD-WERKS and ITAB_MARD-LGORT into itab_mchb.

delete ITAB_MCHB where CHARG+0(1) <> '3'.

data :begin of itab3 occurs 0,

matnr type matnr,

werks type werks,

lgort type lgort_g,

qty type menge_d,

end of itab3.

loop at itab_mard.

loop at itab_mchb where matnr = itab_mard-matnr and

werks = itab_mard-werks and

lgort = itab_mard-lgort.

lv_qty = lv_qty + itab_mchb-qty.

endloop.

itab3-matnr = itab_mard-matnr.

itab3-werks = itab_mard-werks.

itab3-lgort = itab_mard-lgort_g.

itab3-qty = lv_qty.

append itab3.

clear lv_qty.

endloop.

ITAB3 having stroage location wise quantity.

Thanks & Regards,

Durai.V