Application Development and Automation 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: 
Read only

USER EXIT

Former Member
0 Likes
1,583

How to find user exit for a particular TCODE ??? and how to perform necessary action on that user exit

Regards

Krishna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
897

Hi

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

Finding the user-exits of a SAP transaction code

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

tables : tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.

if sy-subrc eq 0.

select single * from tadir where pgmid = 'R3TR'

and object = 'PROG'

and obj_name = tstc-pgmna.

move : tadir-devclass to v_devclass.

if sy-subrc ne 0.

select single * from trdir where name = tstc-pgmna.

if trdir-subc eq 'F'.

select single * from tfdir where pname = tstc-pgmna.

select single * from enlfdir where funcname =

tfdir-funcname.

select single * from tadir where pgmid = 'R3TR'

and object = 'FUGR'

and obj_name eq enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

select * from tadir into table jtab

where pgmid = 'R3TR'

and object = 'SMOD'

and devclass = v_devclass.

select single * from tstct where sprsl eq sy-langu and

tcode eq p_tcode.

format color col_positive intensified off.

write:/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) tstct-ttext.

skip.

if not jtab[] is initial.

write:/(95) sy-uline.

format color col_heading intensified on.

write:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

write:/(95) sy-uline.

loop at jtab.

select single * from modsapt

where sprsl = sy-langu and

name = jtab-obj_name.

format color col_normal intensified off.

write:/1 sy-vline,

2 jtab-obj_name hotspot on,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

endloop.

write:/(95) sy-uline.

describe table jtab.

skip.

format color col_total intensified on.

write:/ 'No of Exits:' , sy-tfill.

else.

format color col_negative intensified on.

write:/(95) 'No User Exit exists'.

endif.

else.

format color col_negative intensified on.

write:/(95) 'Transaction Code Does Not Exist'.

endif.

at line-selection.

get cursor field field1.

check field1(4) eq 'JTAB'.

set parameter id 'MON' field sy-lisel+1(10).

call transaction 'SMOD' and skip first screen.

*---End of Program

User exits :

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

1. Introduction:

User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:

EXIT_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

Example:

The program for transaction VA01 Create salesorder is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i program

SAPMV45A you will find ( Among other user exits):

CALL CUSTOMER-FUNCTION '003'

exporting

xvbak = vbak

xvbuk = vbuk

xkomk = tkomk

importing

lvf_subrc = lvf_subrc

tables

xvbfa = xvbfa

xvbap = xvbap

xvbup = xvbup.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits?

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .

- Go to transaction CMOD

- Create a project called ZVA01

- Choose the Enhancement assign radio button and press the Change button

In the first column enter V45A0002 Predefine sold-to party in sales document.

Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed

Press Save

Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.

Now the function module is displayed. Double click on include ZXVVAU04 in the function module

Insert the following code into the include: E_KUNNR = '2155'.

Activate the include program. Go back to CMOD and activate the project.

Goto transaction VA01 and craete a salesorder.

Note that Sold-to-party now automatically is "2155"

What is User Exits and Customer Exits?

Difference between user exits & customer exits:

User exit - A user exit is a three character code that instructs the system to access a program during system processing.

SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit number.

UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number

Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks. *-- Mani

The following document is about exits in SAP :-

The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

Types of Exits

There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.

Menu Exits

Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

Screen Exits

Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.

Function Module Exits

Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.

When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.

Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.

These calls have the following syntax:

CALL CUSTOMER-FUNCTION ‘001’.

Field Exits

Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.

The field exit concept lets you create a special function module that contains this logic.

You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.

In 4.6c, you can use "RSMODPRF" program to create field exits.

An example of a user exits :-

MODULE user_exit_0001 INPUT

CASE okcode.

WHEN 'BACK OR EXIT'.

CASE sy-dynnr.

WHEN '100'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN '200'.

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

        • Note that you can write any code that satisfy your needs. ****

        • But in this case, this was wrote as a sample code for reference sake. ****

        • And you can test it. ****

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

SET SCREEN 100.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

check this links

http://www.sap-basis-abap.com/sapab013.htm

http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

http://www.easymarketplace.de/userexit.php

http://searchsap.techtarget.com/loginMembersOnly/1,289498,sid21_gci1145366,00.html?NextURL=http%3A//...

Regards

Pavan

3 REPLIES 3
Read only

Former Member
0 Likes
898

Hi

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

Finding the user-exits of a SAP transaction code

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

tables : tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.

if sy-subrc eq 0.

select single * from tadir where pgmid = 'R3TR'

and object = 'PROG'

and obj_name = tstc-pgmna.

move : tadir-devclass to v_devclass.

if sy-subrc ne 0.

select single * from trdir where name = tstc-pgmna.

if trdir-subc eq 'F'.

select single * from tfdir where pname = tstc-pgmna.

