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

ALV

Former Member
0 Likes
341

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.

1 REPLY 1
Read only

Former Member
0 Likes
310

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