Application Development 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: 

Internal table

Former Member
0 Kudos

Hi all,

I have an requirement like this, i have a internal table like the one below, iam fetching the values in a final internal table from other internal tables used in my report .Now i want to fill the fields f2, f3 and f4 in such way that based upon field f1 i want to fill other fields.Could you please let me know how to acheive this.Like i want to do a compare on the field f1 and then if the condition is satisfied i want to fill f2,f3& f4 correspondingly.For eg if f1 is 4, f2 should be poulated on the second row, if f1 is 1 f2 should be poulated on the first row similar to that.

f1 f2 f3 f4

1 0 0 0

4 0 0 0

3 0 0 0

Thanks in advance..

Best Regards

Meenakshi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Meena,

Have you tried with any CASE statements.

According to your values how you next internal table records has to be filled based on your first record write using CASE syntax.

Cheers!!

VEnk@

4 REPLIES 4

Former Member
0 Kudos

Hi Meena,

Have you tried with any CASE statements.

According to your values how you next internal table records has to be filled based on your first record write using CASE syntax.

Cheers!!

VEnk@

Former Member
0 Kudos

Hello,

Please try to use Condition statements

For eg: case

loop at gt_finaltab in to wa_finaltab.

read table gt_yourtab into wa_yourtab "<<< Internal Table you have mentioned

case wa_yourtab-f1

when 1.

wa_finaltab-field1 = wa_yourtab-f2.

when 2.

wa_finaltab-field2 = wa_yourtab-f3.

when 3.

wa_finaltab-field3 = wa_yourtab-f4

..................

endcase

endloop

Regards,

Lijo

Former Member
0 Kudos

hi ,

loop at ohter table .

read table itab with key f1 = ohter table-f1 .

move corresponding itab into othertable .

transport othertable.

endloop.

Thanks and regards.

Priyank dixit

Former Member
0 Kudos

useful