Search This Blog

Friday, January 22, 2021

To bypass T-code authorization in Quality and Production

To bypass T-code authorization  in SAP.

'RS_HDSYS_CALL_TC_VARIANT'              

Sample Program.

*&---------------------------------------------------------------------*
*& Report ZTCODE
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ztcode.

SELECTION-SCREENBEGIN OF BLOCK b1.
PARAMETERS tcode TYPE tstct-tcode.
SELECTION-SCREENEND OF BLOCK  b1.

DATAt_tstct TYPE TABLE OF tstct.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR  tcode.
  SELECT tcode  ttext  FROM tstct INTO TABLE t_tstct WHERE SPRSL 'EN'.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      ddic_structure  'TSTCT'
      retfield        'TCODE'
    TABLES
      value_tab       t_tstct
    EXCEPTIONS
      parameter_error 1
      no_values_found 2
      OTHERS          3.
  IF sy-subrc <> 0.
   MESSAGE 'NOT Found' TYPE 'E' .
  ENDIF.

START-OF-SELECTION.

  CALL FUNCTION 'RS_HDSYS_CALL_TC_VARIANT'
    EXPORTING
      tcode              tcode
*     VTCODE             =
*     VARIANT            =
*     I_FLAG_CLIENT_INDEPENDENT       =
*     CALL_MODE          = 'X'
*     AUTHORITY_CHECK    = ''
*     VARIANT_CHECK      = 'X'
*     NO_EXPORT          =
*     I_FLAG_SKIP_FIRST_SCREEN        =
*     RESET_AFTER_CALL_TC             =
    EXCEPTIONS
      no_variant         1
      no_authority_tcode 2
      OTHERS             3.
  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.

No comments:

Post a Comment

Pages