‎2007 Jul 16 9:26 AM
hi all
i have two internal tables my first table have date and amount fields .
i second table have 5 amount fields.
i want move first table amount into second table amount fields based on date.
the first table date is less than 30 from sy-datum move second table-first fields,
31- 60 from sy-datum move second table-2 fields,
61-90 from sy-datum move second table-3 fields,
91-120 from sy-datum move second table-4 fields,
over 120 days from sy-datum move second table-5 fields,
how to do this please help me .
regrads,
jai.
‎2007 Jul 16 9:29 AM
Hi,
please check out the link below it might help you
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm
***************please reward points if the information is helpful to you****************
‎2007 Jul 16 9:30 AM
make use of CASE- ENDCASE.
loop at itab.
date = sy-datum - itab-date.
if date lt 30.
itab2-field1 = amut.
endif.
Regards
peram
‎2007 Jul 16 9:41 AM
use the following logic..
loop at itab in wa.
date = sy-datum - wa-date.
if date < 30.
read table itab2 index 1.
wa-amount = itab2-amount.
elseif (date > 30) and (date < 60).
read table itab2 index 2.
wa-amount = itab2-amount.
elseif (date > 60) and (date < 90).
read table itab2 index 3.
wa-amount = itab2-amount.
elseif (date > 90) and (date < 120).
read table itab2 index 4.
wa-amount = itab2-amount.
elseif (date > 120) and (date < 150).
read table itab2 index 5.
wa-amount = itab2-amount.
modify itab from wa.
endloop.
Reward if helpful.
cheers,
Sharadendu