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 Database table from the internal table

Former Member
0 Kudos

Hi ,

i have a internal table I_VBAK (contains only 2 fields

i wou;d like to modify the database table VBAK

5 REPLIES 5

Former Member
0 Kudos

Hello,

It is not recommended to use direct Statements such as Insert / Modify / Update for the Standard SAP Tables which will cause in direct update.

Instead, what you can do is to use a BAPI BAPI_SALESORDER_CHANGE and modify the VBAK table indirectly with the fields that you have in the Internal table.

Hope it was helpful.

Thanks and Regards,

Venkat Phani Prasad Konduri

0 Kudos

Hi Venkat the fiels i am modifying is an customised field ???

not an standard SAP defined one.

Former Member
0 Kudos

Hi,

Try this.

If u want to make use of direct statements like modify/ update, first lock the table using the function module enqueue_e_table, then make changes as per your requirement.

ex: modify <tablename> from <internaltablename>

After modifying unlock the table using the dequeue function module, then use COMMIT WORK stmt to capture the changes in the table.

Sharin.

Former Member
0 Kudos

Hi,

Go through this blog updated by me.

http://theguruspeaksaboutsap.blogspot.com/2008/01/how-to-update-database-records-without.html

But i recommend you not to make changes in standard if you are doing it just for the practice consult your team lead beofre you make changes.And do it only if required.

Regards,

Harini.S

Former Member
0 Kudos

Hi,

tables: vbak.


Data : i_vbak type table of vbak.

field-symbols <vbak> type vbak.


select-options : s_vbeln for vbak-vbeln.

select vbeln
       audat
       from vbak
       into corresponding fields of table i_vbak
       where vbeln in s_vbeln.

loop at i_vbak assigning <vbak>.
<vbak>-audat = '20080917'.
endloop.

update vbak from table i_vbak.

Try this code. It is working for me.

Regards,

Kasuladevi Srinivas