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

sushant_singh
Participant
0 Likes
1,060

hi Gurus,

how can i create user-exit using transaction SMOD not CMOD .

Plz tell me step by step .Thanks in advance.

Regards

Sushant Singh

11 REPLIES 11
Read only

Former Member
0 Likes
992

Hi,

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.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.easymarketplace.de/userexit.php

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

http://www.planetsap.com/userexit_main_page.htm

User-Exits

http://www.sap-img.com/ab038.htm

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

http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283

These links will help you to learn more on user exits.

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

http://www.allsaplinks.com/user_exit.html

Also please check these threads for more details about user exits.

1. Document on UserExits in FI/CO

http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc

2. Finding User Exits...

http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits

3. List of all User Exits...

http://www.planetsap.com/userexit_main_page.htm

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=312792

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=1320078

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=2669896

Regards,

Priyanka.

Read only

Former Member
0 Likes
992

<u>CMOD</u>

1)ENTER TRANSACTION CMOD AND AND PRESS ENTER

2)ENTER SOME PROJECT NAME AND PUSS BUTTON CREAT BUTTON

3)ENTER SOME SHORT TEXT

4)SAVE

5)CLICK ON ENHANCEMENT ASSIGNMENT

6)ADD THE ENHANCEMENTS YOU WANT INCLUDE IN THE PROJECT

7)AFTER SAVEING UR PROJECT YOU NEED TO ACTIVATE IT

<u>SMOD</u>

1)ENTER TRANSACTION SMOD AND PRESS ENTER

2)WITH THE NAME OF THE ENHANCEMENT YOU CAN DISPLAY ITS COMPONENTS , ENTER ENHANCEMENT NAME AND PRESS DISPLAY

REWARD IF USEFUL

Read only

Former Member
0 Likes
992

Hi,

look in txn CMOD or SMOD, check enhancement 0VRF0001. It uses function module EXIT_SAPL0VRF_001. It is used to manipulate route determination for SD.

Here is the code

DATA: ls_xvbpa LIKE xvbpa,

lf_aland LIKE tvst-aland,

lf_azone LIKE tvst-azone,

lf_lland LIKE trolz-lland,

lf_lzone LIKE trolz-lzone,

ls_vbadr LIKE vbadr,

ls_xvbap LIKE xvbap,

ls_tvst LIKE tvst,

lv_route LIKE trolz-route.

LOOP AT xvbap INTO ls_xvbap.

IF NOT ls_xvbap-vstel IS INITIAL.

SELECT SINGLE * FROM tvst

INTO ls_tvst

WHERE vstel EQ ls_xvbap-vstel.

IF sy-subrc = 0.

lf_aland = ls_tvst-aland.

lf_azone = ls_tvst-azone.

ENDIF.

ENDIF.

READ TABLE xvbpa INTO ls_xvbpa WITH KEY vbeln = ls_xvbap-vbeln

posnr = ls_xvbap-posnr

parvw = 'Q1'.

IF sy-subrc = 0.

CALL FUNCTION 'SD_ADDRESS_GET'

EXPORTING

fif_address_number = ls_xvbpa-adrnr

IMPORTING

fes_address = ls_vbadr

EXCEPTIONS

address_not_found = 1

address_type_not_exists = 2

no_person_number = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

lf_lland = ls_vbadr-land1.

lf_lzone = ls_vbadr-lzone.

ENDIF.

ENDIF.

CALL FUNCTION 'SD_ROUTE_DETERMINATION'

EXPORTING

i_aland = lf_aland

i_azone = lf_azone

i_lland = lf_lland

i_lzone = lf_lzone

IMPORTING

e_route = lv_route

EXCEPTIONS

no_route_found = 1

departure_error = 2

destination_error = 3

invalid_generic_key = 4

customer_exit_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

ls_xvbap-route = lv_route.

MODIFY xvbap FROM ls_xvbap TRANSPORTING route.

ENDIF.

ENDLOOP.

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
992

First find out the user exit using this programme for particular transaction.

then create a project through CMOD tcode and assign corrosponding exit in that project.then you place break-point in fuction module those are componet of ur exit.then try to execute ur tode.

If your ur break-point come during execution of programme.That mens this is the right exit.

you can then see the documenttaion of exit in smod tcode then try to code accordingly.

&----


*& Report YEXIT1 *

*& *

&----


*& *

*& *

&----


REPORT YEXIT1

.

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.

Read only

Former Member
0 Likes
992

Exits are basically the hooks whcih SAP has provided to add your own code. There are two types of Exits:

1. Customer exits: Implemented as Function Modules within z includes. Anybody can change it and no access key is required.

2. User Exit: Implemented as subroutines within includes (any include except y or z includes). You need access for the specific include and then you can any subroutine (user exit) within that Include.

BADIs are the enhanced version of user exits where the same logic is implemented via classes and object (OOP)

Enchancement point is the latest once introduces with ECC6.0 . Not very sure about that but you can change it without any access key.

Please go through the following link which will help you understand the exits in a much better way:

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec07a25db911d295ae0000e82de14a/content.htm

http://www.sap-img.com/abap/what-is-the-difference-between-smod-and-cmod.htm

http://sap.niraj.tripod.com/id21.html

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

http://www.sap-img.com/ab038.htm

check the below links

User Exits.

-


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

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

customer exits

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662...

Menu Exit.

http://www.sappoint.com/abap/spmp.pdf

http://www.sappoint.com/abap/userexit.pdf

http://www.sapdevelopment.co.uk/enhance/mod_sapmenu.htm

http://www.sapdevelopment.co.uk/enhance/enhancehome.htm

Please reward the helpful entries.

Regards,

Raman.

Read only

Former Member
0 Likes
992

Hi Sushant,

In order to use an exit we have to work with both CMOD and SMOD.

CMOD is used to create customer projects.

SMOD may be used to view the existing enhancements.

We have to create a project in CMOD and add an enhancement to it.

By the way, why don't you want to use SMOD and not CMOD?

Regards,

Ravi

Read only

0 Likes
992

hi Ravi,

i just want to know how we can create the User-exit using txn SMOD. Please sugest me can we create user-exit using txn SMOD or not? If yes then how we can create the User-exit using txn SMOD?

Read only

0 Likes
992

Hi,

Go to SMOD

Then enter the Enhancement name -


Then click on Components

now you can Find FUNCTION MODULE

Click on apprpiate Function module

THen double click on ZX---- Include

Now you write your logic there.

You can go my previous post to know the code.

<b>Reward points</b>

Regards

Read only

0 Likes
992

hi,

thanks for reply but i wanna create my own enhancement then how can i create using txn SMOD. If there is any other way then plz tell me.

Regards

Sushant

Read only

0 Likes
992

Hi,

No you can not. User exits are embeded in to Standard SAP programs in such a way, that you don't have to touch the standard code. Implementing your own would force you to change standard SAP code, and if you are going to do that, you might as well just make your changes directly. Of course this is not the desirable way to go. But to summarize, you can not create your own custom user exits.

<b>Reward points</b>

Regards

If your query got solution plz award some points

Read only

0 Likes
992

Hi all,

thanks for reply just run the transaction SMOD and check the enhancement ZPPMES01 . It is not created by SAP. Just i want to know how it created.Please suggest me thanks in advance.

Regards

Sushant