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: 

modify

Former Member
0 Kudos
105

hi

i have table tbsegsub structure bseg_subst

i want to modify or to insert new value into the column xref3 when index= 1

how to do that?

6 REPLIES 6

Former Member
0 Kudos
78

You can do this way.

Use update statement in ur program. It changes already existing record or else inserts a new record.

go through the following link for more information.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify_d.htm

former_member404244
Active Contributor
0 Kudos
78

Hi,

u want only first record of the db table to be updated...?? if yes..

select single * from tbsegsub into wa_sub .

wa_sub-xref = <new value>.

modify tbsegsub from wa_sub .

Regards,

Nagaraj

Former Member
0 Kudos
78

hiii

use code given follow.

LOOP AT i_output INTO wa_output.
      READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_output-matnr.
      wa_output-maktx = wa_makt-maktx.
      MODIFY i_output FROM wa_output.
      CLEAR wa_output.
    ENDLOOP.                           " LOOP AT i_output

if you want to modify only for particular index then use that with READ statement

like

READ TABLE i_makt index 1 INTO wa_makt WITH KEY matnr = wa_output-matnr.

regards

twinkal

Former Member
0 Kudos
78

http://sapprograms.blogspot.com/2008/04/modify-itab.html

report .

types: begin of itab ,

test type c ,

test2 type c,

end of itab .

types: begin of itab1 ,

test type c ,

test1 type i,

test2 type c,

end of itab1 .

data: wa_itab type itab ,

it_itab type table of itab with header line,

wa_itab1 type itab1 ,

it_itab1 type table of itab1 with header line.

wa_itab-test = 'A'.

wa_itab-test2 = 'a'.

append wa_itab to it_itab .

append it_itab .

it_itab-test = 'B'.

it_itab-test2 = 'b'.

append wa_itab to it_itab .

append it_itab .

it_itab-test = 'C'.

it_itab-test2 = 'c'.

append wa_itab to it_itab .

append it_itab .

it_itab-test = 'D'.

it_itab-test2 = 'd'.

append wa_itab to it_itab .

append it_itab .

wa_itab1-test1 = 1.

wa_itab1-test2 = 'a'.

append wa_itab1 to it_itab1 .

append it_itab1 .

wa_itab1-test1 = 2.

wa_itab1-test2 = 'b'.

append wa_itab1 to it_itab1 .

append it_itab1 .

wa_itab1-test1 = 3.

wa_itab1-test2 = 'c'.

append wa_itab1 to it_itab1 .

append it_itab1 .

wa_itab1-test1 = 4.

wa_itab1-test2 = 'd'.

append wa_itab1 to it_itab1 .

append it_itab1 .

loop at it_itab into wa_itab.

read table it_itab1 into wa_itab1 with key test2 = wa_itab-test2 .

move-corresponding wa_itab to wa_itab1.

modify it_itab1 from wa_itab1 index sy-tabix.

endloop .

loop at it_itab1.

if not it_itab1-test is initial.

write:/ it_itab1-test,

it_itab1-test1,

it_itab1-test2.

endif.

endloop.

Former Member
0 Kudos
78

Hi,

Try this

MODIFY itab INDEX 1 FROM wa

TRANSPORTING xref3.

Former Member
0 Kudos
78

hi ami.

like these example from f1 try out with your data. hope u will get answer:

DATA message_wa TYPE t100.

message_wa-sprsl = 'EN'.

message_wa-arbgb = 'MYMSGCLASS'.

message_wa-msgnr = '100'.

message_wa-text = 'Some new message ...'.

MODIFY t100 FROM message_wa.

same write down your owh table and structure name and reqquired fields.