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: 

How to modify the internal table?

naveen_inuganti2
Active Contributor
0 Kudos

Hi Friends.,

How to modify the internal table without using MODIFY statement?

Thanks,

Naveen.I

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos

Hi Naveen,

please note if i am not wrong.

how can you expect the system to modify an interanl table without we write a code which is given by the ABAP Key words.

please use modify statement.

and i think even if you use field symbols then also the FS will not modify your internal table.

may subroutines if you pass the value by reference and the form gets executed till the end , you may modify the values.

hope this will serve your purpose.

thanks and regards

Ramchander Rao.K

Edited by: ramchander krishnamraju on Nov 20, 2008 7:03 AM

7 REPLIES 7

Former Member
0 Kudos

Hi,

Use Field Symbols

Something like this

DATA : itab TYPE TABLE OF string,
       wa   TYPE string.

FIELD-SYMBOLS : <wa> TYPE string.

wa = 'ABC'.
APPEND wa TO itab.
wa = 'ABC'.
APPEND wa TO itab.
wa = 'ABC'.
APPEND wa TO itab.

LOOP AT itab ASSIGNING <wa>.

  <wa> = 'DEF'.

ENDLOOP.

Regards

Edited by: Rajvansh Ravi on Nov 20, 2008 7:02 AM

former_member1245113
Active Contributor
0 Kudos

Hi Naveen,

please note if i am not wrong.

how can you expect the system to modify an interanl table without we write a code which is given by the ABAP Key words.

please use modify statement.

and i think even if you use field symbols then also the FS will not modify your internal table.

may subroutines if you pass the value by reference and the form gets executed till the end , you may modify the values.

hope this will serve your purpose.

thanks and regards

Ramchander Rao.K

Edited by: ramchander krishnamraju on Nov 20, 2008 7:03 AM

Former Member
0 Kudos

Hi,

without using modify u can use field sysmbols

Thanks & Regards

Former Member
0 Kudos

Following way you can modify the internal table...

Modify... {TABLE itab}|{itab INDEX idx} FROM wa [TRANSPORTING comp1 comp2 ...] [result].

Modify... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.

Modify... { ASSIGNING <fs> [CASTING] }

| { REFERENCE INTO dref }.

Edited by: avinash kodarapu on Nov 20, 2008 11:34 AM

Edited by: avinash kodarapu on Nov 20, 2008 11:34 AM

Former Member
0 Kudos

Hi,

you cannot modify internal table without using modify statement.

yes if you want to jst add new record in internal table use append ststemet.

Thanks & Regards

Former Member
0 Kudos

MODIFY itab.

MODIFY itab INDEX sy-tabix.

MODIFY itab TRANSPORTING name1 s_customer WHERE kunnr = itabkunnr

former_member189059
Active Contributor
0 Kudos

If this is just a question to know if it can be done, then you could transfer a row to a workarea, delete the row from the table, modify the workarea and append it back to your internal table

You may then need to sort your table

However practically.. this would never be done