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 table

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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

just use f1 on Modify.

Former Member
0 Kudos

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 .