‎2007 Nov 06 10:38 AM
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
‎2007 Nov 06 10:44 AM
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
‎2007 Nov 06 10:44 AM
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
‎2007 Nov 06 11:07 AM
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
‎2007 Nov 06 11:13 AM
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