2008 Aug 06 12:37 PM
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?
2008 Aug 06 12:43 PM
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
2008 Aug 06 12:45 PM
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
2008 Aug 06 12:47 PM
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
2008 Aug 06 12:48 PM
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.
2008 Aug 06 12:50 PM
2008 Aug 06 12:54 PM
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.