select single * from enlfdir where funcname =

tfdir-funcname.

select single * from tadir where pgmid = 'R3TR'

and object = 'FUGR'

and obj_name eq enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

select * from tadir into table jtab

where pgmid = 'R3TR'

and object = 'SMOD'

and devclass = v_devclass.

select single * from tstct where sprsl eq sy-langu and

tcode eq p_tcode.

format color col_positive intensified off.

write:/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) tstct-ttext.

skip.

if not jtab[] is initial.

write:/(95) sy-uline.

format color col_heading intensified on.

write:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

write:/(95) sy-uline.

loop at jtab.

select single * from modsapt

where sprsl = sy-langu and

name = jtab-obj_name.

format color col_normal intensified off.

write:/1 sy-vline,

2 jtab-obj_name hotspot on,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

endloop.

write:/(95) sy-uline.

describe table jtab.

skip.

format color col_total intensified on.

write:/ 'No of Exits:' , sy-tfill.

else.

format color col_negative intensified on.

write:/(95) 'No User Exit exists'.

endif.

else.

format color col_negative intensified on.

write:/(95) 'Transaction Code Does Not Exist'.

endif.

at line-selection.

get cursor field field1.

check field1(4) eq 'JTAB'.

set parameter id 'MON' field sy-lisel+1(10).

call transaction 'SMOD' and skip first screen.

*---End of Program

User exits :

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

1. Introduction:

User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:

EXIT_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

Example:

The program for transaction VA01 Create salesorder is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i program

SAPMV45A you will find ( Among other user exits):

CALL CUSTOMER-FUNCTION '003'

exporting

xvbak = vbak

xvbuk = vbuk

xkomk = tkomk

importing

lvf_subrc = lvf_subrc

tables

xvbfa = xvbfa

xvbap = xvbap

xvbup = xvbup.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits?

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .

- Go to transaction CMOD

- Create a project called ZVA01

- Choose the Enhancement assign radio button and press the Change button

In the first column enter V45A0002 Predefine sold-to party in sales document.

Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed

Press Save

Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.

Now the function module is displayed. Double click on include ZXVVAU04 in the function module

Insert the following code into the include: E_KUNNR = '2155'.

Activate the include program. Go back to CMOD and activate the project.

Goto transaction VA01 and craete a salesorder.

Note that Sold-to-party now automatically is "2155"

What is User Exits and Customer Exits?

Difference between user exits & customer exits:

User exit - A user exit is a three character code that instructs the system to access a program during system processing.

SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit number.

UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number

Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks. *-- Mani

The following document is about exits in SAP :-

The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

Types of Exits

There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.

Menu Exits

Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

Screen Exits

Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.

Function Module Exits

Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.

When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.

Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.

These calls have the following syntax:

CALL CUSTOMER-FUNCTION ‘001’.

Field Exits

Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.

The field exit concept lets you create a special function module that contains this logic.

You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.

In 4.6c, you can use "RSMODPRF" program to create field exits.

An example of a user exits :-

MODULE user_exit_0001 INPUT

CASE okcode.

WHEN 'BACK OR EXIT'.

CASE sy-dynnr.

WHEN '100'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN '200'.

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

        • Note that you can write any code that satisfy your needs. ****

        • But in this case, this was wrote as a sample code for reference sake. ****

        • And you can test it. ****

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

SET SCREEN 100.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

check this links

http://www.sap-basis-abap.com/sapab013.htm

http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

http://www.easymarketplace.de/userexit.php

http://searchsap.techtarget.com/loginMembersOnly/1,289498,sid21_gci1145366,00.html?NextURL=http%3A//...

Regards

Pavan

Read only

Former Member
0 Likes
897

Hi krishna kumar ,

These r the details regarding USER EXITS:

USER EXITS(Enhancements):

Introduction:

User exits (Function module exits) are exits developed by SAP.

The exit is implementerd as a call to a functionmodule.

The code for the function module is writeen by the developer.

You are not writing the code directly in the function module,

but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:

EXIT_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

If abaper can make changes for the Field Labels on Existing application of SAP is called as "Field Exits" or Field Enhancements.All GUI Screens in abap are created with Lables refering to The Data elements Field Labels.

if we make any changes to the Fields lables of Data element, these will be reflected in all screens of SAP.

The data elements created by SAP can't be customized directly , unless until we have access key.

If ABAPer is making changes for the objects in SAP using "CMOD" tcode, for each objects sap creates a customer version. The changes which are performed are in Customer version. Original code of object remains same in SAP data base. If we need to see the changes then ABAPer has to load SAP with customer versions, else if the sap is loaded with SAP versions original settings will be added by SAP.

Use Following navigations to make changes for the Field lables using Data elements.

