2006 Oct 16 2:43 PM
hi all
i want to modify values ztable from a internal table ....
for eg : the ztable contains matnr and accept_qty
matnr qty
mat01
mat02
i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
thanks
lokesh
hi all
i want to modify values ztable from a internal table ....
for eg : the ztable contains matnr and accept_qty
matnr qty
mat01
mat02
i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
thanks
lokesh
2006 Oct 16 2:45 PM
hi,
try this command:
update ztab
set f1 = 1
...
where f2 = 'X'.A.
Message was edited by: Andreas Mann
2006 Oct 16 2:46 PM
Hi Lokesh Chander,
Can you show your code?
It should be something like this:
data: begin of itab occurs 0.
include structure ztab.
data: end of itab.
itab-matnr = 'mat1'.
itab-accept_qty = 1.
append itab.
clear itab.
itab-matnr = 'mat2'.
itab-accept_qty = 1.
append itab.
clear itab.
modify ztab from table itab. "itab must be of the same type as ztab.
2006 Oct 16 2:49 PM
Use conversion exit to convert the Material into SAP internal format before modify/update statement.
Normally this will fails when you are passing MATNR directly without conversion. Just have a look in debug.
Thanks
eswar
2006 Oct 16 2:54 PM
hi,
before that :- modify statemnt will modify a record if there is record having the same key like that of record in work area.
if there is no record in itab with key of work area record, it will insert a new record in itab.
look this sample code.
*modify internal table
loop at itab into wa.
wa-field1 = data1.
wa-field2 = data2.
wa-field 3= data3.
modify itab from wa transporting field1 field2 field3 where key_field = wa-keyfield. "there shuld not be any chang in key field.
endloop.
*now update database table
*work area and data base structure shuld be same type
if itab[] is not initial.
modify ztable from table itab.
endif.
rgds
anver
if hlped pls mark points
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |