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

To update SAP Table Itself by Z program

Former Member
0 Likes
1,147

Hello All,

We are following some process for Material Stock transfer. The process goes like this.

Reservation(SAP Std) ->Packing List(Z pgm)->Material issue(SAP Std.)

As per the requirement I need to update one flag fields of table RESB (Reservation Details) with the z program packing List, But Here we have decided not to create BDC instead of that directly update the table from z program.

I as per my knowledge it's not recommanded directly to update saP tables . Some one tell me some good solution which is better way to do the same.

Best Regards

Swati ......

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,052

It is never recomended to update table using z programs, instead you can you some BAPI or functional module if you are not interested to use BDC.

Check the following bapis for this purpose:

BAPI_RESERVATION_CHANGE

BAPI_RESERVATION_CREATE1

BAPI_RESERVATION_DELETE

BAPI_RESERVATION_GETDETAIL

BAPI_RESERVATION_GETITEMS1

BAPI_RESERVATION_CREATE

BAPI_RESERVATION_GETDETAIL

BAPI_RESERVATION_GETITEMS

Edited by: Abhishek Sarkar on Feb 7, 2008 8:23 AM

Hello All,

We are following some process for Material Stock transfer. The process goes like this.

Reservation(SAP Std) ->Packing List(Z pgm)->Material issue(SAP Std.)

As per the requirement I need to update one flag fields of table RESB (Reservation Details) with the z program packing List, But Here we have decided not to create BDC instead of that directly update the table from z program.

I as per my knowledge it's not recommanded directly to update saP tables . Some one tell me some good solution which is better way to do the same.

Best Regards

Swati ......

5 REPLIES 5
Read only

Former Member
0 Likes
1,053

It is never recomended to update table using z programs, instead you can you some BAPI or functional module if you are not interested to use BDC.

Check the following bapis for this purpose:

BAPI_RESERVATION_CHANGE

BAPI_RESERVATION_CREATE1

BAPI_RESERVATION_DELETE

BAPI_RESERVATION_GETDETAIL

BAPI_RESERVATION_GETITEMS1

BAPI_RESERVATION_CREATE

BAPI_RESERVATION_GETDETAIL

BAPI_RESERVATION_GETITEMS

Edited by: Abhishek Sarkar on Feb 7, 2008 8:23 AM

Read only

Former Member
0 Likes
1,051

Hi Swati,

You are completely right: never update SAP tables directly, because you can never be sure if you get inconsisency in your database (this flag might be linked to fields in other tables).

Regards,

John.

Read only

former_member404244
Active Contributor
0 Likes
1,051

Hi,

Generally it is not recomended to use direct update to dataabse table as there is possibilty of inconsistancy..but here as u r updating one flag,it don't think there should be problem with it..u can do it...but remeber before u do any update to dbtable u should lock the table

use the FM "ENQUEUE_E_TABLE".

now update the table

then use FM "DEQUEUE_E_TABLE".

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,051

Hi Swati,

You can directly update the table RSEB. But be clear with the requirement that when you are just upadting that particular table it doesnot effect other. As the table is related to many other table.

Would suggest to use BAPI instead.

Jayant Sahu.

Read only

Former Member
0 Likes
1,051

Of course, we can upadte the standard table using the UPDATE statement from a WORK AREA.

But it is strongly recommended that we should not update the standard tables directly.

If u do so, only onle table will be updated, all other related tables won't get updated. It leads to database inconsistancy.

So, u have to use Transaction (BDC) or FM (BAPI) to update the standard tables.

Do not update by writing a UPDATE query.

Pl reward if useful

Narendra