2代增强查找程序 Z_FIND_ENHANGEMENT
作者:互联网
1,输入对应tcode或者程序名
2,对应code
*&---------------------------------------------------------------------* *& Report Z_FIND_ENHANGEMENT *&---------------------------------------------------------------------* REPORT ZFIND_ENHANCEMENT. *&--------------------------------------------------------------------&* *& Report: Z_USEREXIT (V9) &* *& PJA Consultancy Services (www.pjas.com) &* *&--------------------------------------------------------------------&* *& This report attmpts to find Enhancements, Program-Exits, BADIs &* *& and Business Transaction Events in a particular program/tcode. &* *& Last updated: 09 May 2007 &* *&--------------------------------------------------------------------&* *& Selection Texts: *& P_ALV ALV format *& P_AUTH Include authority-check search *& P_BADI Display BADIs *& P_BTE Display business trans events *& P_DEVC Show development class exits *& P_EXIT Display user exits *& P_FUNC Show function modules *& P_LIMIT Limit no. of submits to search *& P_LST Standard list format *& P_PNAME Program name *& P_PROG Display program exits *& P_SUBM Show submits *& P_TCODE Transaction code *& P_TEXT Search for text *& P_WFLOW Display workflow links *&--------------------------------------------------------------------&* *& Text symbols: *& M01 Enter TCode or program *& M02 Enter at least one scope criteria *& S01 Selection data (TCode takes precedence over program name) *& S02 Scope criteria *& S03 Display criteria *&--------------------------------------------------------------------&* *report z_userexit no standard page heading line-size 201 . TABLES: SXS_ATTR, TOBJT, TSTCT, "TCode texts TRDIRT, "Program texts SXC_EXIT. "BADI exits TYPE-POOLS: SLIS. "Globale Typen fьr generische Listbausteine DATA:TABIX LIKE SY-TABIX, W_LINNUM TYPE I , W_OFF TYPE I , W_INDEX LIKE SY-TABIX, W_INCLUDE LIKE TRDIR-NAME, W_PROG LIKE TRDIR-NAME, W_INCL LIKE TRDIR-NAME, W_AREA LIKE RS38L-AREA, W_LEVEL, W_STR(50) TYPE C , W_CNT(2) TYPE C , W_FUNCNAME LIKE TFDIR-FUNCNAME, W_FSEL LIKE SY-UCOMM, " Determination of screen field W_GRIDTXT(70) TYPE C . "ALV grid title CONSTANTS: C_FMOD(40) TYPE C VALUE 'Function modules searched: ' , C_SUBM(40) TYPE C VALUE 'Submit programs searched: ' , C_DEVC(60) TYPE C VALUE 'User-exits from development classes in function modules' , C_COL1(12) TYPE C VALUE 'Enhanmt Type' , C_COL2(40) TYPE C VALUE 'Enhancement' , C_COL3(30) TYPE C VALUE 'Program/Include' , C_COL4(20) TYPE C VALUE 'Enhancement Name' , C_COL5(40) TYPE C VALUE 'Enhancement Description' , C_COL6(8) TYPE C VALUE 'Project' , C_COL7(1) TYPE C VALUE 'S' , C_COL8(12) TYPE C VALUE 'ChangeName' , C_COL9(10) TYPE C VALUE 'ChangeDate' , C_X TYPE C VALUE 'X' . * Work Areas: ABAP Workbench DATA : BEGIN OF WA_D010INC. DATA : MASTER TYPE D010INC-MASTER. DATA : END OF WA_D010INC. DATA : BEGIN OF WA_TFDIR. DATA : FUNCNAME TYPE TFDIR-FUNCNAME, PNAME TYPE TFDIR-PNAME, INCLUDE TYPE TFDIR-INCLUDE . DATA : END OF WA_TFDIR. DATA : BEGIN OF WA_TADIR. DATA : DEVCLASS TYPE TADIR-DEVCLASS. DATA : END OF WA_TADIR. DATA : BEGIN OF WA_TSTC. DATA : PGMNA TYPE TSTC-PGMNA. DATA : END OF WA_TSTC. DATA : BEGIN OF WA_TSTCP. DATA : PARAM TYPE TSTCP-PARAM. DATA : END OF WA_TSTCP. DATA : BEGIN OF WA_ENLFDIR. DATA : AREA TYPE ENLFDIR-AREA. DATA : END OF WA_ENLFDIR. * Work Areas: BADIs DATA : BEGIN OF WA_SXS_ATTR. DATA : EXIT_NAME TYPE SXS_ATTR-EXIT_NAME. DATA : END OF WA_SXS_ATTR. DATA : BEGIN OF WA_SXS_ATTRT. DATA : TEXT TYPE SXS_ATTRT-TEXT . DATA : END OF WA_SXS_ATTRT. * Work Areas: Enhancements DATA : BEGIN OF WA_MODSAP. DATA : MEMBER TYPE MODSAP-MEMBER. DATA : END OF WA_MODSAP. DATA : BEGIN OF WA_MODSAPA. DATA : NAME TYPE MODSAPA-NAME. DATA : END OF WA_MODSAPA. DATA : BEGIN OF WA_MODSAPT. DATA : MODTEXT TYPE MODSAPT-MODTEXT. DATA : END OF WA_MODSAPT. * Work Areas: Business Transaction Events DATA : BEGIN OF WA_TBE01T. DATA : TEXT1 TYPE TBE01T-TEXT1. DATA : END OF WA_TBE01T. DATA : BEGIN OF WA_TPS01T. DATA : TEXT1 TYPE TPS01T-TEXT1. DATA : END OF WA_TPS01T. * user-exits TYPES : BEGIN OF TY_MOD, MEMBER LIKE MODACT-MEMBER, NAME LIKE MODACT-NAME, STATUS LIKE MODATTR-STATUS, ANAM LIKE MODATTR-ANAM, ADAT LIKE MODATTR-ADAT, END OF TY_MOD. DATA : W_MOD TYPE TY_MOD. TYPES : BEGIN OF T_USEREXIT, TYPE(12) TYPE C, PNAME LIKE TRDIR-NAME, TXT(300), LEVEL TYPE C , MODNAME(30) TYPE C , MODTEXT(60) TYPE C , MODATTR TYPE TY_MOD, COLOUR(4) TYPE C , END OF T_USEREXIT. DATA : I_USEREXIT TYPE STANDARD TABLE OF T_USEREXIT WITH HEADER LINE . * Function module developmnet classes TYPES : BEGIN OF T_DEVCLASS, CLAS LIKE TRDIR-CLAS, END OF T_DEVCLASS. DATA : I_DEVCLASS TYPE STANDARD TABLE OF T_DEVCLASS WITH HEADER LINE . * Submit programs TYPES : BEGIN OF T_SUBMIT, PNAME LIKE TRDIR-NAME, LEVEL, DONE, END OF T_SUBMIT. DATA : I_SUBMIT TYPE STANDARD TABLE OF T_SUBMIT WITH HEADER LINE . * Source code TYPES : BEGIN OF T_SOURCETAB, "#EC * (SLIN lьgt!) LINE(200), "#EC * (SLIN lьgt!) END OF T_SOURCETAB. "#EC * (SLIN lьgt!) DATA : SOURCETAB TYPE STANDARD TABLE OF T_SOURCETAB WITH HEADER LINE . DATA C_OVERFLOW(30000) TYPE C . * Description of an ABAP/4 source analysis token *data: i_stoken type standard table of stokex with header line. DATA : I_STOKEN TYPE STANDARD TABLE OF STOKEN WITH HEADER LINE . DATA WA_STOKEN LIKE I_STOKEN. * Description of an ABAP/4 source analysis statement DATA : I_SSTMNT TYPE STANDARD TABLE OF SSTMNT WITH HEADER LINE . "#EC NEEDED * keywords for searching ABAP code TYPES : BEGIN OF T_KEYWORDS, WORD(30), END OF T_KEYWORDS. DATA : KEYWORDS TYPE STANDARD TABLE OF T_KEYWORDS WITH HEADER LINE . * function modules within program TYPES : BEGIN OF T_FMODULE, NAME LIKE RS38L-NAME, PNAME LIKE TRDIR-NAME, PNAME2 LIKE TRDIR-NAME, LEVEL, BAPI, DONE, END OF T_FMODULE. DATA : I_FMODULE TYPE STANDARD TABLE OF T_FMODULE WITH HEADER LINE . * ALV definitions DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE . DATA I_LAYOUT TYPE SLIS_LAYOUT_ALV. DATA I_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE . *&--------------------------------------------------------------------&* *& Selection Options &* *&--------------------------------------------------------------------&* SELECTION-SCREEN BEGIN OF BLOCK SELSCR1 WITH FRAME TITLE TEXT-S01. PARAMETER : P_PNAME LIKE TRDIR-NAME, P_TCODE LIKE SYST-TCODE, P_LIMIT(4) TYPE N DEFAULT 500 . SELECTION-SCREEN SKIP . SELECTION-SCREEN END OF BLOCK SELSCR1. SELECTION-SCREEN BEGIN OF BLOCK SELSCR2 WITH FRAME TITLE TEXT-S02. PARAMETER : P_BADI AS CHECKBOX DEFAULT C_X, P_BTE AS CHECKBOX DEFAULT C_X, P_EXIT AS CHECKBOX DEFAULT C_X, P_PROG AS CHECKBOX DEFAULT C_X, P_WFLOW AS CHECKBOX , P_AUTH AS CHECKBOX . SELECTION-SCREEN SKIP . PARAMETER : P_TEXT(40) TYPE C . SELECTION-SCREEN END OF BLOCK SELSCR2. SELECTION-SCREEN BEGIN OF BLOCK SELSCR3 WITH FRAME TITLE TEXT-S03. PARAMETER : P_ALV RADIOBUTTON GROUP RAD1 DEFAULT 'X' , P_LST RADIOBUTTON GROUP RAD1. SELECTION-SCREEN SKIP . PARAMETER : P_DEVC LIKE RIHEA-DY_OFN DEFAULT ' ' MODIF ID A01, P_FUNC LIKE RIHEA-DY_OFN DEFAULT ' ' MODIF ID A01, P_SUBM LIKE RIHEA-DY_OFN DEFAULT ' ' MODIF ID A01. SELECTION-SCREEN END OF BLOCK SELSCR3. *&--------------------------------------------------------------------&* *& START-OF-SELECTION &* *&--------------------------------------------------------------------&* START-OF-SELECTION. IF P_PNAME IS INITIAL AND P_TCODE IS INITIAL . MESSAGE I000(G01) WITH TEXT-M01. STOP . ENDIF . IF P_BADI IS INITIAL AND P_EXIT IS INITIAL AND P_BTE IS INITIAL AND P_WFLOW IS INITIAL AND P_AUTH IS INITIAL AND P_PROG IS INITIAL . MESSAGE I000(G01) WITH TEXT-M02. STOP . ENDIF . * ensure P_LIMIT is not zero. IF P_LIMIT = 0 . P_LIMIT = 1 . ENDIF . PERFORM DATA_SELECT. PERFORM GET_SUBMIT_DATA. PERFORM GET_FM_DATA. PERFORM GET_ADDITIONAL_DATA. PERFORM DATA_DISPLAY. *&--------------------------------------------------------------------&* *& Form DATA_SELECT &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM DATA_SELECT. * data selection message to sap gui CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' DESTINATION 'SAPGUI' KEEPING LOGICAL UNIT OF WORK EXPORTING TEXT = 'Get programs/includes' "#EC NOTEXT EXCEPTIONS SYSTEM_FAILURE COMMUNICATION_FAILURE . "#EC * * get TCode name for ALV grid title CLEAR W_GRIDTXT. IF NOT P_TCODE IS INITIAL . SELECT SINGLE * FROM TSTCT WHERE TCODE = P_TCODE AND SPRSL = SY-LANGU. CONCATENATE 'TCode:' P_TCODE TSTCT-TTEXT INTO W_GRIDTXT SEPARATED BY SPACE. ENDIF . * get program name for ALV grid title IF NOT P_PNAME IS INITIAL . SELECT SINGLE * FROM TRDIRT WHERE NAME = P_PNAME AND SPRSL = SY-LANGU. CONCATENATE 'Program:' P_PNAME TSTCT-TTEXT INTO W_GRIDTXT SEPARATED BY SPACE. ENDIF . * determine search words KEYWORDS-WORD = 'CALL' . APPEND KEYWORDS. KEYWORDS-WORD = 'FORM' . APPEND KEYWORDS. KEYWORDS-WORD = 'PERFORM' . APPEND KEYWORDS. KEYWORDS-WORD = 'SUBMIT' . APPEND KEYWORDS. KEYWORDS-WORD = 'INCLUDE' . APPEND KEYWORDS. KEYWORDS-WORD = 'AUTHORITY-CHECK' . APPEND KEYWORDS. IF NOT P_TCODE IS INITIAL . * get program name from TCode SELECT SINGLE PGMNA FROM TSTC INTO WA_TSTC-PGMNA WHERE TCODE EQ P_TCODE. IF NOT WA_TSTC-PGMNA IS INITIAL . P_PNAME = WA_TSTC-PGMNA. * TCode does not include program name, but does have reference TCode ELSE . SELECT SINGLE PARAM FROM TSTCP INTO WA_TSTCP-PARAM WHERE TCODE EQ P_TCODE. IF SY-SUBRC = 0 . CHECK WA_TSTCP-PARAM(1) = '/' . CHECK WA_TSTCP-PARAM+1(1) = '*' . IF WA_TSTCP-PARAM CA ' ' . ENDIF . W_OFF = SY-FDPOS + 1 . SUBTRACT 2 FROM SY-FDPOS. IF SY-FDPOS GT 0 . P_TCODE = WA_TSTCP-PARAM+2(SY-FDPOS). ENDIF . SELECT SINGLE PGMNA FROM TSTC INTO WA_TSTC-PGMNA WHERE TCODE EQ P_TCODE. P_PNAME = WA_TSTC-PGMNA. IF SY-SUBRC <> 0 . MESSAGE S110(/SAPTRX/ASC) WITH 'No program found for: ' P_TCODE. "#EC NOTEXT STOP . ENDIF . ELSE . MESSAGE S110(/SAPTRX/ASC) WITH 'No program found for: ' P_TCODE. "#EC NOTEXT STOP . ENDIF . ENDIF . ENDIF . * Call customer-function aus Program coding READ REPORT P_PNAME INTO SOURCETAB. IF SY-SUBRC > 0 . MESSAGE E017(ENHANCEMENT) WITH P_PNAME RAISING NO_PROGRAM. "#EC * ENDIF . *scan abap-source sourcetab tokens into i_stoken *statements into i_sstmnt *keywords from keywords *overflow into c_overflow *with ANALYSIS. "#EC ********************************** SCAN ABAP-SOURCE SOURCETAB TOKENS INTO I_STOKEN STATEMENTS INTO I_SSTMNT KEYWORDS FROM KEYWORDS OVERFLOW INTO C_OVERFLOW WITH INCLUDES. "#EC ********************************** IF SY-SUBRC > 0 . "keine/syntakt. falsche Ablauflog./Fehler im Skanner MESSAGE E130(ENHANCEMENT) RAISING SYNTAX_ERROR. "#EC ENDIF . * check I_STOKEN for entries CLEAR W_LINNUM. DESCRIBE TABLE I_STOKEN LINES W_LINNUM. IF W_LINNUM GT 0 . W_LEVEL = '0' . W_PROG = '' . W_INCL = '' . PERFORM DATA_SEARCH TABLES I_STOKEN USING W_LEVEL W_PROG W_INCL. ENDIF . ENDFORM . "DATA_SELECT *&--------------------------------------------------------------------&* *& Form GET_FM_DATA # &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM GET_FM_DATA. * data selection message to sap gui CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' DESTINATION 'SAPGUI' KEEPING LOGICAL UNIT OF WORK EXPORTING TEXT = 'Get function module data' "#EC NOTEXT EXCEPTIONS SYSTEM_FAILURE COMMUNICATION_FAILURE . "#EC * * Function module data SORT I_FMODULE BY NAME. DELETE ADJACENT DUPLICATES FROM I_FMODULE COMPARING NAME. LOOP AT I_FMODULE WHERE DONE NE C_X. CLEAR : I_STOKEN, I_SSTMNT, SOURCETAB, WA_TFDIR, W_INCLUDE . REFRESH : I_STOKEN, I_SSTMNT, SOURCETAB. CLEAR WA_TFDIR. SELECT SINGLE FUNCNAME PNAME INCLUDE FROM TFDIR INTO WA_TFDIR WHERE FUNCNAME = I_FMODULE-NAME. CHECK SY-SUBRC = 0 . CALL FUNCTION 'FUNCTION_INCLUDE_SPLIT' EXPORTING PROGRAM = WA_TFDIR-PNAME IMPORTING GROUP = W_AREA. CONCATENATE 'L' W_AREA 'U' WA_TFDIR-INCLUDE INTO W_INCLUDE. I_FMODULE-PNAME = W_INCLUDE. I_FMODULE-PNAME2 = WA_TFDIR-PNAME. MODIFY I_FMODULE. READ REPORT I_FMODULE-PNAME INTO SOURCETAB. IF SY-SUBRC = 0 . SCAN ABAP-SOURCE SOURCETAB TOKENS INTO I_STOKEN STATEMENTS INTO I_SSTMNT KEYWORDS FROM KEYWORDS WITH INCLUDES. IF SY-SUBRC > 0 . MESSAGE E130(ENHANCEMENT) RAISING SYNTAX_ERROR. ENDIF . * check i_stoken for entries CLEAR W_LINNUM. DESCRIBE TABLE I_STOKEN LINES W_LINNUM. IF W_LINNUM GT 0 . W_LEVEL = '1' . W_PROG = I_FMODULE-PNAME2. W_INCL = I_FMODULE-PNAME. PERFORM DATA_SEARCH TABLES I_STOKEN USING W_LEVEL W_PROG W_INCL. ENDIF . ENDIF . ENDLOOP . * store development classes IF P_DEVC = C_X. LOOP AT I_FMODULE. CLEAR : WA_TADIR, WA_ENLFDIR. SELECT SINGLE AREA FROM ENLFDIR INTO WA_ENLFDIR-AREA WHERE FUNCNAME = I_FMODULE-NAME. CHECK NOT WA_ENLFDIR-AREA IS INITIAL . SELECT SINGLE DEVCLASS INTO WA_TADIR-DEVCLASS FROM TADIR WHERE PGMID = 'R3TR' AND OBJECT = 'FUGR' AND OBJ_NAME = WA_ENLFDIR-AREA. CHECK NOT WA_TADIR-DEVCLASS IS INITIAL . MOVE WA_TADIR-DEVCLASS TO I_DEVCLASS-CLAS. APPEND I_DEVCLASS. I_FMODULE-DONE = C_X. MODIFY I_FMODULE. ENDLOOP . SORT I_DEVCLASS. DELETE ADJACENT DUPLICATES FROM I_DEVCLASS. ENDIF . ENDFORM . "GET_FM_DATA *&--------------------------------------------------------------------&* *& Form GET_SUBMIT_DATA &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM GET_SUBMIT_DATA. * data selection message to sap gui CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' DESTINATION 'SAPGUI' KEEPING LOGICAL UNIT OF WORK EXPORTING TEXT = 'Get submit data' "#EC NOTEXT EXCEPTIONS SYSTEM_FAILURE COMMUNICATION_FAILURE . "#EC * SORT I_SUBMIT. DELETE ADJACENT DUPLICATES FROM I_SUBMIT COMPARING PNAME. W_LEVEL = '0' . LOOP AT I_SUBMIT WHERE DONE NE C_X. CLEAR : I_STOKEN, I_SSTMNT, SOURCETAB. REFRESH : I_STOKEN, I_SSTMNT, SOURCETAB. READ REPORT I_SUBMIT-PNAME INTO SOURCETAB. IF SY-SUBRC = 0 . SCAN ABAP-SOURCE SOURCETAB TOKENS INTO I_STOKEN STATEMENTS INTO I_SSTMNT KEYWORDS FROM KEYWORDS WITH INCLUDES. IF SY-SUBRC > 0 . * message e130(enhancement) raising syntax_error. CONTINUE . ENDIF . * check i_stoken for entries CLEAR W_LINNUM. DESCRIBE TABLE I_STOKEN LINES W_LINNUM. IF W_LINNUM GT 0 . W_PROG = I_SUBMIT-PNAME. W_INCL = '' . PERFORM DATA_SEARCH TABLES I_STOKEN USING W_LEVEL W_PROG W_INCL. ENDIF . ENDIF . * restrict number of submit program selected for processing DESCRIBE TABLE I_SUBMIT LINES W_LINNUM. IF W_LINNUM GE P_LIMIT. W_LEVEL = '1' . ENDIF . I_SUBMIT-DONE = C_X. MODIFY I_SUBMIT. ENDLOOP . ENDFORM . "GET_SUBMIT_DATA *&--------------------------------------------------------------------&* *& Form DATA_SEARCH &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM DATA_SEARCH TABLES P_STOKEN STRUCTURE STOKEN USING P_LEVEL L_PROG L_INCL. LOOP AT P_STOKEN. CLEAR I_USEREXIT. * Workflow IF P_WFLOW = C_X. IF P_LEVEL EQ '1' . " do not perform for function modules (2nd pass) IF P_STOKEN-STR+1(16) CS 'SWE_EVENT_CREATE' . REPLACE ALL OCCURRENCES OF '''' IN P_STOKEN-STR WITH '' . I_USEREXIT-TYPE = 'WorkFlow' . I_USEREXIT-TXT = P_STOKEN-STR. CONCATENATE L_PROG '/' L_INCL INTO I_USEREXIT-PNAME. APPEND I_USEREXIT. ENDIF . ENDIF . ENDIF . TABIX = SY-TABIX + 1 . I_USEREXIT-LEVEL = P_LEVEL. IF I_USEREXIT-LEVEL = '0' . IF L_INCL IS INITIAL . I_USEREXIT-PNAME = P_PNAME. ELSE . CONCATENATE P_PNAME '-' L_INCL INTO I_USEREXIT-PNAME. ENDIF . ELSE . IF L_INCL IS INITIAL . I_USEREXIT-PNAME = L_PROG. ELSE . CONCATENATE L_PROG '-' L_INCL INTO I_USEREXIT-PNAME. ENDIF . ENDIF . * AUTHORITY-CHECKS IF P_AUTH = C_X. IF P_STOKEN-STR EQ 'AUTHORITY-CHECK' . CHECK P_LEVEL EQ '0' . " do not perform for function modules (2nd pass) W_INDEX = SY-TABIX + 2 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. CHECK NOT WA_STOKEN-STR CS 'STRUCTURE' . CHECK NOT WA_STOKEN-STR CS 'SYMBOL' . READ TABLE I_SUBMIT WITH KEY PNAME = WA_STOKEN-STR. IF SY-SUBRC <> 0 . I_USEREXIT-PNAME = I_SUBMIT-PNAME. I_USEREXIT-TYPE = 'AuthCheck' . I_USEREXIT-TXT = WA_STOKEN-STR. REPLACE ALL OCCURRENCES OF '''' IN I_USEREXIT-TXT WITH SPACE. CLEAR TOBJT. SELECT SINGLE * FROM TOBJT WHERE OBJECT = I_USEREXIT-TXT AND LANGU = SY-LANGU. I_USEREXIT-MODNAME = 'AUTHORITY-CHECK' . I_USEREXIT-MODTEXT = TOBJT-TTEXT. APPEND I_USEREXIT. ENDIF . ENDIF . ENDIF . * Text searches IF NOT P_TEXT IS INITIAL . IF P_STOKEN-STR CS P_TEXT. I_USEREXIT-PNAME = I_SUBMIT-PNAME. I_USEREXIT-TYPE = 'TextSearch' . I_USEREXIT-TXT = WA_STOKEN-STR. I_USEREXIT-MODNAME = 'Text Search' . I_USEREXIT-MODTEXT = P_STOKEN-STR. APPEND I_USEREXIT. ENDIF . ENDIF . * Include (SE38) IF P_STOKEN-STR EQ 'INCLUDE' . CHECK P_LEVEL EQ '0' . " do not perform for function modules (2nd pass) W_INDEX = SY-TABIX + 1 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. CHECK NOT WA_STOKEN-STR CS 'STRUCTURE' . CHECK NOT WA_STOKEN-STR CS 'SYMBOL' . READ TABLE I_SUBMIT WITH KEY PNAME = WA_STOKEN-STR. IF SY-SUBRC <> 0 . I_SUBMIT-PNAME = WA_STOKEN-STR. I_SUBMIT-LEVEL = P_LEVEL. APPEND I_SUBMIT. ENDIF . ENDIF . * Enhancements (SMOD) IF P_EXIT = C_X. IF P_STOKEN-STR EQ 'CUSTOMER-FUNCTION' . CLEAR W_FUNCNAME. READ TABLE P_STOKEN INDEX TABIX. TRANSLATE P_STOKEN-STR USING ''' ' . CONDENSE P_STOKEN-STR. IF L_PROG IS INITIAL . CONCATENATE 'EXIT' P_PNAME P_STOKEN-STR INTO W_FUNCNAME SEPARATED BY '_' . ELSE . CONCATENATE 'EXIT' L_PROG P_STOKEN-STR INTO W_FUNCNAME SEPARATED BY '_' . ENDIF . SELECT SINGLE MEMBER FROM MODSAP INTO WA_MODSAP-MEMBER WHERE MEMBER = W_FUNCNAME. IF SY-SUBRC = 0 . " check for valid enhancement I_USEREXIT-TYPE = 'Enhancement' . I_USEREXIT-TXT = W_FUNCNAME. APPEND I_USEREXIT. ELSE . CLEAR WA_D010INC. SELECT SINGLE MASTER INTO WA_D010INC-MASTER FROM D010INC WHERE INCLUDE = L_PROG. CONCATENATE 'EXIT' WA_D010INC-MASTER P_STOKEN-STR INTO W_FUNCNAME SEPARATED BY '_' . I_USEREXIT-TYPE = 'Enhancement' . I_USEREXIT-TXT = W_FUNCNAME. ENDIF . ENDIF . ENDIF . * BADIs (SE18) IF P_BADI = C_X. IF P_STOKEN-STR CS 'cl_exithandler=' . W_INDEX = SY-TABIX + 4 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. I_USEREXIT-TXT = WA_STOKEN-STR. REPLACE ALL OCCURRENCES OF '''' IN I_USEREXIT-TXT WITH SPACE. I_USEREXIT-TYPE = 'BADI' . CLEAR SXS_ATTR. " ensure a real BADI SELECT SINGLE * FROM SXS_ATTR WHERE EXIT_NAME = I_USEREXIT-TXT. IF SY-SUBRC = 0 . APPEND I_USEREXIT. ENDIF . ENDIF . ENDIF . * Business transaction events (FIBF) IF P_BTE = C_X. IF P_STOKEN-STR CS 'OPEN_FI_PERFORM' . I_USEREXIT-TYPE = 'BusTrEvent' . I_USEREXIT-TXT = P_STOKEN-STR. REPLACE ALL OCCURRENCES OF '''' IN I_USEREXIT-TXT WITH SPACE. I_USEREXIT-MODNAME = I_USEREXIT-TXT+16(8). CASE I_USEREXIT-TXT+25(1). WHEN 'E' . CLEAR WA_TBE01T. SELECT SINGLE TEXT1 INTO WA_TBE01T-TEXT1 FROM TBE01T WHERE EVENT = I_USEREXIT-TXT+16(8) AND SPRAS = SY-LANGU. IF WA_TBE01T-TEXT1 IS INITIAL . I_USEREXIT-MODTEXT = '<Not active>' . "#EC NOTEXT ELSE . I_USEREXIT-MODTEXT = WA_TBE01T-TEXT1. ENDIF . I_USEREXIT-MODNAME+8 = '/P&S' . "#EC NOTEXT WHEN 'P' . CLEAR WA_TPS01T. SELECT SINGLE TEXT1 INTO WA_TPS01T-TEXT1 FROM TPS01T WHERE PROCS = I_USEREXIT-TXT+16(8) AND SPRAS = SY-LANGU. I_USEREXIT-MODTEXT = WA_TPS01T-TEXT1. I_USEREXIT-MODNAME+8 = '/Process' . ENDCASE . APPEND I_USEREXIT. ENDIF . ENDIF . * Program exits (SE38) IF P_PROG = C_X. IF P_STOKEN-STR CS 'USEREXIT_' . CHECK NOT P_STOKEN-STR CS '-' . " ensure not USEREXIT_XX-XXX CHECK NOT P_STOKEN-STR CS '(' . " ensure not SUBMIT_XX(X) I_USEREXIT-TYPE = 'Program Exit' . I_USEREXIT-TXT = P_STOKEN-STR. REPLACE ALL OCCURRENCES OF '''' IN I_USEREXIT-TXT WITH SPACE. APPEND I_USEREXIT. ENDIF . ENDIF . * Submit programs (SE38) IF P_STOKEN-STR CS 'SUBMIT' . CHECK P_LEVEL EQ '0' . " do not perform for function modules (2nd pass) CHECK NOT P_STOKEN-STR CS '_' . " ensure not SUBMIT_XXX W_INDEX = SY-TABIX + 1 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. CHECK NOT WA_STOKEN-STR CS '_' . " ensure not SUBMIT_XXX REPLACE ALL OCCURRENCES OF '''' IN WA_STOKEN-STR WITH SPACE. READ TABLE I_SUBMIT WITH KEY PNAME = WA_STOKEN-STR. IF SY-SUBRC <> 0 . I_SUBMIT-PNAME = WA_STOKEN-STR. I_SUBMIT-LEVEL = P_LEVEL. APPEND I_SUBMIT. ENDIF . ENDIF . * Perform routines (which reference external programs) IF P_STOKEN-STR CS 'PERFORM' . CHECK P_LEVEL EQ '0' . " do not perform for function modules (2nd pass) W_INDEX = SY-TABIX + 1 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. IF NOT WA_STOKEN-OVFL IS INITIAL . W_OFF = WA_STOKEN-OFF1 + 10 . W_STR = C_OVERFLOW+W_OFF(30). FIND ')' IN W_STR MATCH OFFSET W_OFF. IF SY-SUBRC = 0 . W_OFF = W_OFF + 1 . WA_STOKEN-STR = W_STR(W_OFF). ENDIF . ENDIF . CHECK WA_STOKEN-STR CS '(' . W_OFF = 0 . WHILE SY-SUBRC = 0 . IF WA_STOKEN-STR+W_OFF(1) EQ '(' . REPLACE SECTION OFFSET W_OFF LENGTH 1 OF WA_STOKEN-STR WITH '' . REPLACE ALL OCCURRENCES OF ')' IN WA_STOKEN-STR WITH SPACE. READ TABLE I_SUBMIT WITH KEY PNAME = WA_STOKEN-STR. IF SY-SUBRC <> 0 . I_SUBMIT-PNAME = WA_STOKEN-STR. APPEND I_SUBMIT. ENDIF . EXIT . ELSE . REPLACE SECTION OFFSET W_OFF LENGTH 1 OF WA_STOKEN-STR WITH '' . SHIFT WA_STOKEN-STR LEFT DELETING LEADING SPACE. ENDIF . ENDWHILE . ENDIF . * Function modules (SE37) IF P_STOKEN-STR CS 'FUNCTION' . CLEAR I_FMODULE. IF P_LEVEL EQ '0' . " do not perform for function modules (2nd pass) W_INDEX = SY-TABIX + 1 . READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN. IF WA_STOKEN-STR CS 'BAPI' . I_FMODULE-BAPI = C_X. ENDIF . REPLACE FIRST OCCURRENCE OF '''' IN WA_STOKEN-STR WITH SPACE. REPLACE FIRST OCCURRENCE OF '''' IN WA_STOKEN-STR WITH SPACE. IF SY-SUBRC = 4 . " didn't find 2nd quote (ie name truncated) CLEAR WA_TFDIR. CONCATENATE WA_STOKEN-STR '%' INTO WA_STOKEN-STR. SELECT SINGLE FUNCNAME INTO WA_TFDIR-FUNCNAME FROM TFDIR WHERE FUNCNAME LIKE WA_STOKEN-STR. IF SY-SUBRC = 0 . I_FMODULE-NAME = WA_TFDIR-FUNCNAME. ELSE . CONTINUE . ENDIF . ELSE . I_FMODULE-NAME = WA_STOKEN-STR. ENDIF . I_FMODULE-LEVEL = P_LEVEL. APPEND I_FMODULE. ENDIF . ENDIF . ENDLOOP . ENDFORM . "DATA_SEARCH *&--------------------------------------------------------------------&* *& Form GET_ADDITIONAL_DATA &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM GET_ADDITIONAL_DATA. * data selection message to sap gui CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' DESTINATION 'SAPGUI' KEEPING LOGICAL UNIT OF WORK EXPORTING TEXT = 'Get additional data' "#EC NOTEXT EXCEPTIONS SYSTEM_FAILURE COMMUNICATION_FAILURE . "#EC * LOOP AT I_USEREXIT. * Workflow IF I_USEREXIT-TYPE EQ 'WorkFlow' . CONTINUE . ENDIF . * Enhancement data IF I_USEREXIT-TYPE CS 'Enh' . CLEAR : WA_MODSAPA. SELECT SINGLE NAME INTO WA_MODSAPA-NAME FROM MODSAP WHERE MEMBER = I_USEREXIT-TXT. CHECK SY-SUBRC = 0 . I_USEREXIT-MODNAME = WA_MODSAPA-NAME. CLEAR WA_MODSAPT. SELECT SINGLE MODTEXT INTO WA_MODSAPT-MODTEXT FROM MODSAPT WHERE NAME = WA_MODSAPA-NAME AND SPRSL = SY-LANGU. I_USEREXIT-MODTEXT = WA_MODSAPT-MODTEXT. * Get the CMOD project name CLEAR W_MOD. SELECT SINGLE MODACT~MEMBER MODACT~NAME MODATTR~STATUS MODATTR~ANAM MODATTR~ADAT INTO W_MOD FROM MODACT INNER JOIN MODATTR ON MODATTR~NAME = MODACT~NAME WHERE MODACT~MEMBER = WA_MODSAPA-NAME AND MODACT~TYP = SPACE. IF SY-SUBRC = 0 . I_USEREXIT-MODATTR = W_MOD. ENDIF . ENDIF . * BADI data IF I_USEREXIT-TYPE EQ 'BADI' . CLEAR WA_SXS_ATTR. SELECT SINGLE EXIT_NAME INTO WA_SXS_ATTR-EXIT_NAME FROM SXS_ATTR WHERE EXIT_NAME = I_USEREXIT-TXT. IF SY-SUBRC = 0 . I_USEREXIT-MODNAME = I_USEREXIT-TXT. ELSE . I_USEREXIT-MODNAME = 'Dynamic call' . "#EC NOTEXT ENDIF . CLEAR WA_SXS_ATTRT. SELECT SINGLE TEXT INTO WA_SXS_ATTRT-TEXT FROM SXS_ATTRT WHERE EXIT_NAME = WA_SXS_ATTR-EXIT_NAME AND SPRSL = SY-LANGU. I_USEREXIT-MODTEXT = WA_SXS_ATTRT-TEXT . ENDIF . * BADI Implementation IF I_USEREXIT-TYPE EQ 'BADI' . CLEAR SXC_EXIT. SELECT COUNT( * ) FROM SXC_EXIT WHERE EXIT_NAME = I_USEREXIT-TXT. W_CNT = SY-DBCNT. * determine id BADI is for interal or external use CLEAR SXS_ATTR. SELECT SINGLE * FROM SXS_ATTR WHERE EXIT_NAME = I_USEREXIT-TXT. IF SXS_ATTR-INTERNAL = 'X' . WA_SXS_ATTRT-TEXT = 'SAP ' . ELSE . WA_SXS_ATTRT-TEXT = 'CUST' . ENDIF . * concatenate wa_sxs_attrt-text w_cnt into i_userexit-modattr-name * separated by space. WRITE WA_SXS_ATTRT-TEXT TO I_USEREXIT-MODATTR-NAME. WRITE W_CNT TO I_USEREXIT-MODATTR-NAME+5 . ENDIF . MODIFY I_USEREXIT. ENDLOOP . * get enhancements via program package CLEAR WA_TADIR. SELECT SINGLE DEVCLASS INTO WA_TADIR-DEVCLASS FROM TADIR WHERE PGMID = 'R3TR' AND OBJECT = 'PROG' AND OBJ_NAME = P_PNAME. IF SY-SUBRC = 0 . CLEAR : WA_MODSAPA, WA_MODSAPT. SELECT NAME FROM MODSAPA INTO WA_MODSAPA-NAME WHERE DEVCLASS = WA_TADIR-DEVCLASS. SELECT SINGLE MODTEXT FROM MODSAPT INTO WA_MODSAPT-MODTEXT WHERE NAME = WA_MODSAPA-NAME AND SPRSL = SY-LANGU. CLEAR I_USEREXIT. READ TABLE I_USEREXIT WITH KEY MODNAME = WA_MODSAPA-NAME. IF SY-SUBRC <> 0 . I_USEREXIT-MODTEXT = WA_MODSAPT-MODTEXT. I_USEREXIT-TYPE = 'Enhancement' . "#EC NOTEXT I_USEREXIT-MODNAME = WA_MODSAPA-NAME. I_USEREXIT-TXT = 'Determined from program DevClass' . "#EC NOTEXT I_USEREXIT-PNAME = 'Unknown' . "#EC NOTEXT APPEND I_USEREXIT. ENDIF . ENDSELECT . ENDIF . * set row colour. LOOP AT I_USEREXIT. CASE I_USEREXIT-TYPE . WHEN 'BADI' . I_USEREXIT-COLOUR = 'C601' . WHEN 'Enhancement' . I_USEREXIT-COLOUR = 'C501' . WHEN 'Program Exit' . I_USEREXIT-COLOUR = 'C401' . WHEN 'WorkFlow' . I_USEREXIT-COLOUR = 'C301' . WHEN 'BusTrEvent' . I_USEREXIT-COLOUR = 'C201' . ENDCASE . MODIFY I_USEREXIT. ENDLOOP . ENDFORM . "GET_ADDITIONAL_DATA *&--------------------------------------------------------------------&* *& Form DATA_DISPLAY &* *&--------------------------------------------------------------------&* *& &* *&--------------------------------------------------------------------&* FORM DATA_DISPLAY. * data selection message to sap gui CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' DESTINATION 'SAPGUI' KEEPING LOGICAL UNIT OF WORK EXPORTING TEXT = 'Prepare screen for display' "#EC NOTEXT EXCEPTIONS SYSTEM_FAILURE COMMUNICATION_FAILURE . "#EC * SORT I_USEREXIT BY TYPE TXT MODNAME. DELETE ADJACENT DUPLICATES FROM I_USEREXIT COMPARING TXT PNAME MODNAME. * ensure records selected. DESCRIBE TABLE I_USEREXIT LINES W_LINNUM. IF W_LINNUM = 0 . MESSAGE S003(G00). "No data records were selected EXIT . ENDIF . IF P_ALV = ' ' . * format headings WRITE : 'Enhancements from main program: ' , P_PNAME. WRITE : 'Enhancements from TCode: ' , P_TCODE. WRITE : 201'' . ULINE . FORMAT COLOR COL_HEADING. WRITE : / SY-VLINE, (12) C_COL1, "Enhanmt Type SY-VLINE, (40) C_COL2, "Enhancement SY-VLINE, (30) C_COL3, "Program/Include SY-VLINE, (20) C_COL4, "Enhancement name SY-VLINE, (40) C_COL5, "Enhancement description SY-VLINE, (8) C_COL6, "Project SY-VLINE, (1) C_COL7, "S SY-VLINE, (12) C_COL8, "ChangeName SY-VLINE, (10) C_COL9, "ChangeDate SY-VLINE. FORMAT RESET . ULINE . * format lines LOOP AT I_USEREXIT. * set line colour CASE I_USEREXIT-TYPE . WHEN 'Enhancement' . FORMAT COLOR 3 INTENSIFIED OFF. WHEN 'BADI' . FORMAT COLOR 4 INTENSIFIED OFF. WHEN 'BusTrEvent' . FORMAT COLOR 5 INTENSIFIED OFF. WHEN 'Program Exit' . FORMAT COLOR 6 INTENSIFIED OFF. WHEN OTHERS . FORMAT RESET . ENDCASE . WRITE : / SY-VLINE, I_USEREXIT-TYPE , SY-VLINE, I_USEREXIT-TXT(40), SY-VLINE, I_USEREXIT-PNAME(30), SY-VLINE, I_USEREXIT-MODNAME(20), SY-VLINE, I_USEREXIT-MODTEXT(40), SY-VLINE. WRITE : I_USEREXIT-MODATTR-NAME, SY-VLINE, I_USEREXIT-MODATTR-STATUS, SY-VLINE, I_USEREXIT-MODATTR-ANAM, SY-VLINE, I_USEREXIT-MODATTR-ADAT NO-ZERO, SY-VLINE. HIDE : I_USEREXIT-MODNAME, I_USEREXIT-TYPE , I_USEREXIT-MODATTR-NAME. ENDLOOP . FORMAT RESET . ULINE . * user-exits from development class of function modules IF P_DEVC = C_X. WRITE : /. WRITE : / C_DEVC. WRITE : 201'' . ULINE (90). WRITE : 201'' . LOOP AT I_DEVCLASS. CLEAR WA_MODSAPA. SELECT NAME FROM MODSAPA INTO WA_MODSAPA WHERE DEVCLASS = I_DEVCLASS-CLAS. SELECT SINGLE NAME MODTEXT INTO CORRESPONDING FIELDS OF WA_MODSAPT FROM MODSAPT WHERE NAME = WA_MODSAPA-NAME AND SPRSL = SY-LANGU. FORMAT COLOR 3 INTENSIFIED OFF. WRITE : / SY-VLINE, (12) 'Enhancement' , SY-VLINE, WA_MODSAPA-NAME, SY-VLINE, WA_MODSAPT-MODTEXT, SY-VLINE. ENDSELECT . ENDLOOP . WRITE : 201'' . ULINE (90). FORMAT RESET . ENDIF . * display fuction modules used in program WRITE /. DESCRIBE TABLE I_FMODULE LINES W_LINNUM. WRITE : / C_FMOD , AT 35 W_LINNUM. "#EC NOTEXT WRITE : 201'' . IF P_FUNC = C_X. ULINE (38). WRITE : 201'' . LOOP AT I_FMODULE. WRITE : SY-VLINE, I_FMODULE-NAME, SY-VLINE, I_FMODULE-BAPI, SY-VLINE. WRITE : 201'' . ENDLOOP . WRITE : 201'' . ULINE (38). ENDIF . * display submit programs used in program WRITE /. DESCRIBE TABLE I_SUBMIT LINES W_LINNUM. WRITE : / C_SUBM , AT 35 W_LINNUM. "#EC NOTEXT WRITE : 201'' . IF P_SUBM = C_X. ULINE (44). WRITE : 201'' . LOOP AT I_SUBMIT. WRITE : SY-VLINE, I_SUBMIT-PNAME, SY-VLINE. WRITE : 201'' . ENDLOOP . WRITE : 201'' . ULINE (44). ENDIF . * issue message with number of user-exits displayed DESCRIBE TABLE I_USEREXIT LINES W_LINNUM. MESSAGE S697(56) WITH W_LINNUM. ELSE . " Show in alv format * issue message with number of user-exits displayed DESCRIBE TABLE I_USEREXIT LINES W_LINNUM. MESSAGE S697(56) WITH W_LINNUM. * Create field catalog PERFORM CREATE_FIELD_CATALOG USING 'TYPE' 'T_USEREXIT' ' ' 'Type' . PERFORM CREATE_FIELD_CATALOG USING 'PNAME' 'T_USEREXIT' ' ' 'Prog#am name' . PERFORM CREATE_FIELD_CATALOG USING 'TXT' 'T_USEREXIT' ' ' 'Enhancement' . PERFORM CREATE_FIELD_CATALOG USING 'LEVEL' 'T_USEREXIT' C_X 'Level' . PERFORM CREATE_FIELD_CATALOG USING 'MODNAME' 'T_USEREXIT' ' ' 'Enhancement name' . PERFORM CREATE_FIELD_CATALOG USING 'MODTEXT' 'T_USEREXIT' ' ' 'Enhancement text' . PERFORM CREATE_FIELD_CATALOG USING 'MODATTR-MEMBER' 'T_USEREXIT' C_X 'Member' . PERFORM CREATE_FIELD_CATALOG USING 'MODATTR-NAME' 'T_USEREXIT' ' ' 'Project' . PERFORM CREATE_FIELD_CATALOG USING 'MODATTR-STATUS' 'T_USEREXIT' ' ' 'Status' . PERFORM CREATE_FIELD_CATALOG USING 'MODATTR-ANAM' 'T_USEREXIT' ' ' 'Changed by' . PERFORM CREATE_FIELD_CATALOG USING 'MODATTR-ADAT' 'T_USEREXIT' ' ' 'Change date' . * Layout CLEAR I_LAYOUT. I_LAYOUT-COLWIDTH_OPTIMIZE = C_X. I_LAYOUT-INFO_FIELDNAME = 'COLOUR' . * Sort CLEAR I_SORT. I_SORT-FIELDNAME = 'TYPE' . I_SORT-TABNAME = 'T_USEREXIT' . I_SORT-UP = C_X. APPEND I_SORT. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = SY-CPROG I_CALLBACK_USER_COMMAND = 'USER_COMMAND' IS_LAYOUT = I_LAYOUT IT_FIELDCAT = I_FIELDCAT[] IT_SORT = I_SORT[] I_DEFAULT = C_X I_SAVE = 'A' I_GRID_TITLE = W_GRIDTXT TABLES T_OUTTAB = I_USEREXIT. ENDIF . * issue message with number of user-exits displayed DESCRIBE TABLE I_USEREXIT LINES W_LINNUM. MESSAGE S697(56) WITH W_LINNUM. ENDFORM . "DATA_DISPLAY *&---------------------------------------------------------------------&* *& Form CREATE_FIELD_CATALOG &* *&---------------------------------------------------------------------&* FORM CREATE_FIELD_CATALOG USING P_FIELDNAME P_TABNAME P_HIDE P_TEXT. I_FIELDCAT-FIELDNAME = P_FIELDNAME. I_FIELDCAT-TABNAME = P_TABNAME. I_FIELDCAT-NO_OUT = P_HIDE. I_FIELDCAT-SELTEXT_L = P_TEXT. APPEND I_FIELDCAT. ENDFORM . " CREATE_FIELD_CATALOG *&---------------------------------------------------------------------&* *& Form CREATE_FIELD_CATALOG &* *&---------------------------------------------------------------------&* FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD. READ TABLE I_USEREXIT INDEX RS_SELFIELD-TABINDEX. CHECK SY-SUBRC = 0 . CASE R_UCOMM. WHEN '&IC1' . CASE RS_SELFIELD-SEL_TAB_FIELD. WHEN 'T_USEREXIT-MODNAME' . READ TABLE I_USEREXIT INDEX RS_SELFIELD-TABINDEX. CASE I_USEREXIT-TYPE . WHEN 'Enhancement' . SET PARAMETER ID 'MON' FIELD I_USEREXIT-MODNAME. CALL TRANSACTION 'SMOD' . WHEN 'BADI' . SET PARAMETER ID 'EXN' FIELD I_USEREXIT-MODNAME. CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN . WHEN 'BusTrEvent' . SUBMIT RFOPFI00 WITH EVENT = I_USEREXIT-MODNAME(8) AND RETURN . WHEN OTHERS . MESSAGE S030(CJ). "Navigation not possible ENDCASE . WHEN 'T_USEREXIT-MODATTR-NAME' . IF NOT I_USEREXIT-MODATTR-NAME IS INITIAL . SET PARAMETER ID 'MON_KUN' FIELD I_USEREXIT-MODATTR-NAME. CALL TRANSACTION 'CMOD' . ELSE . MESSAGE S030(CJ)."Navigation not possible ENDIF . WHEN OTHERS . MESSAGE S030(CJ)."Navigation not possible ENDCASE . ENDCASE . ENDFORM . "user_command *&--------------------------------------------------------------------&* *& AT LINE-SELECTION #* *&--------------------------------------------------------------------&* AT LINE-SELECTION. GET CURSOR FIELD W_FSEL. CASE W_FSEL. WHEN 'I_USEREXIT-MODNAME' . CASE I_USEREXIT-TYPE . WHEN 'Enhancement' . SET PARAMETER ID 'MON' FIELD I_USEREXIT-MODNAME. CALL TRANSACTION 'SMOD' . WHEN 'BADI' . SET PARAMETER ID 'EXN' FIELD I_USEREXIT-MODNAME. CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN . WHEN 'BusTrEvent' . SUBMIT RFOPFI00 WITH EVENT = I_USEREXIT-MODNAME(8) AND RETURN . WHEN OTHERS . MESSAGE S030(CJ)."Navigation not possible ENDCASE . WHEN 'I_USEREXIT-MODATTR-NAME' . IF NOT I_USEREXIT-MODATTR-NAME IS INITIAL . SET PARAMETER ID 'MON_KUN' FIELD I_USEREXIT-MODATTR-NAME. CALL TRANSACTION 'CMOD' . ELSE . MESSAGE S030(CJ)."Navigation not possible ENDIF . WHEN OTHERS . MESSAGE S030(CJ)."Navigation not possible ENDCASE . *&--------------------------------------------------------------------&* *& AT SELECTION-SCREEN &* *&--------------------------------------------------------------------&* AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1. * grey-out checkboxes if ALV selected AT SELECTION-SCREEN OUTPUT . LOOP AT SCREEN . IF P_ALV = C_X. IF SCREEN-GROUP1 = 'A01' . SCREEN-INPUT = '0' . MODIFY SCREEN . ENDIF . ELSE . IF SCREEN-GROUP1 = 'A01' . SCREEN-INPUT = '1' . MODIFY SCREEN . ENDIF . ENDIF . ENDLOOP .
标签:SY,WA,TYPE,USEREXIT,查找,ENHANGEMENT,DATA,STOKEN,FIND 来源: https://www.cnblogs.com/yushuiguodong/p/16355677.html