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

Running Tranaction

Former Member
0 Likes
651

Hi Experts,

I have one query regarding running transaction.

Whenever I execute my program which is for G/L posting, I wanted to identify if FB01 is used in that time by some other user i.e. while I execute the program & at the same time some other user is creating G/L account using FB01.

In this case I wanted to stop my program's processing.

Please suggest.

Regards,

Neha

3 REPLIES 3
Read only

Former Member
0 Likes
586

you can use :

THDISPLAY_WORKPROCESS_LIST

or TH_DISPLAY_WORKPROCESS_LIST

to get the workprocess values .. export it to memory.. read the values..

Read only

0 Likes
586

neha, i have one more solution for you..


REPORT  zsomu_sdn_test.
SUBMIT RSM04000_ALV EXPORTING LIST TO MEMORY AND RETURN. " this is same as SM04
DATA  : gt TYPE STANDARD TABLE OF abaplist WITH HEADER LINE.
* retrieve the list
CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = gt
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.
IF sy-subrc = 0.

DATA: BEGIN OF tab2 OCCURS 0,
        w_text(255) TYPE c,
       END OF tab2.
* retrieve the text
    CALL FUNCTION 'LIST_TO_ASCI'
      TABLES
        listasci           = tab2
        listobject         = gt
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2.
    IF sy-subrc = 0.
 DATA : s1 type string.
*searching for FB01 users. 
     LOOP AT tab2 where w_text cp '*FB01*'.
        split tab2-w_text at '|' INTO s1 s1 tab2-w_text.
        CONDENSE s1.
        if s1 = sy-mandt.
          WRITE tab2. " here you can put some flag or do some operation to exit your code.
        endif.
      ENDLOOP.
    ENDIF.
ENDIF.

Read only

Former Member
0 Likes
586

d