GoodleAds

ENHANCEMENT - USER EXITS

ENHANCEMENT
1.      Enhancement is a concept by which we can add our custom code to standard SAP software without modifying it .
2.      Each enhancement point = Exit point.
USER EXITS.
 User exits are sub routines where we can write our additional code to enhance the applications.
User exits are also called as Modifications.
User exits start with 
  i.e  “USER EXIT_”
Example:
PERFORM USEREXIT_BATCH_QUAN_ALLOCATION.
FORM USEREXIT_BATCH_QUAN_ALLOCATION.
ENDFORM.

For using user exits we need an access key, so that’s when we call user exits as Modifications.
Access key will be provided by Basis Team; once we got the access key we can add our piece of code.
The disadvantage of user exits is when we upgrade our software from older version to new version our logic will be vanished because user exits won’t start with Z or Y.
So SAP over writes the user exits while upgrading because,
User exits start with userexit_, not with Zuserexits or Yuserexits

Customer exits are the up gradation of user exits.


EXAMPLE ON USER EXITS
We need to raise an error message when ever Description is not entered by the end user while creation / changing of Sales order.
TABLES:  VBAK-HEADER, VBAP-ITEM
FIELD NAME:  ARKTX (DESCRIPTION) IN VBAP TABLE.
STEP 1: NEED TO GO T CODE SE93.
STEP 2: GIVE THE TRANSACTION CODE VA01



CLICK ON DISPLAY BUTTON

STEP 3:  PROGRAM NAME WILL BE DISPLAYED

NOTE DOWN THE PROGRAM NAME AND JUST DOBULE CLICK ON IT TO CONTINUE

STEP 4:   CLICK ON FIND OPTION (CTRL+F) GIVE USEREXIT IN FIND COLUMN AND SELECT AS STRING RADIO BUTTON,
              AND WE MUST SELECT IN MAIN PROGRAM RADIO BUTTON AND CLICK ON ENTER.


AGAIN DOUBLE CLICK ON PROGRAM NAME AND REPEAT THE ABOVE OPTIONS UNTILL WE GET THE USER EXITS.


HERE WE NEED TO DECIDE OUR APPROPRIATE USER EXITS AS PER OUR BUSINESS REQUIREMENT BY PUTTING BREAK POINTS .
AS PER OUR REQUIREMENT THE USER EXIT IS –


JUST DOUBLE CLICK ON PERFORM USEREXIT_SAVE_DOCUMENT_PREPARE TO GET FORM



SO PLACE A BREAK POINT IN FORM USEREXIT_SAVE_DOCUMENT_PREPARE


AND GO TO TRANSACTION CODE VA02 (CHANGE SALES ORDER)  AND GIVE ONE SALES ORDER NUMBER




PRESS ENTER TO CONTINUE




NOW JUST DELETE THE DESCRIPTION AND TRY TO SAVE IT.


WHEN WE CLICK ON SAVE BUTTON OUR BREAK POINT WILL BE TRIGGER.

SO IT IS THE RIGHT PLACE TO WRITE OUR PIECE OF CODE AS PER REQUIREMENT JUST GO TO OUR FORM  USEREXIT_SAVE_DOCUMENT_PREPARE AND CLICK ON DISPLAY  TO CHANGE OPTION AND WRITE THE LOGIC…
FOR USER EXITS WE NEED ACCESS KEY THE BASIS TEAM WILL PROVIDE, SO WHEN WE GOT THE KEY WE CAN WRITE THE LOGIC.

AS PER OUR REQUIREMENT THE LOGIC IS
FORM userexit_save_document_prepare.
IF vbap-arktx IS INITIAL.
MESSAGE 'REQUIRED DESCRIPTION' TYPE 'E'.
ENDIF.
ENDFORM.












                            

No comments:

Post a Comment