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

TRANSACTION TABLE

Former Member
0 Likes
879

Hello,

Do you know if there is a table that stores the transaction´s name that are running at the time?

Thanks

Gabriel P.

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
859

To get a rough idea, you can see what users are currently running using the transaction code SM04.

Regards,

rich Heilman

Read only

0 Likes
859

or you can also use the TCode STAT to get the local Transaction statistics..

Regards,

Suresh Datti

Read only

0 Likes
859

SM04 uses a c function to get this data. Here is the logic. This may not be useful as it will not help when user has mulitple sessions.



report zrich_0001 .

data: begin of usr_tabl occurs 10.
        include structure uinfo.
data: end of usr_tabl.

data: th_opcode(1)                    type x.

constants: opcode_list                     like th_opcode value 2.

refresh usr_tabl.

call 'ThUsrInfo' id 'OPCODE' field opcode_list
  id 'TAB' field usr_tabl-*sys*.

sort usr_tabl by mandt bname.

loop at usr_tabl.

  write:/ usr_tabl-bname, usr_tabl-tcode.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
859

Hi Rich,

My requirement is to retrieve all transaction from multiple sessions. Please

tell how to retrieve this.

Thanks.

With Regards,

Gandhi Subramani

Read only

Former Member
0 Likes
859

Hi,

We have a table called TSTC, which stores all the transactions.

Regards,

Sek s

Read only

Former Member
0 Likes
859

Hello Rich,

I need to find what transactions are running, becuase I need to lock the tx in case is already running, I tryed with ENQUEUE AND DEQUEUE but it didn´t work. I need to lock tx MIRO.

Thanks,

Gabriel

Read only

0 Likes
859

Just wondering how you would lock a transaction if it is already running. The lock probably wouldn't take effect on the other session untill the user backs out and re-enters the transaction. You can lock transaction via SM01.

Regards,

Rich Heilman

Read only

0 Likes
859

Just tested it, if someone is already in the transaction, locking it will do no good untill they back out of the transaction and try to reenter.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
859

Hi Rich,

Thanks again for answering, the code you gave me worked, but you r rigth, if the user has several modes, it does´nt work right, I tryed to do it with TX you gave me, but I have no permission to access it, I guess a usual user either.

Do you know any other way to lock the acces to a transaction?

Thanks again,

Gabriel

Read only

0 Likes
859

Not a big fan of directly updating a database, as I don't someone in another post tonight not too, but in this case if you can't use the SM01, you can do the underlying code, essentially, this is what it is doing. Give it a try.



report zrich_0001 .


data: xtstc type tstc.

parameters: p_lock radiobutton group grp1,
            p_unlk radiobutton group grp1.

select single * from tstc into xtstc
               where tcode = 'MIRO'.
if p_lock = 'X'.
  xtstc-cinfo = '24'.    "Lock it
else.
  xtstc-cinfo = '04'.    "Unlock it
endif.
modify tstc from xtstc.

Regards,

Rich Heilman