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

inserting single column in internal table

Former Member
0 Likes
3,748

Hiii,

I have to insert data into a single column of a internal table from a field.The rest of the columns of the internal table are already filled.

wats is the syntax for it?? plz reply soon...its very urgent.

1 ACCEPTED SOLUTION
Read only

Former Member
2,049

Hi,

try this

data idx type sy-tabix.


loop at itab.
itab-fld1 = 'some value'.    " your empty field
modify itab index idx.
endloop.

Regards,

V.Balaji

Reward if Usefull...

11 REPLIES 11
Read only

Former Member
0 Likes
2,049

use modify statement

Read only

Former Member
0 Likes
2,049

Hi

pass the value to other field then use modify transporting f1

loop at itab into wa.

v_index = sy-index.

read itab1 from wa1 with key f1 = f1

binary search.

if sy-subrc = 0.

wa-f2 = wa1-f2.

modify itab from wa index v_index transporting f2.

endif.

Regards

Shiva

Read only

Former Member
0 Likes
2,049

hi,

do this way ....


DO 10 TIMES. 
  INSERT sy-index 
         INTO int_tab INDEX 1 
         REFERENCE INTO dref. 
 enddo.  

Read only

0 Likes
2,049

thanks for ur reply.

but cn u be more clear in this...wat is reference and dref?

DO 10 TIMES.

INSERT sy-index

INTO int_tab INDEX 1

REFERENCE INTO dref.

enddo.

Read only

Former Member
2,050

Hi,

try this

data idx type sy-tabix.


loop at itab.
itab-fld1 = 'some value'.    " your empty field
modify itab index idx.
endloop.

Regards,

V.Balaji

Reward if Usefull...

Read only

0 Likes
2,049

try like this..

data: wa like itab.

loop at itab.

wa-4thfield = 'ur value'.

modify itab from wa transporting 4thfield where 1st field =itab-1stfield and 2nd field = itab-2ndfield.

clear:wa.

endloop.

reward if useful..

Regards

Sugumar G

Read only

Former Member
0 Likes
2,049

Hi,

data: V_idx type sy-tabix.

loop at itab.

itab-fld1 = itab1-field1.

modify itab index V_idx .

endloop.

Read only

0 Likes
2,049

i have tried in that way but all the fields of the internal table are getting modified.

for eg

field1---values need not to be changed,shud remain constant.

field2 -- values has to be inserted into this.

without changing other fields of the internal table.

Read only

0 Likes
2,049

It should not happen.... did you try like this??



LOOP AT itab INTO wa_itab.

wa_tab-fld3 = 'Some value'.
MODIFY itab FROM wa_itab INDEX sy-tabix.

ENDIF.

Otherwise ..can you paste your code here..by that we'll get better idea...

Read only

0 Likes
2,049

thanx balaji....the code is working now

Read only

Former Member
0 Likes
2,049

Hi,

data idx type sy-tabix.


loop at itab.
idx = sy-tabix.
itab-fld1 = 'some value'.
modify itab index idx.

endloop.

Regards,

V.Balaji

Reward if Usefull...