ZFIND_ENHANCEMENT(找增强点-新)
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: May &*
*&--------------------------------------------------------------------&*
*& 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 . 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() TYPE C ,
W_CNT() TYPE C ,
W_FUNCNAME LIKE TFDIR-FUNCNAME,
W_FSEL LIKE SY-UCOMM, " Determination of screen field
W_GRIDTXT() TYPE C . "ALV grid title CONSTANTS:
C_FMOD() TYPE C VALUE 'Function modules searched: ' ,
C_SUBM() TYPE C VALUE 'Submit programs searched: ' ,
C_DEVC() TYPE C VALUE 'User-exits from development classes in function modules' ,
C_COL1() TYPE C VALUE 'Enhanmt Type' ,
C_COL2() TYPE C VALUE 'Enhancement' ,
C_COL3() TYPE C VALUE 'Program/Include' ,
C_COL4() TYPE C VALUE 'Enhancement Name' ,
C_COL5() TYPE C VALUE 'Enhancement Description' ,
C_COL6() TYPE C VALUE 'Project' ,
C_COL7() TYPE C VALUE 'S' ,
C_COL8() TYPE C VALUE 'ChangeName' ,
C_COL9() 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() TYPE C,
PNAME LIKE TRDIR-NAME,
TXT(),
LEVEL TYPE C ,
MODNAME() TYPE C ,
MODTEXT() TYPE C ,
MODATTR TYPE TY_MOD,
COLOUR() 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(), "#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() TYPE C . * Description of an ABAP/ 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/ 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(),
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() TYPE N DEFAULT .
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() 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 = .
P_LIMIT = .
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 = .
CHECK WA_TSTCP-PARAM() = '/' .
CHECK WA_TSTCP-PARAM+() = '*' .
IF WA_TSTCP-PARAM CA ' ' .
ENDIF .
W_OFF = SY-FDPOS + .
SUBTRACT FROM SY-FDPOS.
IF SY-FDPOS GT .
P_TCODE = WA_TSTCP-PARAM+(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 <> .
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 > .
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 > . "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 .
W_LEVEL = '' .
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 = . 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 = . SCAN ABAP-SOURCE SOURCETAB TOKENS INTO I_STOKEN
STATEMENTS INTO I_SSTMNT
KEYWORDS FROM KEYWORDS
WITH INCLUDES.
IF SY-SUBRC > .
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 .
W_LEVEL = '' .
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 = '' . 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 = . SCAN ABAP-SOURCE SOURCETAB TOKENS INTO I_STOKEN
STATEMENTS INTO I_SSTMNT
KEYWORDS FROM KEYWORDS
WITH INCLUDES.
IF SY-SUBRC > .
* 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 .
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 = '' .
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 '' . " do not perform for function modules (2nd pass)
IF P_STOKEN-STR+() 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 + .
I_USEREXIT-LEVEL = P_LEVEL.
IF I_USEREXIT-LEVEL = '' .
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 '' . " do not perform for function modules (2nd pass)
W_INDEX = SY-TABIX + .
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 <> .
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 '' . " do not perform for function modules (2nd pass)
W_INDEX = SY-TABIX + .
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 <> .
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 = . " 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 + .
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 = .
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+().
CASE I_USEREXIT-TXT+().
WHEN 'E' .
CLEAR WA_TBE01T.
SELECT SINGLE TEXT1 INTO WA_TBE01T-TEXT1 FROM TBE01T
WHERE EVENT = I_USEREXIT-TXT+()
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+ = '/P&S' . "#EC NOTEXT
WHEN 'P' .
CLEAR WA_TPS01T.
SELECT SINGLE TEXT1 INTO WA_TPS01T-TEXT1 FROM TPS01T
WHERE PROCS = I_USEREXIT-TXT+()
AND SPRAS = SY-LANGU.
I_USEREXIT-MODTEXT = WA_TPS01T-TEXT1.
I_USEREXIT-MODNAME+ = '/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 '' . " do not perform for function modules (2nd pass)
CHECK NOT P_STOKEN-STR CS '_' . " ensure not SUBMIT_XXX
W_INDEX = SY-TABIX + .
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 <> .
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 '' . " do not perform for function modules (2nd pass)
W_INDEX = SY-TABIX + .
READ TABLE P_STOKEN INDEX W_INDEX INTO WA_STOKEN.
IF NOT WA_STOKEN-OVFL IS INITIAL .
W_OFF = WA_STOKEN-OFF1 + .
W_STR = C_OVERFLOW+W_OFF().
FIND ')' IN W_STR MATCH OFFSET W_OFF.
IF SY-SUBRC = .
W_OFF = W_OFF + .
WA_STOKEN-STR = W_STR(W_OFF).
ENDIF .
ENDIF . CHECK WA_STOKEN-STR CS '(' .
W_OFF = .
WHILE SY-SUBRC = .
IF WA_STOKEN-STR+W_OFF() EQ '(' .
REPLACE SECTION OFFSET W_OFF LENGTH 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 <> .
I_SUBMIT-PNAME = WA_STOKEN-STR.
APPEND I_SUBMIT.
ENDIF .
EXIT .
ELSE .
REPLACE SECTION OFFSET W_OFF LENGTH 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 '' . " do not perform for function modules (2nd pass)
W_INDEX = SY-TABIX + .
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 = . " 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 = .
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 = .
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 = .
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 = .
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+ .
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 = .
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 <> .
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 = .
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 : '' .
ULINE .
FORMAT COLOR COL_HEADING.
WRITE : / SY-VLINE,
() C_COL1, "Enhanmt Type
SY-VLINE,
() C_COL2, "Enhancement
SY-VLINE,
() C_COL3, "Program/Include
SY-VLINE,
() C_COL4, "Enhancement name
SY-VLINE,
() C_COL5, "Enhancement description
SY-VLINE,
() C_COL6, "Project
SY-VLINE,
() C_COL7, "S
SY-VLINE,
() C_COL8, "ChangeName
SY-VLINE,
() 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 INTENSIFIED OFF.
WHEN 'BADI' .
FORMAT COLOR INTENSIFIED OFF.
WHEN 'BusTrEvent' .
FORMAT COLOR INTENSIFIED OFF.
WHEN 'Program Exit' .
FORMAT COLOR INTENSIFIED OFF.
WHEN OTHERS .
FORMAT RESET .
ENDCASE .
WRITE : / SY-VLINE,
I_USEREXIT-TYPE ,
SY-VLINE,
I_USEREXIT-TXT(),
SY-VLINE,
I_USEREXIT-PNAME(),
SY-VLINE,
I_USEREXIT-MODNAME(),
SY-VLINE,
I_USEREXIT-MODTEXT(),
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 : '' .
ULINE ().
WRITE : '' . 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 INTENSIFIED OFF.
WRITE : / SY-VLINE,
() 'Enhancement' ,
SY-VLINE,
WA_MODSAPA-NAME,
SY-VLINE,
WA_MODSAPT-MODTEXT,
SY-VLINE.
ENDSELECT .
ENDLOOP .
WRITE : '' .
ULINE ().
FORMAT RESET .
ENDIF . * display fuction modules used in program
WRITE /.
DESCRIBE TABLE I_FMODULE LINES W_LINNUM.
WRITE : / C_FMOD , AT W_LINNUM. "#EC NOTEXT
WRITE : '' . IF P_FUNC = C_X.
ULINE ().
WRITE : '' .
LOOP AT I_FMODULE.
WRITE : SY-VLINE,
I_FMODULE-NAME,
SY-VLINE,
I_FMODULE-BAPI,
SY-VLINE.
WRITE : '' .
ENDLOOP .
WRITE : '' .
ULINE ().
ENDIF . * display submit programs used in program
WRITE /.
DESCRIBE TABLE I_SUBMIT LINES W_LINNUM.
WRITE : / C_SUBM , AT W_LINNUM. "#EC NOTEXT
WRITE : '' .
IF P_SUBM = C_X.
ULINE ().
WRITE : '' .
LOOP AT I_SUBMIT.
WRITE : SY-VLINE,
I_SUBMIT-PNAME,
SY-VLINE.
WRITE : '' .
ENDLOOP .
WRITE : '' .
ULINE ().
ENDIF . * issue message with number of user-exits displayed
DESCRIBE TABLE I_USEREXIT LINES W_LINNUM.
MESSAGE S697() 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() 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() 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 = .
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() 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() 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 = '' .
MODIFY SCREEN .
ENDIF .
ELSE .
IF SCREEN-GROUP1 = 'A01' .
SCREEN-INPUT = '' .
MODIFY SCREEN .
ENDIF .
ENDIF .
ENDLOOP .
ZFIND_ENHANCEMENT(找增强点-新)的更多相关文章
- 放弃OT了,找了个新框架ThinkCMF
放弃OT了,找了个新框架ThinkCMF,感觉还不错,用用看. 选择OT的原因: 1. OT基于ThinkPHP 2. OT对ThinkPHP进行了封装,使得开发应用更加简单 3. yershop应用 ...
- Spring4.1新特性——Spring缓存框架增强(转)
目录 Spring4.1新特性——综述 Spring4.1新特性——Spring核心部分及其他 Spring4.1新特性——Spring缓存框架增强 Spring4.1新特性——异步调用和事件机制的异 ...
- Spring4.1新特性——Spring MVC增强
目录 Spring4.1新特性——综述 Spring4.1新特性——Spring核心部分及其他 Spring4.1新特性——Spring缓存框架增强 Spring4.1新特性——异步调用和事件机制的异 ...
- [SAP ABAP开发技术总结]增强Enhancement
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Adobe Flash Builder 4.7 新功能详解
Adobe Flash Builder 4.7 Beta终于公开测试了.虽然版本号只增加了.1,增强的新功能可是一点也不含糊.我们一起来看看到底有什么新功能吧! 在我看来,最大的改变是终于提供64 ...
- Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC 配置校验器
Spring4新特性——泛型限定式依赖注入 Spring4新特性——核心容器的其他改进 Spring4新特性——Web开发的增强 Spring4新特性——集成Bean Validation 1.1(J ...
- Sina 新浪Ip归属地Api 很好用的,使用get请求
前言 这几天做了一个客服管理系统,需要根据游客的Ip获取他的归属地,刚开始使用了,www.ip138.com 抓取ip归属地,用这还可以,但是不显示国家:于是是找了这个新浪的Api,很不错啊 用法 1 ...
- 【ArcGIS 10.2新特性】ArcGIS 10.2 for Server新特性
ArcGIS forServer相关的很多重大消息,如与Portal for ArcGIS进行了集成,提供对实时数据支持.离线地图使用. 1.与Portal for ArcGIS集成 用户能够配置Po ...
- 【ArcGIS 10.2新特性】ArcGIS 10.2 for Desktop 新特性(一)
ArcGIS 10.2 for Desktop是在10.1的成功基础上进行的改进,它的改进包括:性能提升.附加的安全性.40多个新的分析工具.3D功能提高.栅格增强.新的地理数据管理能力以及其它更多的 ...
随机推荐
- Scrapy学习-18-去重原理
Scrapy去重原理 scrapy本身自带一个去重中间件 scrapy源码中可以找到一个dupefilters.py去重器 源码去重算法 # 将返回值放到集合set中,实现去重 def reque ...
- HDU 4722:Good Numbers(数位DP)
类型:数位DP 题意:定义一个Good Number 为 一个数所有位数相加的和%10==0.问[A,B]之间有多少Good Number. 方法: 正常“暴力”的定义状态:(i,d,相关量) 定义d ...
- VUE之命令行报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead 解决办法
Failed to compile. ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-5992 ...
- Java 基础【01】 This 用法
业精于勤,荒于嬉:行成于思,毁于随.——韩愈 用类名定义一个变量的时候,定义的只是一个引用,外面可以通过这个引用来访问这个类里面的属性和方法. 那们类里面是够也应该有一个引用来访问自己的属性和方法纳? ...
- 洛谷——P2404 自然数的拆分问题
题目背景 任何一个大于1的自然数n,总可以拆分成若干个小于n的自然数之和. 题目描述 任何一个大于1的自然数n,总可以拆分成若干个小于n的自然数之和. 输入输出格式 输入格式: 输入:待拆分的自然数n ...
- Oracle PL/SQL 存储过程、函数、包 的范例
1,写函数和过程,输入三角形三个表的长度.在控制台打印三角形的面积 -- 创建包 create or replace package pac_area is -- 定义计算三角形面积的过程 proce ...
- 作为使用者对qq拼音输入法和搜狗输入法的评价
我还记得在打字方面从一开始XP里面自带的中文输入法到QQ拼音输入法的过度,当时第一次使用qq拼音最大的感受就是这个输入法很智能,给人一种恍然一新的感觉,对于XP系统中自带的拼音输入法,QQ拼音最大的特 ...
- SQL-基础学习1--SELECT,LIMIT,DISTINCT,注释
所使用的数据库资料在:数据库资料 1.1 基础概念 1.数据库(database) 保存有组织的数据的容器(通常是一个文件或一组文件) 注意:常用的mysql,等是数据库管理系统DBMS:由这些软件创 ...
- exec: "docker-proxy": executable file not found in $PATH
在执行 docker run 操作的时候,一直报如下错误: [root@etcd1 vagrant]# docker run --name redis-6379 -p 6379:6379 -d --r ...
- c#中开发ActiveX的学习笔记【转】
http://www.cnblogs.com/yjmyzz/archive/2009/12/14/1623396.html 1.为什么要用ActiveX? 网页本身的功能是有限的,要想实现一些网页本身 ...