jueves, 10 de diciembre de 2015

Ejecutar Transacciones Sin Autorización ( Programa )

En días pasados publicamos una entrada en donde indicamos la manera de ejecutar transacciones sobre las cuales no poseíamos autorización ( Ver artículo aquí ). El día de hoy traemos este pequeño programa que enmascara el llamado al módulo de función RS_HDSYS_CALL_TC_VARIANT  y permite ejecutar transaciones para las cuales no poseemos autorización, de una manera fácil.

Programa principal

*----------------------------------------------------------------------*
* General Information
*----------------------------------------------------------------------*
* Program     : YTUTOABAP_001
* Description : Execute TCODE Without Authorization
*----------------------------------------------------------------------*


*----------------------------------------------------------------------*
* Program Flow
*----------------------------------------------------------------------*
REPORT  YTUTOABAP_001.

*----------------------------------------------------------------------*
* Includes
*----------------------------------------------------------------------*
INCLUDE YTUTOABAP_001V.
INCLUDE YTUTOABAP_001F.


*----------------------------------------------------------------------*
* Event: START-OF-SELECTION
*----------------------------------------------------------------------*
START-OF-SELECTION.
  PERFORM start_of_selection.

Include de Variables

*&---------------------------------------------------------------------*
*&  Include           YTUTOABAP_001V
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blq1 WITH FRAME TITLE text-001.
PARAMETERS:
pa_tcode TYPE shdfv-tcode.
SELECTION-SCREEN END OF BLOCK blq1.

Include de Subrutinas

*&---------------------------------------------------------------------*
*&  Include           YTUTOABAP_001F
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Form  START_OF_SELECTION
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM start_of_selection .

  CALL FUNCTION 'RS_HDSYS_CALL_TC_VARIANT'
    EXPORTING
      tcode              = pa_tcode
      authority_check    = space
    EXCEPTIONS
      no_variant         = 1
      no_authority_tcode = 2
      OTHERS             = 3.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.



ENDFORM.                    " START_OF_SELECTION



No hay comentarios.:

Publicar un comentario