CMOD ( TCODE ) -> NAME THE PROJECT ( ZPR9301) -> CLICK ON CREATE -> OPENS AN INTERFACE -> ENTER DESCRIPTION ( ANY ) -> SAVE THE OBJECT UNDER A PACKAGE -> COME BACK -> Click on GOTO menu -> Text Enhancements -> key words -> Change -> Opens an interface -> name the data element to be modified ( customized ) ( MATNR ) -> Click on Continue -> opens the label screen of the data element in change mode -> Change Long Field label ( enter proper description ) -> save the Entries -> assign with a request Number -> Close the Interface -> Activate the project.

1) Load the SAP Software with Customer version Changes to effect these changes on Screen.

CMOD -> GOTO menu -> Text Enhancements -> keywords -> Restore Customer Version -> SET THE RELEASE VERSION AS "620" -> Click on Continue -> Sap Executes one background job with name as "SAPUSER22:16:54" ( USERNAME WITH APPLICATION SERVER SYSTEM TIME ) -> Click on Continue.

2) Check the status of background job , if the status is finished , see the changes in SAP applications.

SM36 ( tcode) -> Click on Own Jobs to the status of background job -> By default display all job status -> Find for the JOB name (SAPUSER22:16:54) -> if the status is "finished" then see the changes in SAP Applications.

3) If we need to reload SAP orginal Screens then

CMOD -> GOTO menu -> Text Enhancements -> Keywords -> Restore SAP Version -> Set the Release version as ( 620) -> click on Continue -> Sap Executes a background job , when ever job is finished orginal setting will be added to all SAP applications.

User Exits

  • Field Customization or Field Exits.

Making Chagens of the Field lables on SAP Applications is called as Field Exits.

  • Making Changes for The Function Modules in SAP Using CMOD is called as Function Exits.

  • If we make changes for Existing Applications menu using CMOD is called as Menu Exits.

  • If we make the changes for the Screen Using The CMOD is called as Screen Exits.

As the Customer is making modifications for Fields , Menus , Function modules and Screen using CMOD these are called customer Exits or User Exits.

CUSTOMER EXITS : (t-code CMOD).

As of Release 4.6A SAP provides a new enhancement technique, the Business Add-Ins.

Among others, this enhancement technique has the advantage of being based on a multi-level system landscape (SAP, country versions, IS solutions, partner,customer, and so on) instead of a two-level landscape (SAP, customer) as with the customer exits.You can create definitions and implementations of business add-ins at any level of the system landscape.

To unify enhancements of the SAP Standard you can migrate customer exits to business add-ins.

http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm

In order to find out the user exits for any tcode,

1. get the developement class of the tcode from SE93.

2. Now goto transaction SMOD and press F4,

3. give in the Deve class in the dev class and Press ENTER

this will show u the exits for any tcode.

or execute this report

http://www.erpgenie.com/sap/abap/code/abap26.htm

which gives the list of exits for a tcode

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

For information on Exits, check these links

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

http://www.easymarketplace.de/userexit.php

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sappoint.com/abap/userexit.pdfUser-Exit

Exit is a predefined program in SAP to make customization for SAP Applications.

Use Following Navigations to Find Exits which are predefined in SAP.

CMOD -> Click onUtilities menu -> Select SAP Enhancements -> Opens an Inter to see the list of Exits used for Customizing SAP Applications -> specify name of Exit ( * ) -> Set Number of Entries as (2500) -> Click on execute from Application toolbar -> Display a report with all Exit names in SAP , Based on The Description Provided we can identify the exit is for type of Application ( This knowledge is known to Function Consultants who has Technical Experience ) -> Note down Name of Exit from the List ( BG000001: User Exit for Warrent Check ) -> Come back .

  • To customize the Exit Defined by SAP use Following Navigations.

CMOD -> Name the project ( zprj9303) -> Click on Create -> Enter Short Text (any) -> Save the Project Under a package -> Click on Enhancment Assignments pushbutton from application toolbar -> Name the Enhancements to be customized ( BG000001 ) -> Click on Components From Application toolbar -> Opens the List of Function which are assigned to The user exit -> Double Click on Function Module name -> Opens SE37 editor with Function Module Code , internally Generated with an include file starting with "Z". As Z programs can be customized in by the ABAPer , double click on program name -> opens the Source code of the program , make the changes according the company Requirements -> save -> activate -> come back.

z programs or y progarms in sap are called as "zee" programs in industries.

For the customer defined programs we need to use the name "z" for transportable objects.

"y" for Local objects.

As the program developed in Developement Environment are transported to Production systems using the Request number which are assigned to the objects.

BADI's

BADI's are advanced concepts of User Exits. user exits are used to Customize the Existing Program with help of Exit names using CMOD.

SE18 AND SE19 ARE the tcodes for BADI creation and Implementations.

CLASSES : IS THE USER DEFINED DATA TYPE IN SAP AS COLLECTION OF METHODS AND METHOD BODY USING CLASS IMPLEMENTATION.

