‎2008 Oct 09 5:27 PM
Hi All,
I have around 20 fields in a custom table. Kunnr and pfnum are the primary keys. I need to modify few fields oamount1 to oamount5 for the table based on the primary key values. Remaining fields values should not be changed.
Please help me.
Thanks,
Veni.
‎2008 Oct 09 5:29 PM
Hi,
You can use use the UPDATE statement with the SET addition.
Ex..
UPDATE ztable
SET oamount1 = '1'
oamount5 = '1'
WHERE kunnr = 'customer number'
AND pfnum = 'PF number'.Thanks
Naren
‎2008 Oct 09 5:29 PM
Hey try this,
Modify <dbtab> from <workarea>.
You can fill the values in the work area.
Modify modifies the value when there is no change in the key field and when there is change in the key field the modify statement insert and there will be a new entry in th table.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 9, 2008 6:30 PM
‎2008 Oct 09 5:29 PM
Hi,
You can use use the UPDATE statement with the SET addition.
Ex..
UPDATE ztable
SET oamount1 = '1'
oamount5 = '1'
WHERE kunnr = 'customer number'
AND pfnum = 'PF number'.Thanks
Naren
‎2008 Oct 09 5:31 PM
you can use MODIFY ...WHERE <CONDITION> TRANSPORTING <f1> <f2>..
just use f1 on Modify.
‎2008 Oct 09 5:34 PM
wa_source-kunnr = 'XXXXXX'.
wa_source-pfnum = 'XXXXXXXXX'.
wa_source-oamount1 ='XXX'.
...
...
.....
wa_source-oamount5 ='XXX'.
Modify dbtable from wa_source.
If records are more go for itab.
To know more hit f1 on modify .