Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how can we C the USER_EXITS in Z programs

Former Member
0 Kudos

How can we get the list of all USER_Exits used in Zprograms.Can we get module wise ???

Plz reply me .

Thanks and Regards

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Hi Hussain,

I've never come across such a situation.

I don't think Z Programs have such exits.

Z programs are a result of customization and they don't need any user-exits to make the modifications.

You have to identify the location where you need to insert your logic, so that you will have the desired result.

Regards,

ravi

former_member188685
Active Contributor
0 Kudos

Hi ZPROGRAMS are Custom Programs , So User Exits are under our control, where ever we want we can insert or modify the code.

i don't think there will be some Transactions to find.

Depends on Functional Logic we will proceed.

May be you can refer Functionality of Module if you want to modify.

regards

vijay

0 Kudos

Hi Hussain,

You can get a list of all the user exits created in the system by searching for 'ZX*' in se38 or under Programs in se80. For module wise exits, pl use SMOD transaction. Once in it, Environment>Application Hierarchy>SAP

Hope this is what you are looking for...

Suresh Datti

Former Member
0 Kudos

I think you are using the word Zprograms incorrectly. If you want to know what are all the user exits used in SAp system, then go to CMOD, type in Z* and do F4. Look at each one of them to see which user exits are being used.

Still there are some, particularly in SD, that are just modifications like MV45AFZZ form exits. You just have to know which ones they are, and look in them for any custom code.

Can you please elaborate as to what exactly that you want to look for?

Srinivas

Former Member
0 Kudos

Hi Hussain,

For Zprogramms you can make changes any time till you have the authorization to create trasnport requests in the system.

User Exits are usually used as patch ups for standard SAP codes. You can search " CALL CUSTOMER FUNCTION " in the standard code to get user exits. You can go to transaction SMOD to view the user exits. Were you can write your code and customize the standard code as per your requirement.

Can please elaborate you exact requirement.

Regards,

Kapil

Former Member
0 Kudos

Hi Hussain,

UserExits are available in SAP standard programs. They are just like 'pockets' in the flow. In the flow, control comes to these pockets and execute the code written in these pockets, and control proceeds further.

Not clear what you meant by 'How can we get the list of all USER_Exits used in Zprograms'?

And, to display the userexits trxn wise (i.e trxn as input)...use the below code:

*****

&----


*& Report Z_USEREXIT_DISPLAY *

*& *

&----


*& *

*& *

&----


  • Title : Display UserExits *

  • Object Owner : RAJ *

  • Functional Consultant : *

  • Technical Consultant : Mr. Rajasekhar Dinavahi *

  • Date : 03-AUG-2005 *

  • Transport Request No : *

----


  • Modification Log *

----


  • ModNo Date Consultant Description of Change(s) *

----


  • *

************************************************************************

REPORT z_userexit_display

NO STANDARD PAGE HEADING

LINE-SIZE 200

MESSAGE-ID zz.

&----


  • T A B L E D E C L A R A T I O N S *

&----


TABLES: tftit,

e071,

e070.

&----


  • S T R U C T U R E D E C L A R A T I O N S *

&----


TYPES: BEGIN OF x_tstc,

tcode TYPE tcode,

pgmna TYPE program_id,

END OF x_tstc.

TYPES: BEGIN OF x_tadir,

obj_name TYPE sobj_name,

devclass TYPE devclass,

END OF x_tadir.

TYPES: BEGIN OF x_slog,

obj_name TYPE sobj_name,

END OF x_slog.

TYPES: BEGIN OF x_final,

name TYPE smodname,

member TYPE modmember,

include(15), "Include name

END OF x_final.

&----


  • I N T E R N A L T A B L E D E C L A R A T I O N S *

&----


DATA: it_tstc TYPE STANDARD TABLE OF x_tstc WITH HEADER LINE.

DATA: it_tadir TYPE STANDARD TABLE OF x_tadir WITH HEADER LINE.

DATA: it_jtab TYPE STANDARD TABLE OF x_slog WITH HEADER LINE.

DATA: it_final TYPE STANDARD TABLE OF x_final WITH HEADER LINE.

&----


  • V A R I A B L E S D E C L A R A T I O N S *

