Gyan Factory

Gyan Factory
SAP Technical Project Support

Monday, December 28, 2015

Use of FIELD-SYMBOLS when there is no option to set/change value in EXIT

Let’s say you have a requirement to update the KNA1-AUFSD (Order Block) whenever any customer created.

You have customer exit (function) EXIT_SAPMF02D_001.
But here we have KNA1 in the IMPORTING parameter only not in TABLES or CHANGING.



So in this case we can use field-symbols like below:

FIELD-SYMBOLS<AUFSD> TYPE ANY.

DATAKNA1_AUFSD(20VALUE '(SAPMF02D)KNA1-AUFSD'.

* Write your condition here.

IF SY-TCODE+2(2) = '01'.
  ASSIGN (KNA1_AUFSDTO <AUFSD>.
  <AUFSD> '01'.
ENDIF.

Saturday, 13 July 2013

Customer Exit find - process 2


Tricks to find Customer Exits: Process 2
    • Find the package name inside which the t-code or the program created. 
    ( Go to the T-Code for which you want to find the customer exit. 
      Go to the program name.    
      From menu, Goto - Object Directory Entry - copy the Package name).

    • Go to T-Code SMOD and go for F4 Help in the field Enhancement and put the Package name and enter.
    You will find the Exit Names / Enhancement Nos. under the package.











      Implement the Customer Exit: 
      • Go to T-Code CMOD
      • Create a Z<ANY PROJECT-NAME>.
      • Enter the enhancement assignment (Enhancement No.) and press enter.
      • Go into Component - Function Exit - Z<include> - Write your custom code. 

      Customer Exit find and implement - process 1


      Tricks to find Customer Exits: Process 1
      • Go into the program against the transaction code, you want to find any customer exit.
      • Find the string – call customer-function. You will find the CALL CUSTOMER-FUNCTION '***' .


       
      • Double click on the three digit number '***'. You will be redirected inside the function module.












      • Now find the Enhancement No./ SAP extension name from the table MODSAP with entering the function module name.

      Implement the Customer Exit:

      • Go to T-Code CMOD
      • Create a Z<ANY PROJECT-NAME>.
      • Enter the enhancement assignment (Enhancement No.) and press enter.
      • Go into Component - Function Exit - Z<include> - Write your custom code. 

      Characteristics of Customer Exit and advance than User Exit


      Due to the disadvantages that SAP faced in the user exits (data can be interpreted erroneously), SAP introduced the concept of Customer Exits.


      • The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
      • CUSTOMER EXITS are FUNCTIONS basically function modules, so they are called using CALL FUNCTION (or more exactly CALL CUSTOMER FUNCTION).
      • Inside the function module (customer exit) you can only access your import/export/changing/tables parameters.
      • Customer exits are more restrictive ensuring you in changing/using of any parameter of the FM, will never lead to inconsistency.
      • In Customer-exit no access key is needed.
      Also since the custom coding done as part of these customer-exits is located away from the original SAP code, the maintenance is easier than user-exits.

      No comments:

      Post a Comment