cancel
Showing results for 
Search instead for 
Did you mean: 

How to Block T.code VA02 ?

Former Member
0 Kudos

Hi Experts,

Iu2019m updating the data into table from a custom program using BAPIu2019s hence I want to block T.code VA02, while custom program was running. How to block VA02 code while running z-program in back end.

Thanks & Regards,

Kranthi.

Accepted Solutions (1)

Accepted Solutions (1)

Jelena
Active Contributor
0 Kudos

You cannot block access to the whole transaction for all the SAP users for that (what if someone already was inside the transaction before the program started?). The proper technique is to lock only the records needed. If you're using a standard BAPI, e.g. for the sales order change, it must already have the locking functionality inside. If someone has the order open in VA02, BAPI will not update it and vice versa. You'll get an error 'Order ... locked by <user>'.

If you need to lock some custom Z table, it can also be done by using lock object (read the documentation). Additionally, you can check those same lock objects for sales documents in your program, if necessary.

Also it might be a good idea to schedule the updates for the time when no or less users are in the system, e.g. at night.

P.S. In any case, please get a qualified ABAPer involved.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Kranthi,

i dont know, if the BAPI works also with t_code VA02. So i would not block the whole Transaction VA02.

I am a programmer so i would do a Block in the Userexit mv45afzz / userexit_vbak with a Popup_to_inform and additional e_message.

It is not in the Standard SAP - but it is in an SAP-User-Exit and from this side ok.

let us see, if there are other solutions.

Hans