&----


&----


  • U S E R I N P U T S S C R E E N *

&----


&----


  • S E L E C T I O N S C R E E N *

&----


SELECTION-SCREEN: BEGIN OF BLOCK blk01 WITH FRAME TITLE text-t01.

PARAMETERS: p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN END OF BLOCK blk01.

&----


  • S t a r t o f S e l e c t i o n *

&----


START-OF-SELECTION.

PERFORM get_tcodes. "Get Tcodes

PERFORM get_objects. "Get Objects

&----


  • E n d o f S e l e c t i o n *

&----


END-OF-SELECTION.

PERFORM display_results. "Display Results

&----


*& Form get_tcodes

&----


  • Get Tcodes

----


FORM get_tcodes.

SELECT tcode

pgmna

INTO TABLE it_tstc

FROM tstc

WHERE tcode = p_tcode.

IF sy-subrc = 0.

SORT it_tstc BY tcode.

ENDIF.

ENDFORM. " get_tcodes

&----


*& Form get_objects

&----


  • Get Objects

----


FORM get_objects.

DATA: l_fname LIKE rs38l-name,

l_group LIKE rs38l-area,

l_include LIKE rs38l-include,

l_namespace LIKE rs38l-namespace,

l_str_area LIKE rs38l-str_area.

DATA: v_include LIKE rodiobj-iobjnm.

DATA: e_t_include TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.

DATA: l_line TYPE string,

l_tabix LIKE sy-tabix.

IF NOT it_tstc[] IS INITIAL.

SELECT obj_name

devclass

INTO TABLE it_tadir

FROM tadir FOR ALL ENTRIES IN it_tstc

WHERE pgmid = 'R3TR' AND

object = 'PROG' AND

obj_name = it_tstc-pgmna.

IF sy-subrc = 0.

SORT it_tadir BY obj_name devclass.

SELECT obj_name

INTO TABLE it_jtab

FROM tadir FOR ALL ENTRIES IN it_tadir

WHERE pgmid = 'R3TR' AND

object = 'SMOD' AND

devclass = it_tadir-devclass.

IF sy-subrc = 0.

SORT it_jtab BY obj_name.

ENDIF.

ENDIF.

ENDIF.

*- Get UserExit names

LOOP AT it_jtab.

SELECT name

member

INTO (it_final-name, it_final-member)

FROM modsap

WHERE name = it_jtab-obj_name AND

typ = 'E'.

APPEND it_final.

CLEAR it_final.

ENDSELECT.

ENDLOOP.

*- Process it_final contents.

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.

CALL FUNCTION 'FUNCTION_EXISTS'

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.

IF NOT l_include IS INITIAL.

*- Get Source code of include.

CLEAR: v_include, e_t_include, e_t_include[].

v_include = l_include.

CALL FUNCTION 'MU_INCLUDE_GET'

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.

CONDENSE l_line NO-GAPS.

TRANSLATE l_line USING '. '.

l_line = l_line+7(9).

it_final-include = l_line.

MODIFY it_final INDEX l_tabix TRANSPORTING include.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " get_objects

&----


*& Form display_results

&----


  • Display Results

----


FORM display_results.

FORMAT COLOR COL_HEADING.

WRITE:/1(150) sy-uline.

WRITE:/ sy-vline,

2(23) 'Extension Name',

24 sy-vline,

25(39) 'Exit Name',

64 sy-vline,

65(74) 'Description',

140 sy-vline,

141(9) 'Include',

150 sy-vline.

WRITE:/1(150) sy-uline.

FORMAT RESET.

SORT it_final BY name member.

LOOP AT it_final.

CLEAR tftit.

SELECT SINGLE stext

INTO tftit-stext

FROM tftit

WHERE spras = 'EN' AND

funcname = it_final-member.

WRITE:/ sy-vline,

it_final-name COLOR COL_KEY, 24 sy-vline,

25 it_final-member, 64 sy-vline,

65 tftit-stext, 140 sy-vline,

141 it_final-include, 150 sy-vline.

WRITE:/1(150) sy-uline.

ENDLOOP.

ENDFORM. " display_results

*****

Regards,

Raj