Skip to Content
0
Former Member
Mar 13, 2007 at 04:10 PM

field values

20 Views

Hello,

I need to insert a code which is in bold but it is not consider there.......can you suggest how can i update that field values....it_fg_xvbap-kmpmg into it_fg_xvbap-kwmeng if the material zfreegoods-matnr is not equal to it_fg_xvbap-matnr..

correct the code..

it_fg_xvbap[] = xvbap[].

if not it_fg_xvbap[] is initial.

read table it_fg_xvbap index 1.

select * from zfreegoods into table it_zfreegoods

for all entries in it_fg_xvbap

where matnr eq it_fg_xvbap-matnr

and zpromotype eq '04'.

  • Check if the BOM is completely exploded for mix-match.

if not it_zfreegoods[] is initial.

loop at it_fg_xvbap.

read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.

if sy-subrc eq 0.

v_mitem1_qty = it_fg_xvbap-kwmeng.

v_quantity = it_zfreegoods-quantity.

  • clear v_lines.

  • continue.

<b> if it_zfreegoods-matnr ne it_fg_xvbap-matnr.

it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.

clear v_lines.

continue.

endif.</b>

endif.

v_lines = v_lines + 1.

if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.

v_newqty = v_quantity - it_fg_xvbap-kwmeng.

it_fg_xvbap-kwmeng = v_newqty.

modify it_fg_xvbap.