Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

read in internal table

Former Member
0 Likes
553

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.

3 REPLIES 3
Read only

Former Member
0 Likes
508

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****************

Read only

Former Member
0 Likes
508

make use of CASE- ENDCASE.

loop at itab.

date = sy-datum - itab-date.

if date lt 30.

itab2-field1 = amut.

endif.

Regards

peram

Read only

sharadendu_agrawal
Active Participant
0 Likes
508

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