Userexits in a Transaction
Userexits in a Transaction
Userexits in a Transaction
This document may discuss sample coding or other information that does not include SAP official interfaces
and therefore is not supported by SAP. Changes made based on this information are not supported and can
be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or seek
to hold, SAP responsible or liable with respect to the content of this document.
Applies To:
SAP 4.6C and SAP SAP 4.7 Enterprise Edition
Summary
To display and list out the Userexits for a given transaction.
*&---------------------------------------------------------------------*
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
* Functional Consultant : *
* Date : 15-Nov-2005 *
* Transport Request No : *
*----------------------------------------------------------------------*
* Modification Log *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* *
************************************************************************
REPORT Z_USEREXIT_DISPLAY
LINE-SIZE 200
MESSAGE-ID ZZ.
*&---------------------------------------------------------------------*
* TABLE DECLARATIONS *
*&---------------------------------------------------------------------*
TABLES: TFTIT,
E071,
E070.
*&---------------------------------------------------------------------*
* STRUCTURE DECLARATIONS *
*&---------------------------------------------------------------------*
END OF X_TSTC.
END OF X_TADIR.
END OF X_SLOG.
END OF X_FINAL.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* VARIABLES DECLARATIONS *
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* SELECTION SCREEN *
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Start of Selection *
*&---------------------------------------------------------------------*
START-OF-SELECTION.
*&---------------------------------------------------------------------*
* End of Selection *
*&---------------------------------------------------------------------*
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Get Tcodes
*----------------------------------------------------------------------*
FORM GET_TCODES.
SELECT TCODE
PGMNA
FROM TSTC
IF SY-SUBRC = 0.
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Get Objects
*----------------------------------------------------------------------*
FORM GET_OBJECTS.
SELECT OBJ_NAME
DEVCLASS
OBJ_NAME = IT_TSTC-PGMNA.
IF SY-SUBRC = 0.
SELECT OBJ_NAME
DEVCLASS = IT_TADIR-DEVCLASS.
IF SY-SUBRC = 0.
ENDIF.
ENDIF.
ENDIF.
LOOP AT IT_JTAB.
SELECT NAME
MEMBER
FROM MODSAP
TYP = 'E'.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ENDSELECT.
ENDLOOP.
LOOP AT IT_FINAL.
L_TABIX = SY-TABIX.
CLEAR: L_FNAME,
L_GROUP,
L_INCLUDE,
L_NAMESPACE,
L_STR_AREA.
L_FNAME = IT_FINAL-MEMBER.
EXPORTING
FUNCNAME = L_FNAME
IMPORTING
GROUP = L_GROUP
INCLUDE = L_INCLUDE
NAMESPACE = L_NAMESPACE
STR_AREA = L_STR_AREA
EXCEPTIONS
FUNCTION_NOT_EXIST = 1
OTHERS = 2.
IF SY-SUBRC = 0.
V_INCLUDE = L_INCLUDE.
EXPORTING
I_INCLUDE = V_INCLUDE
TABLES
E_T_INCLUDE = E_T_INCLUDE.
IF SY-SUBRC = 0.
LOOP AT E_T_INCLUDE.
IF E_T_INCLUDE-LINE CS 'INCLUDE'.
CLEAR L_LINE.
L_LINE = E_T_INCLUDE-LINE.
L_LINE = L_LINE+7(9).
IT_FINAL-INCLUDE = L_LINE.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Display Results
*----------------------------------------------------------------------*
FORM DISPLAY_RESULTS.
WRITE:/1(150) SY-ULINE.
WRITE:/ SY-VLINE,
24 SY-VLINE,
64 SY-VLINE,
65(74) 'Description',
140 SY-VLINE,
141(9) 'Include',
150 SY-VLINE.
WRITE:/1(150) SY-ULINE.
FORMAT RESET.
LOOP AT IT_FINAL.
CLEAR TFTIT.
INTO TFTIT-STEXT
FROM TFTIT
FUNCNAME = IT_FINAL-MEMBER.
WRITE:/ SY-VLINE,
25 IT_FINAL-MEMBER, 64 SY-VLINE,
WRITE:/1(150) SY-ULINE.
ENDLOOP.
Author Bio
Mr.Rajasekhar Dinavahi is an SAP Systems Analyst specializing in on-line application development in ABAP/4,
Working for Intelligroup Asia Pvt. Ltd. Has 5 years of experience in SAP and an overall experience of 7 years in the
IT Industry.