Showing posts with label SAP. Show all posts
Showing posts with label SAP. Show all posts

Friday, 2 November 2018

Welcome First Logon SAP



       Create Welcome in First Logon Using 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.













Visitor

Code Syntax Try...Endtry

  Code : Report Try. Parameters  NUMBER  type  I . data  RESULT  type  P  decimals  2 . data  OREF  type  ref  to  CX_ROOT . data  TEXT  typ...