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

How to MODIFY a dynamic ITAB...

0 Likes
928

Hi!!!

I wants to modify a dynamic itab in a Z-programme which takes inputs. But I can not use the normal itab modifying syntax for it. Therefore I needs to find out a way to modify this itab and it is really essential for my programme.

Please help me on this...

Thanking You,

Yohan.

Hi!!!

I wants to modify a dynamic itab in a Z-programme which takes inputs. But I can not use the normal itab modifying syntax for it. Therefore I needs to find out a way to modify this itab and it is really essential for my programme.

Please help me on this...

Thanking You,

Yohan.

6 REPLIES 6
Read only

Timo_John1
Active Participant
0 Likes
895

Hello,

did you try using field symbols?

Field-Symbols: <line> like line of myTab.

LOOP AT myTab assining <line>.

<line>-mycomonent = 'a'.

ENDLOOP.

Does that help?

Read only

Former Member
0 Likes
895

Take a look at =>

Read only

0 Likes
895

Thanks for the prompt replies.

Dear Amit,

I have already done the things mention in the link you sent me. This is ok for when I loop the dynamic itab step by step. So it will modify the itab, line by line. But, what I wants to do is modify an itab field which have the same key in multiple lines.

For an example say in my structure I have material #. I wants to update all the rows of column 'material description' which have the same material #.

This is where I have stucked...

Please help me...

Thanking you,

Yohan.

Read only

0 Likes
895

You so mean to do this without loop and assigning?

I donu2019t know the way changing the Dynamic internal tables without a loop whereas we do have the option for modify the static internal tables without loop like:

itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp

Read only

0 Likes
895

This message was moderated.

Read only

matt
Active Contributor
0 Likes
895
DATA: lp_data TYPE REF TO DATA.

FIELD-SYMBOLS: <wa> TYPE ANY,
             <field1> TYPE ANY.

CREATE DATA lp_data LIKE LINE OF input_table.
ASSIGN lp_data->* TO <wa>.
READ TABLE input_table WITH KEY ('FIELD1') = val1 ('FIELD2') = val2 INTO <wa>.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa> TO <fld>.
<fld> = 'New Value'.
MODIFY TABLE input_table FROM <wa>.

Might give you some ideas. Also have a look at some of my posts from last month - I think I've covered something similar.

matt