INTERFACES : IS ALSO A USER DEFINED DATA TYPE WITH ONLY COLLECTION OF METHODS IN SAP.

Use Following Navigations to create a BADI in the form of Interface.

SE18 -> NAME THE BADI (Z9301BADI) -> CLICK ON CREATE -> ENTER DESCRIPTION FOR BADI -> SAVE THE OBJECT UNDER A PACKAGE -> CLICK ON INTERFACE TAB BUTTON -> DOUBEL CLICK ON INTERFACE NAME GENERATED BY SAP ( ZIF_EX_9301BADI ) -> OPENS SE24 TCODE -> DEFINE A METHOD FOR INTERFACE -> NAME THE METHOD ( TOUPPER ) -> SET THE LEVEL AS "Instance Method" -> CLICK ON PARAMETERS PUSHBUTTON -> DEFINE THE ARGUMENT AS "STR" -> SET THE TYPE AS "Changing" -> SET THE ASSOCIATED TYPE AS TYPE "C" -> SAVE THE INTERFACE ->ACTIVATE -> COME BACK.

  • Generate the code for the method defined in Inteface using "SE19" tcode.

SE19 -> Name the Implementation ( Z9301BADI ) -> click on Create -> assign the Definition ( Z9301BADI ) -> click on Continue -> Enter description for Implementation ( any ) -> Click on Interface tab button -> Double click on method name -> Click on Yes to create the Object -> Save the Object under a package -> Opens the method code Interface -> Generate the code between method and endmethod as follows

method ZIF_EX_9301BADI~TOUPPER .

TRANSLATE STR TO UPPER CASE.

endmethod.

-> SAVE THE OBJECT -> COME BACK -> ACTIVATE THE Interface.

Use the BADI for SE38 programs as Follows.

REPORT ZPRG_INVOKE_BADI.

data : s1(30) value 'Testing BADI functionality'.

write : s1 color 4.

data : OBJ TYPE REF TO ZIF_EX_9301BADI.

  • FOLLOWING STATEMENT ALLOCATES MEMORY * FOR OBJECT WHICH IS DEFINED

  • FOR AN INTERFACE .

CALL METHOD CL_EXITHANDLER=>GET_INSTANCE

CHANGING

INSTANCE = OBJ.

CALL METHOD OBJ->TOUPPER

CHANGING

STR = S1.

WRITE : / 'AFTER BADI METHOD ', S1.

=> : IS THE ACCESS SPECIFIED USED TO SPECIFY METHOD TYPE IS A CONSTRUCTOR.

  • When ever we need to communicate the variable data between different programs we can use SET PARAMETER ID AND GET PARAMETER ID STATEMENTS.

SET PARAMETER ID STATEMENT SETS A VALUE TO THE MEMORY ID SPECIFIED IN PROGRAM AT APPLICATION SERVER SERVER SHARED MEMORY.

SYNTAX:

SET PARAMETER ID <PID> FIELD <VAR>.

GET PARAMETER ID IS USED TO GET THE STORED VALUE FROM SHARED MEMORY INTO CURRENT PROGRAM.

SYNTAX:

GET PARAMETER ID <PID> FIELD <VAR>.

EXAMPLE CODE.

  • FIRST PROGRAM

REPORT ZP1 NO STANDARD PAGE HEADING.

DATA : STR(20) TYPE C VALUE 'SUBBARAO'.

SET PARAMETER ID 'AAA' FIELD STR.

WRITE : STR.

  • SECOND PROGRAM.

REPORT ZP2 .

DATA : S1(20).

GET PARAMETER ID 'AAA' FIELD S1.

WRITE : S1.

  • In the same program even if values are cleared then data should be retrived.

EXPORT IS THE STATEMENT IN ABAP TO STORE A VARIABLE TO GLOBAL MEMORY IN THE SAME PRESENTATION LAYER MEMORY TO USE THE VALUE FOR OTHER SCREENS OR FOR MULTIPLE TIMES IN THE SAME PROGRAM.

IMPORT IS THE STATEMENT USED TO GET THE VALUES FROM MEMORY STORED USING "EXPORT" STATEMENT.

SYNTAX:

EXPORT <VAR> TO MEMORY ID <MID>.

IMPORT <VAR> FROM MEMORY ID <MID>.

EXAMPLE CODE.

data : str(20) value 'india is great'.

write : str.

EXPORT STR TO MEMORY ID 'AA'.

clear str.

write : / ' CHECK ', str COLOR 6.

IMPORT STR FROM MEMORY ID 'AA'.

WRITE : / STR COLOR 7.

This web-site gives tips on user-exits:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50...

cheers!

gyanaraj

*****Pls reward points if u find this informative

Read only

Former Member
0 Likes
897