Application Development and Automation 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: 
Read only

modify internal table using internal table?

former_member5472
Active Contributor
19,269

hi all,

can we modify a internal table using another internal table without using work area??

1 ACCEPTED SOLUTION
Read only

abdulazeez12
Active Contributor
0 Likes
7,926

No

MODIFY is only from Work area.

See the syntax for more info:

Change an internal table

- MODIFY itab [FROM wa] [INDEX idx].

[TRANSPORTING f1 ... fn [WHERE cond]].

- MODIFY TABLE itab [FROM wa]

[TRANSPORTING f1 ... fn].

- MODIFY itab [FROM wa]

TRANSPORTING f1 ... fn WHERE cond.

Reward points

Shakir

7 REPLIES 7
Read only

abdulazeez12
Active Contributor
0 Likes
7,927

No

MODIFY is only from Work area.

See the syntax for more info:

Change an internal table

- MODIFY itab [FROM wa] [INDEX idx].

[TRANSPORTING f1 ... fn [WHERE cond]].

- MODIFY TABLE itab [FROM wa]

[TRANSPORTING f1 ... fn].

- MODIFY itab [FROM wa]

TRANSPORTING f1 ... fn WHERE cond.

Reward points

Shakir

Read only

Former Member
0 Likes
7,926

No ,

you can't modify a internal table using another internal table without using work area because in an Intrenal table data 1st come in the header part then it can be modify.

Ankur

Read only

Former Member
0 Likes
7,926

Hi ,

Well,we can not modify an internal table from another as the syntax of modify doesn't support.

As per my knowledge is concerned if the structure of both the internal tables are same then i guess you can do one thing say if ur having itab1 and itab2 as 2 internal tables and if u want to pass the values into that then i guess u can go for itab2[] = itab1[].

Reward points if this is useful.

thanq you.

Read only

0 Likes
7,926

hi ,

in this case my previous records will be over written.

i need to modify existing records.

Read only

Former Member
0 Likes
7,926

loop at itab1 into wa1.

read table itab2 into wa2 with key = wa1 binary search.

move-corresponding wa2 to wa1.

modify itab1 with wa1.

endloop.

this is logic for modifying a internal table with contents of other.

reward if helpful

regards

vivek

Read only

Former Member
7,926

Hi,

You can modify the DB Table from Internal table as below

MODIFY dbtab FROM TABLE itab.

But you can not modify the internal table from another internal table directly without using work area.

Regards,

Satish

Read only

former_member5472
Active Contributor
0 Likes
7,926

thanks for your help!