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_member1349771
Participant
0 Kudos

In my internal table i hav three records.

RAM2

RAM1

Ram3

Now i wish to take these in diffrent variables x = ram2 y= ram1 & z= ram3.

How to do the same plz guide

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

loop at itab.

if sy-tabix = 1.

move itab-field to y

elseif sy-tabix = 2.

move itab-field to x

else.

move itab-field to z.

endif.

endloop.

plz reward points if dis helps

Message was edited by:

user_15

6 REPLIES 6

former_member188827
Active Contributor
0 Kudos

loop at itab.

if sy-tabix = 1.

move itab-field to y

elseif sy-tabix = 2.

move itab-field to x

else.

move itab-field to z.

endif.

endloop.

plz reward points if dis helps

Message was edited by:

user_15

Former Member
0 Kudos

loop at itab into wa.

if sy-index = 1.

var1 = wa-field1

elseif sy-index = 2.

var2 = wa-field1.

else.

sy-index = 3.

var3 = wa-field1.

endloop.

Former Member
0 Kudos

Hi,

do like this

loop at itab.

case sy-tabix.

when 1.

move itab-value to x.

when 2.

move itab-value to y.

when 3.

move itab-value to z.

endloop.

Reward if this helps,

Satish

former_member404244
Active Contributor
0 Kudos

Hi,

Try like this

Read table itab with key field = 'RAM1'.

If sy-subrc eq 0.

X = itab-field.

endif.

similarly do 2 more read statements and pass ur values to variables..

Reward if helpful.

Regards,

nagaraj

former_member188827
Active Contributor
0 Kudos

if ur internal table is without headr line, den..

loop at itab into wa.

if sy-tabix = 1.

move wa-field to y.

elseif sy-tabix = 2.

move wa-field to x.

else.

move wa-field to z.

endif.

endloop.

write:/ x,y, z.

Former Member
0 Kudos

I think the posts by user_15 will solve the problem.