Problem solve Get help with specific problems with your technologies, process and projects.

Show your screen flow to another user

This tip gives you the opportunity to show your SAP screen flow on the screen of another user.

The code below gives you the opportunity to show your SAP screen flow on the screen of another user. It's very...

useful fir showing something to a user on another site. This code is an extraction of standard transactions SLON and SLOF.


REPORT ZGAN_SHOW MESSAGE-ID ZZ.

TABLES: V_USERNAME,
        SSCRFIELDS.

DATA: BEGIN OF USR_TABL OCCURS 10.
        INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.

DATA: OPCODE TYPE X,
      SLAVE_MODE TYPE X,
      LOC_UTID LIKE USR_TABL-TID.

CONSTANTS: C_FCODE_SLON LIKE SY-UCOMM VALUE 'SLON',
           C_FCODE_SLOF LIKE SY-UCOMM VALUE 'SLOF'.

SELECTION-SCREEN BEGIN OF BLOCK USERID WITH FRAME.
PARAMETERS: P_USERID LIKE UINFO-BNAME.
SELECTION-SCREEN END OF BLOCK USERID.
SELECTION-SCREEN BEGIN OF BLOCK SHOW WITH FRAME.
SELECTION-SCREEN PUSHBUTTON /10(25) SLON USER-COMMAND SLON.
SELECTION-SCREEN PUSHBUTTON  45(25) SLOF USER-COMMAND SLOF.
SELECTION-SCREEN END OF BLOCK SHOW.

INITIALIZATION.
  MOVE 'On Screen Flow Show' TO SLON.
  MOVE 'Off Screen Flow Show' TO SLOF.

AT SELECTION-SCREEN ON P_USERID.
  IF NOT P_USERID IS INITIAL.
    SELECT SINGLE BNAME
           INTO V_USERNAME-BNAME
           FROM V_USERNAME
           WHERE BNAME = P_USERID.
    IF SY-SUBRC <> 0.
      MESSAGE E999 WITH 'Invalid User Id'.
    ENDIF.
  ELSE.
    MESSAGE E999 WITH 'Specify the User Id'.
  ENDIF.

AT SELECTION-SCREEN.
  FREE USR_TABL.
  OPCODE = 2.
  CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE ID 'TAB' FIELD USR_TABL-*SYS*.

  READ TABLE USR_TABL WITH KEY BNAME = P_USERID TRANSPORTING TID.
  IF SY-SUBRC <> 0.
    MESSAGE E999 WITH 'Requested User Id is not available'.
  ENDIF.

  LOC_UTID = USR_TABL-TID.
  SLAVE_MODE = 5.

  IF SSCRFIELDS-UCOMM = C_FCODE_SLON.
    OPCODE = 14.
    CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE ID 'S_TID' FIELD LOC_UTID
       ID 'S_MODE' FIELD SLAVE_MODE.
ELSEIF SSCRFIELDS-UCOMM = C_FCODE_SLOF.
    OPCODE = 15.
    CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE ID 'S_TID' FIELD LOC_UTID.
ENDIF.

This was last published in February 2003

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close