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: 

modify internal table

Former Member
0 Kudos
65

Hi all,

i need to modify internal table from a value which is stored in a field symbol.how can i do this.

Thanks in advance.

Swati Garg

1 ACCEPTED SOLUTION

0 Kudos
41

Hi,

You can read that record which you want to modify using

READ TABLE itab ASSIGNING <fs_symbol1> WITH KEY field1 = <fs_symbol>.

Then change the values in <fs_symbol1> the internal table is modifed.

You need not use MODIFY statement as you are taking the record into a field symbol ans changing it directly.

Regards,

Ses

3 REPLIES 3

Former Member
0 Kudos
41

Hi try this one...

report zrich_0006.

data: begin of rt occurs 0,

lgart(4) type c,

value type i,

end of rt.

data: begin of intab occurs 0,

1000 type i,

2000 type i,

3000 type i,

end of intab.

field-symbols: <fs_wa> type i.

rt-lgart = '1000'.

rt-value = 123.

append rt.

rt-lgart = '2000'.

rt-value = 456.

append rt.

rt-lgart = '3000'.

rt-value = 789.

append rt.

loop at rt.

assign component rt-lgart

of structure intab to <fs_wa>.

<fs_wa> = rt-value.

at last.

append intab.

endat.

endloop.

0 Kudos
42

Hi,

You can read that record which you want to modify using

READ TABLE itab ASSIGNING <fs_symbol1> WITH KEY field1 = <fs_symbol>.

Then change the values in <fs_symbol1> the internal table is modifed.

You need not use MODIFY statement as you are taking the record into a field symbol ans changing it directly.

Regards,

Ses

Former Member
0 Kudos
41

Hi,

go through this link...

http://72.14.203.104/search?q=cache:PW0nTfKGW78J:www.sap-img.com/ab030.htmDYNAMICINTERNALTABLEABAP+&hl=en&gl=in&ct=clnk&cd=1

http://www.kabai.com/abaps/z53.htm

<b>Reward points</b>

Regards