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

Update Internal Table.

Former Member
0 Likes
5,388

Hi

my internal table have 10 fields. i need to populate the data into first field based on 9 fields data.

i did that part. but my problem is how to append that first field data into corresponding row of same internal table body.

8 REPLIES 8
Read only

Former Member
0 Likes
1,140

Hi,

Read the sy-index when u r doing the calucaltion on 9 fields. Store it is local varaible like l_index.

Then after the calculation use the following syntax.

MODIFY ITAB WITH INDEX l_index transporting <field 1>.

Regards,

Vivek.

Reward if helps.

Read only

0 Likes
1,140

MODIFY ITAB INDEX l_index transporting <field 1>.

Read only

Former Member
0 Likes
1,140

Hi,

In loop read the record of internal table.

assign the value to the field and modify that internal table.

loop at itab.

itab-field1 = 'XYZ'.

modify itab.

endloop.

Rgds,

Prakash

Read only

srinivas_akiri
Active Participant
0 Likes
1,140

Hi,

use modify statement in the loop of that table.

for example:

loop at itab.

itab-field1 = itab-field2 + itab-field3 + ..

modify itab intex sy-tabix.

endloop.

regards

srini

Read only

Former Member
0 Likes
1,140

loop at itab.

<do your checking assign the value for itab-f1 = 'abc' or something>

modify itab index sy-tabix.

endloop.

regards

shiba dutta

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,140

Hi,

loop at itab into wa.

wa-field1 = ...

modify itab from wa transporting field1 index sy-tabix.

endloop.

Read only

Former Member
0 Likes
1,140

Hi,

Plz. use this elegant and simplest way, by using of field-symbols!


TYPES: BEGIN OF t_itab,
         col1 type n,
         col2 type n,
         col3 TYPE n,
       END OF t_itab.

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

FIELD-SYMBOLS: <fs> TYPE t_itab.

START-OF-SELECTION.

  ....
  LOOP AT itab ASSIGNING <fs>.
    <fs>-col1 = <fs>-col2 + <fs>-col3.
  ENDLOOP.
  ....

END-OF-SELECTION.

if useful, please reward

Read only

Former Member
0 Likes
1,140
LOOP AT ITAB.

MODIFY ITAB INDEX SY-TABIX TRANSPORITNG  F1.

ENDLOOP.

for the first field when changes are performed sy-tabix eq 1 and here the changed value say F1 (will be ur field ) overlapping in that field.

u have to use this .

regards,

vijay