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

Modify table

Former Member
0 Likes
655

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

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

4 REPLIES 4
Read only

Former Member
0 Likes
611

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

Read only

Former Member
0 Likes
612

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

Read only

Former Member
0 Likes
611

you can use MODIFY ...WHERE <CONDITION> TRANSPORTING <f1> <f2>..

just use f1 on Modify.

Read only

Former Member
0 Likes
611

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 .