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

update......... only few fields.

naveen_inuganti2
Active Contributor
0 Likes
994

hi!

say i have 150 fields............... 100 fields are modiafable..........

i want to change 10 fields among these 100.

what should i use : modify or update??

i dont want to enter remaining 90 fields.....they remain blank in the display screen.....

i only enter these 10 random modifying fields..........

I used - UPDATE <db TABLE> FROM <TABLE>.

Now... i need to enter all fields.......... if i give all fields "optional" in Export parameter then only non optional fields ned to be given. but all other optional fields which were not given input become blank in the datadict.

what should i do to change only few fields and the fields which i do not enter remain with the old values.???

thank u in advance.

regards.

1 ACCEPTED SOLUTION
Read only

former_member217544
Active Contributor
0 Likes
943

Hi Naveen,

you can use the following syntax:

if field2,field3,field4 are the fields you want to update

UPDATE <dbtable>

SET field2 = wa_table-field1

field3 = wa_table-field3

field4 = wa_table-field4

WHERE field1 = wa_table-field1.

This will update the fields which you entered in SET condition without affecting the other fields of teh same record.

field1 should be the primary key for the db table

Rewards if useful.

Thanks & Regards,

Swarna Munukoti.

4 REPLIES 4
Read only

Former Member
0 Likes
943

First of all get the entry from Table(with the Key)

into header and change what ever fields you want to change ..

then update table using the header ...

Read only

former_member217544
Active Contributor
0 Likes
944

Hi Naveen,

you can use the following syntax:

if field2,field3,field4 are the fields you want to update

UPDATE <dbtable>

SET field2 = wa_table-field1

field3 = wa_table-field3

field4 = wa_table-field4

WHERE field1 = wa_table-field1.

This will update the fields which you entered in SET condition without affecting the other fields of teh same record.

field1 should be the primary key for the db table

Rewards if useful.

Thanks & Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
943

hi check this it had n=many options you first check which is best for u..

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/update.htm

regards,

venkat

Read only

Former Member
0 Likes
943

hi pal...

which ever fields u want to update make it in input fields where as remaining 90 fields u can put it in output field in proerties..then there is no possibility of changing...u can jst change only 10 records...

regards,

vamshi