02-02-2010 9:22 AM
Hello All,
in my Below code this if condition is not working properly. Here i want data like when BLART = RV this time amount move in one field and if BLART = DZ this time amount move in different filed. so i got right data in my ALV but now this distribution is not done by me. So can you please help me out..........
loop at itab.
move itab-kunnr to itab1-kunnr.
move itab-belnr to itab1-belnr.
MOVE itab-zuonr to itab1-zuonr.
MOVE itab-budat to itab1-budat.
MOVE itab-blart to itab1-blart.
if itab-blart = 'RV'.
MOVE itab-dmbtr to itab1-dmbtr.
endif.
if itab-blart = 'DZ'.
MOVE itab-dmbtr to dmbtr1.
endif.
append itab1.
endloop.
Thanks in Advance.
02-02-2010 9:31 AM
Hi,
Your code is correct.
I think you need to Clear the data after Append.
Please check Document type BLART is correct.
Try the below code....
loop at itab.
itab1-kunnr = itab-kunnr.
itab1-belnr = itab-belnr.
itab1-zuonr = itab-zuonr.
itab1-budat = itab-budat.
itab1-blart = itab-blart.
if itab-blart = 'RV'.
itab1-dmbtr = itab-dmbtr.
elseif itab-blart = 'DZ'.
itab1-dmbtr = itab-dmbtr1.
endif.
append itab1.
clear : itab,itab1.
endloop.
.
Regards
Arbind
02-02-2010 9:26 AM
Hi,
make sure BLART field is having either 'DZ' or 'RV' VALUE. Try like this...
loop at itab.
move itab-kunnr to itab1-kunnr.
move itab-belnr to itab1-belnr.
MOVE itab-zuonr to itab1-zuonr.
MOVE itab-budat to itab1-budat.
MOVE itab-blart to itab1-blart.
if itab-blart = 'RV'.
MOVE itab-dmbtr to itab1-dmbtr.
elseif itab-blart = 'DZ'.
MOVE itab-dmbtr to itab1-dmbtr1.
endif.
append itab1.
endloop.
Regards,
Nagaraj
02-02-2010 9:31 AM
Hi,
Your code is correct.
I think you need to Clear the data after Append.
Please check Document type BLART is correct.
Try the below code....
loop at itab.
itab1-kunnr = itab-kunnr.
itab1-belnr = itab-belnr.
itab1-zuonr = itab-zuonr.
itab1-budat = itab-budat.
itab1-blart = itab-blart.
if itab-blart = 'RV'.
itab1-dmbtr = itab-dmbtr.
elseif itab-blart = 'DZ'.
itab1-dmbtr = itab-dmbtr1.
endif.
append itab1.
clear : itab,itab1.
endloop.
.
Regards
Arbind
02-02-2010 9:44 AM
what data type declare for your internal table fields (blart) , u have to decalre exact data type exactly what is in table data type to that field otherwise some times it will going wrong like data type mismatching and etc...
first check data type of the field in your internal table.
then u will get solution.