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: 

MANIPULATING INTERNAL TABLE...

Former Member
0 Kudos

Hello,

I have a internal table I_TAB[] as follows:

ID--VALUE---ATTRIBUTE

P1--36--


D

P3--34--


Y

P9--32--


J

I want to do a mass change in the ID value of this internal table such that, all the IDs get changed

to 'PA' as follows. I don't want to loop at the internal table, pas value to work area and then one by one from peformcne standpoint.

ID--VALUE---ATTRIBUTE

PA--36--


D

PA--34--


Y

PA--32--


J

Regards,

Rajesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You need to use work area as follows... otherwise i guess its not possible.. Do F1 on Modify and explore

Try this...



DATA: WA_ITAB TYPE ITAB.

WA_ITAB-ID = 'PA'.
MODIFY ITAB FROM WA_ITAB TRANSPORTING ID.

Thanks,

SKJ

5 REPLIES 5

Former Member
0 Kudos

You need to use work area as follows... otherwise i guess its not possible.. Do F1 on Modify and explore

Try this...



DATA: WA_ITAB TYPE ITAB.

WA_ITAB-ID = 'PA'.
MODIFY ITAB FROM WA_ITAB TRANSPORTING ID.

Thanks,

SKJ

amit_khare
Active Contributor
0 Kudos

There no single statement which can do this as the data in each row will be different and will have to be changed individually. The best way I can think of is using field symbols

Loop at itab assigning <fs>.

****Statement

endloop.

~ As found in forum

Former Member
0 Kudos

Try this code:

w_tab-id = 'PA'.

modify i_tab from w_tab transporting id

where id NE 'PA'.

Edited by: Joyjit Ghosh on Sep 24, 2008 10:24 PM

Former Member
0 Kudos

Update itab SET ID = 'PA'.

Former Member
0 Kudos

I will vote for

LOOP AT I_TAB[]  ASSIGNING <FS>.
<FS>-ID = 'PA'.
ENDLOOP.