Skip to Content
0
Former Member
Jun 06, 2009 at 06:55 AM

regarding if condition

12 Views

hiii,

i want to actually add the gross amount against a GR if there is more than one line item in a GR as i am showing only header level items against the GR. But as i am adding all the amount is getting added at every level..can anyone help me out...here is my code. "dmbtr is the field of the amount"

clear i_final3.

refresh i_final3.

i = 0.

if i_final[] is not initial.

loop at i_final.

if i_final-augbl is not initial and i_final-augbl ns 'na'.

clear sy-tabix.

if i_final-zeile = 1.

i = i + '1'.

i_final3-snum = i.

i_final3-mblnr = i_final-mblnr.

i_final3-mjahr = i_final-mjahr.

  • i_final3-zeile = i_final-zeile.

i_final3-budat = i_final-budat.

i_final3-xblnr = i_final-xblnr.

i_final3-bldat = i_final-bldat.

i_final3-frbnr = i_final-frbnr.

i_final3-lifnr = i_final-lifnr.

  • i_final3-matnr = i_final-matnr.

i_final3-ebeln = i_final-ebeln.

i_final3-belnr = i_final-belnr.

i_final3-b_budat = i_final-b_budat.

i_final3-augbl = i_final-augbl.

i_final3-augdt = i_final-augdt.

i_final3-dmbtr = i_final-dmbtr.

i_final3-chect = i_final-chect.

endif.

if i_final-mblnr = i_final3-mblnr.

i_final3-dmbtr = i_final3-dmbtr + i_final-dmbtr.

endif.

append i_final3.

endif.

endloop.

end