2006 Aug 17 4:00 PM
Hi All ,
I have a requirment For adding fields for certain conditions. Am reading a BOM to an internal table which looks like this .
MATNR LGORT BDMG MEINS
AA 1 20 G
AB 1 3000 G
AC 1 4000 G
AD 2 50 KG
AF 2 60 KG
i need to add when lgort = 1 or 2 , matnr NE aa , then total bdmg = 117 kg.
Any examples code pls.
Thxs,
vin.
Hi All ,
I have a requirment For adding fields for certain conditions. Am reading a BOM to an internal table which looks like this .
MATNR LGORT BDMG MEINS
AA 1 20 G
AB 1 3000 G
AC 1 4000 G
AD 2 50 KG
AF 2 60 KG
i need to add when lgort = 1 or 2 , matnr NE aa , then total bdmg = 117 kg.
Any examples code pls.
Thxs,
vin.
2006 Aug 17 4:42 PM
Hi Vin,
Assuming what you said,do this way,
data: bdmg1 like bom-bdmg.
read all the BOM data into internal table it_bom initially.
clear bdmg1.
Loop at it_bom.
if it_bom-matnr ne 'AA' and (LGORT eq '1' or LGORT eq '2').
if it_bom-meins eq 'G'.
it_bom-Bdmg = it_bom-Bdmg / 1000.
bdmg1 = it_bom-Bdmg + Bdmg1.
else.
bdmg1 = it_bom-Bdmg + Bdmg1.
endif.
endif.
endloop.
write: / "bdmg1 is", bdmg1.
Hope this helps.
Regards,
Vivek
PS: Award points if helpful
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |