*&---------------------------------------------------------------------*
*& Report ZRP_TABLES_IN_TCODE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZRP_TABLES_IN_TCODE.
TABLES: D010TAB, DD02L, TSTC, TSTCT, DD02T.
************************************************************************
* Types Defined *
************************************************************************
TYPES: BEGIN OF TY_DETAIL,
TCODE LIKE TSTCT-TCODE,
TTEXT LIKE TSTCT-TTEXT,
TABNAME LIKE D010TAB-TABNAME,
DDTEXT LIKE DD02T-DDTEXT,
END OF TY_DETAIL.
************************************************************************
* Declaration of Internal Tables & Variables *
************************************************************************
DATA: IT_DETAIL TYPE STANDARD TABLE OF TY_DETAIL WITH HEADER LINE,
WA_DETAIL LIKE LINE OF IT_DETAIL,
CURSOR_FIELD(30).
************************************************************************
* SELECTION SCREEN *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001 NO INTERVALS.
SELECT-OPTIONS: SOTCODE FOR TSTCT-TCODE NO INTERVALS MEMORY ID AAA,
SOTEXT FOR TSTCT-TTEXT NO INTERVALS,
SOTNAME FOR D010TAB-TABNAME NO INTERVALS,
SODDTEXT FOR DD02T-DDTEXT NO INTERVALS.
SELECTION-SCREEN END OF BLOCK A.
************************************************************************
* AT SELECTION-SCREEN *
************************************************************************
AT SELECTION-SCREEN.
IF SOTCODE[] IS INITIAL AND SOTEXT[] IS INITIAL AND SOTNAME[] IS INITIAL AND SODDTEXT[] IS INITIAL.
MESSAGE 'You must select minimum one option' TYPE 'E'.
ENDIF.
************************************************************************
* START-OF-SELECTION *
************************************************************************
START-OF-SELECTION.
SELECT TSTCT~TCODE TSTCT~TTEXT D010TAB~TABNAME DD02T~DDTEXT
INTO CORRESPONDING FIELDS OF TABLE IT_DETAIL
FROM TSTC INNER JOIN TSTCT ON ( TSTC~TCODE = TSTCT~TCODE )
INNER JOIN D010TAB ON ( TSTC~PGMNA = D010TAB~MASTER )
INNER JOIN DD02L ON ( D010TAB~TABNAME = DD02L~TABNAME )
INNER JOIN DD02T ON ( DD02L~TABNAME = DD02T~TABNAME )
WHERE TSTCT~SPRSL EQ 'E'
AND DD02L~AS4LOCAL EQ 'A'
AND DD02L~AS4VERS EQ '0000'
AND DD02L~TABCLASS EQ 'TRANSP'
AND DD02T~DDLANGUAGE EQ 'E'
AND TSTCT~TCODE IN SOTCODE
AND TSTCT~TTEXT IN SOTEXT
AND D010TAB~TABNAME IN SOTNAME
AND DD02T~DDTEXT IN SODDTEXT.
IF SY-SUBRC EQ 0.
SORT: IT_DETAIL BY TCODE TABNAME.
WRITE: 1(149) SY-ULINE,
/1(1) '|',
3(20) 'Transaction Code' CENTERED COLOR 1,
24(1) '|',
26(36) 'Transaction Text' CENTERED COLOR 1,
63(1) '|',
65(20) 'Table Name' CENTERED COLOR 1,
86(1) '|',
88(60) 'Table Description' CENTERED COLOR 1,
149(1) '|',
/1(149) SY-ULINE.
LOOP AT IT_DETAIL INTO WA_DETAIL.
WRITE: /1(1) '|',
3(20) WA_DETAIL-TCODE HOTSPOT ON,
24(1) '|',
26(36) WA_DETAIL-TTEXT HOTSPOT ON,
63(1) '|',
65(20) WA_DETAIL-TABNAME HOTSPOT ON,
86(1) '|',
88(60) WA_DETAIL-DDTEXT HOTSPOT ON,
149(1) '|'.
HIDE: WA_DETAIL.
ENDLOOP.
WRITE: /1(149) SY-ULINE.
ELSE.
MESSAGE: 'Sorry, DATA not found for Given Criteria' TYPE 'S'.
ENDIF.
AT LINE-SELECTION.
GET CURSOR FIELD CURSOR_FIELD.
CASE CURSOR_FIELD.
WHEN 'WA_DETAIL-TCODE' OR 'WA_DETAIL-TTEXT'.
PERFORM SHOW_TRANSACTION USING WA_DETAIL-TCODE.
WHEN 'WA_DETAIL-TABNAME' OR 'WA_DETAIL-DDTEXT'.
PERFORM SHOW_TABLE USING WA_DETAIL-TABNAME.
WHEN OTHERS.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form show_table
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->TABLE_NAME text
*----------------------------------------------------------------------*
FORM SHOW_TABLE USING TABLE_NAME.
CALL FUNCTION 'RS_DD_TABL_EDIT'
EXPORTING
OBJNAME = TABLE_NAME
EDIT_MODE = 'S'
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OBJECT_NOT_SPECIFIED = 2
PERMISSION_FAILURE = 3
NOT_EXECUTED = 4
OTHERS = 5.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "show_table
*&---------------------------------------------------------------------*
*& Form show_transaction
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->FIELD_VALUE text
*----------------------------------------------------------------------*
FORM SHOW_TRANSACTION USING TCODE_IN.
DATA: TCODE LIKE TSTC-TCODE.
TCODE = TCODE_IN.
CALL FUNCTION 'RS_TRANSACTION_SHOW'
EXPORTING
OBJECTNAME = TCODE
MONITOR_ACTIVATE = ' '
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "show_transaction
Wednesday, February 24, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment