SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Example code of using an enhancement SUSR0001



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Tue Jul 29, 2008 1:29 pm    Post subject: Example code of using an enhancement SUSR0001 Reply with quote

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

Code:
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.

Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.