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
852

hello friends

i need two userexit program with transaction code

in this program what we change with all programing code

kindly send to my mail

babasys12@rediffmail.com

4 REPLIES 4
Read only

Former Member
0 Likes
696

Hi,

Below is an user exit written to control duplicate entry of manual pricing conditions. This routine executes when user selects the pricing condition and presses enters. The code checks whether the condition already exists in the entered structure, if yes throws an error message. This routine is in the inlcude LV69AFZZ. This code executes in Sale Order as well as Purchase Order.

form userexit_pricing_check.

*{ INSERT WDEK903547 1

  • Changed by hema on 21.12.2006

  • Purpose : To control duplication of pricing condition.

data: fld(50) TYPE c,

val(50) TYPE c,

ln type i.

clear: fld, val, ln.

GET CURSOR FIELD fld VALUE val LINE ln.

if fld = 'KOMV-KSCHL'.

if val is not initial.

loop at xkomv where kschl = val.

message e904 with val.

endloop.

endif.

else.

if sy-pfkey <> 'KC'.

loop at xkomv.

if xkomv-zaeko = '01'.

if xkomv-zaehk <> komv-zaehk and xkomv-kschl = komv-kschl and komv-kschl is not initial.

message e904 with komv-kschl.

endif.

elseif xkomv-zaeko = '00'.

if sy-tabix <> ln and xkomv-kschl = komv-kschl and komv-kschl is not initial.

message e904 with komv-kschl.

endif.

endif.

endloop.

endif.

endif.

*} INSERT

endform. " USEREXIT_PRICING_CHECK

Hope the above example is understandable.

Regards,

Hema

Read only

Former Member
0 Likes
696

Hi

Pls refer below..

This example code is based on enhancement SUSR0001.This enhancement uses function exit EXIT_SAPLSUSF_001 .

Enhancement : SUSR0001 User Exit after logon to SAP system.

When the User logs in the system ,this exit is called each and every time for every user after logon to the R/3 system.

Function Exit : EXIT_SAPLSUSF_001 .

Every dialog user passes thrugh this function module after logon,It can be used to execute individual customer checks and send mesages to the user.

TABLE USR02 CONTAINS LOGON DATA and can be used in this exit to get the user logon data and take necessary actions as required by the customer requirement and even LOG_OFF (not recommended by SAP).

STEPS REQUIRED FOR IMPLEMETING THE EXIT

1) Open CMOD(Project maintenance) Transaction.Enter a project name starting with Z.Press enter.

2) Goto Enhancement window by clicking the enhancement button in the application tool bar.

3) Write SUSR0001 in the enhancement column and press enter.

4) Goto Components window(It will show al the exits included in this enhancement), in our case only one Function Exit will be shown.

5) Double click on the Function exit EXIT_SAPLSUSF_001.

The following function source code will be displayed in the function editor

FUNCTION EXIT_SAPLSUSF_001.

*"----


""Lokale Schnittstelle:

*"----


INCLUDE ZXUSRU01.

ENDFUNCTION.

6) Double click on the include ZXUSRU01 .If it will ask to create the include say yes .

7)Write the following code in the include.

DATA W_TEXT(30) TYPE C.

DATA W_DATE(10) TYPE C.

WRITE sy-datum TO W_DATE DD/MM/YYYY.

CONCATENATE ' Date is ' W_DATE INTO W_TEXT.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = 'Welcome to Paradise !'

txt1 = 'Have A Nice Day'

txt2 = W_TEXT

  • TXT3 = ' '

  • TXT4 = ' '

8)Save the include and activate it .Activate the Project also by going to the menu in CMOD transaction.Now The user exit SUSR0001 has been implemented and is ready to use.

9) Logon to the R/3 system . A dialog box will appear with the message

Welcome to Paradise ! with date .

NOTE: BAPIs like BAPI_USER_GET_DETAIL can also be used to get user info or directly read from tables USR02 etc.

PP User Exit .

This user exit is used in PP and is for u to try

MCP20020 User exit for reading info structure when transferring reqts

it contains function exit

EXIT_SAPMMCP6_020

When planned independent requirements are transferred from SOP to

program data, the data is read at material/plant level as standard. You

can use this user exit to have a greater or smaller number of

characteristics for data selection. In this case, the data is read on a

different level than that in the standard system.

The interface of this user exit corresponds to that of function module

'MC_PG_TRANSFER_PBED', but the info structure and the key fields table

(structure IKEYF) are also transferred. YF). The characteristic

attributes of the characteristics used for data must be transferred to

the user exit in field 'Value' of the key fields table.

For further information, see function module: 'MC_PG_TRANSFER_

For more information, check the following links:

User Exit

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

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

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.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

BADI

http://www.esnips.com/web/BAdI

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

please do reward if useful

regards

diinesh

Read only

Former Member
0 Likes
696