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: 

Is it possible to know programatically if a transaction code is in edit mode?

Former Member
0 Kudos

Hi Experts,

Is it possible to know programatically if a transaction code is in edit mode/display mode?

Please help me if anyone knows.

Regards,

Kasi.

1 ACCEPTED SOLUTION

former_member200338
Active Contributor
0 Kudos

May i know which transaction are you looking for ?

In SD, it can be found using variable T180-AKTYP.

V =  Change

H = Create

13 REPLIES 13

former_member200338
Active Contributor
0 Kudos

May i know which transaction are you looking for ?

In SD, it can be found using variable T180-AKTYP.

V =  Change

H = Create

0 Kudos

Hi Niyaz,

I am looking for the Tcodes OX02 , OX16, OB62, OB37 AND OBC5.

Regards,

Kasi.

0 Kudos

All these are maintenance transactions. May I know why do you need to find out display mode? what is the requirement?

0 Kudos

Yes these are maintainance Tcodes. i have requirement to create a company code by using Ecatt script and then Assign it to company and COA and Fiscal year and ....

i have developed script and running succesfully and able to do all these tasks.

But i just want to validate before executing the Ecatt scripts. If the Tcodes is in change mode by any of the user in the same system i want to dispaly popup before script execution.

otherwise my program executing the scripts and throwing error like " Error in executing the Ecatt script".

Regards,

kasi.

0 Kudos

Display mode is possible when

1. Someone else is locking the table. You can find whether the table is locked or not before calling your script.

2. User doesnt have change access to the mentioned table. You could look at authorization object and do a pre-check. Run ST01 trace to find the authorization objects

0 Kudos

I want to get the details of the user who is opened the Tcode. And want to popup message like in standard way.

My requirement is from where i can extract those details programatically.

0 Kudos

You could use FM  VIEW_ENQUEUE to find out whether the table is locked. Pass the table name. For example, for transaction OBC5 the sample code would be.

CALL FUNCTION 'VIEW_ENQUEUE'

         EXPORTING

           view_name        = 'V_001_P'

           action           = 'E'

           enqueue_mode     = 'E'



You can find the view name from SE93 of respective tcode.

0 Kudos

Hi Niyaz,

Thanks for the reply, i have implemented the same logic for all tcode, giving whether the tcode locked or not . But i also want to get the user who is locked the Tcode.

Regards,

Kasi.

0 Kudos

check it in variables sy-msgv1 or msgv2.

0 Kudos

Thank you Niyaz.

Former Member
0 Kudos

Hi Prakasareddy,

Which transaction code are you talking about in specific?

You can refer the thread-

http://scn.sap.com/thread/2088066

Also,

Lock is placed in the edit mode on the objects in Transactions like VL02/VL03/VT02/VT03 etc, which can we checked using SM12 or the lock objects with function ENQUEUE/DEQUEUE.

Depending on the lock probably you can export/import a Memory Variable which can be further used in your program.

But i doubt if there is any system variable giving out this information since the transaction codes itself for change and display are totally different in most of the cases (02-change and 03-display).

And if you check this change of mode happening by activating a debugger, you will notice that this change takes place through variables local to the program.

Regards,

Gayatri Gadre

0 Kudos

Hi Gayatri,

I am looking for the Tcodes OX02 , OX16, OB62, OB37 AND OBC5.

Regards,

Kasi.

0 Kudos

Hi,

Can you use this?

call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                              = 'U'
                show_selection_popup   = range_limits_input
                view_name                     = <viewname>
                variant_for_selection      = variant
                check_ddic_mainflag     = 'X'                "MF 081100
           tables
               dba_sellist                  = rangetab
                excl_cua_funct          = fu_to_excl
           exceptions
                foreign_lock               = 2
                no_tvdir_entry            = 8.

It automatically shows who has locked the particular view i.e the data is locked by which user...

Thanks

KH