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

Cannot update a field

Former Member
0 Likes
1,451

Hi,

I have a question about updating fields.

I am only doing an update:

Update Standard_SAP_Table

Set Field1

Where Primary_Key = Some_Value

Here is the problem. There are fields in this table where I can set to whatever I want but some fields I cannot change the value. It seems like there is some kind of "make field uneditable" function in ABAP?

Is there such functions? How can I find such functions, and disable them? It may not be such a good idea to disable such functionality (since this is a table created by SAP and they may not want custom functionality to update it) but I want to learn how fields may be prevented from being updated/made updatable again.

Maybe I am suppose to use Badis to update it? Either way, how do you find such "make this field uneditable" settings?

thanks!

//Baran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
908

Hi

yes you can update specific records by first selecting that record to work area and modifying the specific field in work area and then modifying DB entry from work area.

E.g. VBAK .

DATA: wa_vbak TYPE vbak.

say you have to modify KUNNR for sales order number 001.

SELECT * from vbak INTO wa_vbak WHERE vbeln = 001.

IF sy-subrc = 0.

wa_vbak-kunnr = 1000.

MODIFY vbak FROM wa_vbak.

ENDIF.

MODIFY statement modifies the value of database record with the values in the work area.

Hence you have to ensure you select all the fields into work area and modify the only field needed.

Regards

Pavan

3 REPLIES 3
Read only

Former Member
0 Likes
909

Hi

yes you can update specific records by first selecting that record to work area and modifying the specific field in work area and then modifying DB entry from work area.

E.g. VBAK .

DATA: wa_vbak TYPE vbak.

say you have to modify KUNNR for sales order number 001.

SELECT * from vbak INTO wa_vbak WHERE vbeln = 001.

IF sy-subrc = 0.

wa_vbak-kunnr = 1000.

MODIFY vbak FROM wa_vbak.

ENDIF.

MODIFY statement modifies the value of database record with the values in the work area.

Hence you have to ensure you select all the fields into work area and modify the only field needed.

Regards

Pavan

Read only

Former Member
0 Likes
908

Hi,

Updates values in a database table. If a WHERE condition is specified, only those records which satisfy the WHERE condition are updated.

Example:

UPDATE sflight SET seatsocc = seatsocc + 3

WHERE carrid = 'LH' AND

connid = '0400' AND

fldate = '20010228'.

The Return Code is set as follows:

SY-SUBRC = 0:

The specified line has been updated.

SY-SUBRC = 4:

The system could not update any line in the table, since there is no line with the specified primary key.

Note: Update is used to change the non-key-fields of a database table with reference to the WHERE condition.

Trythis,

KC

Read only

Former Member
0 Likes
908

Please check if the fields are set to primary key.fields set to primary key are uneditable and cannot be updated with modify or update statement