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 standard table

Former Member
0 Likes
873

Hi all.

I have issue to update sap database table from ALV.

Can I update table with internal table which is not type table of that standard table. I have some same fields not all. Only one fileld is for update.

Is it possible if is, please how.

Kind regards.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
712

First the following text only apply to Customer Database Tables, not SAP standard tables that MUST be updated through SAP tools like BAPI or BDC.

There are only two syntaxes allowed for [UPDATE dbtab|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm]

- [FROM wa |http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_2@2@] or [FROM TABLE itab|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_3@3@] require that you first read the whole data as it will replace every non-key field.

- [SET set_expression|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_1@1@] can change a subset of fields, but you have to use it in a LOOP/ENDLOOP as it change each specified field of every record satisfying the condition of the WHERE option to the same value.

Regards,

Raymond

4 REPLIES 4
Read only

Former Member
0 Likes
712

Hi Nick

Here is a sample piece of code just for your reference.

<<Dangerous sample code removed by moderator>>

Thanks & Regards

Moderator Message: If you are not sure of the answer - Stay away!

Edited by: kishan P on Apr 8, 2011 12:15 PM

Read only

0 Likes
712

But one remembers, the better way to update standard table is using BAPI's.

[ ]'s

Douglas Sant'Ana Santos | SAP ABAP

Linkup SAP

Read only

Former Member
0 Likes
712

Which table?

Rob

Read only

RaymondGiuseppi
Active Contributor
0 Likes
713

First the following text only apply to Customer Database Tables, not SAP standard tables that MUST be updated through SAP tools like BAPI or BDC.

There are only two syntaxes allowed for [UPDATE dbtab|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm]

- [FROM wa |http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_2@2@] or [FROM TABLE itab|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_3@3@] require that you first read the whole data as it will replace every non-key field.

- [SET set_expression|http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SOURCE.htm#&ABAP_ALTERNATIVE_1@1@] can change a subset of fields, but you have to use it in a LOOP/ENDLOOP as it change each specified field of every record satisfying the condition of the WHERE option to the same value.

Regards,

Raymond