hi
plz c the below code...
my prblm is i want to store the value of wa_final-preis into new_xeipa-preis if there is only one ebeln...
if there are more procss orders then i want to save the first value to new_xeipa-preis wn second record comes then new_xeipa-preis should be replaced by new value and old_xeipa-preis replaced by old value....
how to do this?
LOOP AT xeipa INTO wa_xeipa.
idx = sy-tabix.
CLEAR: wa_xeina.
READ TABLE xeina INTO wa_xeina WITH KEY infnr = wa_xeipa-infnr.
IF sy-subrc is INITIAL.
wa_final-infnr = wa_xeipa-infnr.
wa_final-ebeln = wa_xeipa-ebeln.
wa_final-bedat = wa_xeipa-bedat.
wa_final-matnr = wa_xeina-matnr.
wa_final-lifnr = wa_xeina-lifnr.
wa_final-peinh = wa_xeipa-peinh.
wa_final-preis = wa_xeipa-preis. "net price
wa_final-bprme = wa_xeipa-bprme.
wa_final-bwaer = wa_xeipa-bwaer.
IF ( wa_final-infnr is NOT INITIAL ) AND ( wa_final-ebeln is NOT INITIAL ) .
ABWEICHUNG = ( new_xeipa-preis / old_xeipa-preis ) * 100 .
ENDIF.
append wa_final to it_final.
ENDIF.