100% found this document useful (3 votes)
8K views60 pages

Badi Interview Questions

The document discusses BADIs in SAP, which allow customizing standard programs without modifying code. It describes how to create a BADI definition and implementation using transaction codes SE18 and SE19. BADIs can have single or multiple implementations. Sequence of multiple implementations can be controlled via sorting or filter values. The document also compares classic and kernel BADIs.

Uploaded by

Bharat Bhushan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
8K views60 pages

Badi Interview Questions

The document discusses BADIs in SAP, which allow customizing standard programs without modifying code. It describes how to create a BADI definition and implementation using transaction codes SE18 and SE19. BADIs can have single or multiple implementations. Sequence of multiple implementations can be controlled via sorting or filter values. The document also compares classic and kernel BADIs.

Uploaded by

Bharat Bhushan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 60

BADI (Business Add-in)

 BADI is another way of implementing enhancements to the standard programs without


modifying the original code.
 BADI’s are implemented using oo programming technique. Technically a BADI is nothing but
an interface.
 Each BADI consists of the method without implementation called as BADI definition.
 We need to create classes to write the abap code by implementing the methods called as
BADI implementation.

SE18 is the T-code for BADI definition, 

SE19 is the T-code for BADI implementation.

Advantages of BADI

 The main advantage of using BADI’s is , we can create multiple implementations for a single
BADI definition.
 Where as with the exits, we can create a single implementation .i.e a single project for a
enhancement.
 We cannot create another project (implementation) for enhancement which is already used.
That is why we go for BADI’s.

Types of BADI

 Single implementation BADI.


 Multiple implementation BADI.
 Filter BADI.
 Custom BADI (Not used/Rarely used)

Single implementation BADI:- A BADI which has only one implementation (single class) is called
single implementation BADI.

Multiple implementation BADI:- A BADI which has multiple implementations is called multiple
implementation BADI. By default all the implementations will be executed.

How to control the sequence of multiple


implementation badi?
This is a self help Blog showcasing how to achieve sequence order for classic BADI
Implementation’s. The Sequence of implementations can be achieved using 2 approach
in case of classic BADI’s.  The second approach has some restriction

Unrestricted
Approach 1 via Sort Technique

Ok here I have a Classic BADI ZDEMO_CLASSIC_BADI and an corresponding


Interface ZIF_EX_DEMO_CLASSIC_BADI

Unrestricted
Implementation 1

Implementation 2

Unrestricted
Implementation 3

There are 3 Implementations for the BADI. Lets try giving a implementation sequence
via Sort.

To Sort, click Utilities -> Sort

Unrestricted
If asked provide an Transport Request. That’s all !

Ok now the sorting criteria is available for multiple Implementations. Check as shown
below.

Unrestricted
Implement the sorting order. Enter a sorting value in the implementation, save and
activate.

Unrestricted
Ok lets do a quick test to verify the implementation sorting order.

Unrestricted
After report execution, we see the implementation order sequence

Approach 2 via Filter values

The sorting can be achieved also via using Filter Type.

Unrestricted
2 Options :

1) For a custom BADI, no issues.

2) For standard BADI, check if the filter values are enhanceable. If yes, you can add a
new value to the value table of the Filter Type Data Element/Domain by calling the
respective implementation. For more info, press F1 on the field enhanceable.

Create a filter for the BADI ZBADI_WITH_FILTER.

I have created a Data Element ZORDER_SEQUENCE (CHAR10) and used in in the


Filter Type

Unrestricted
BADI ZDEMO_CLASSIC_BADI with filter type ZORDER_SEQUENCE

Unrestricted
Save the BADI.

Ok lets move to the Implementation part. We have 3 implementations.

Unrestricted
Unrestricted
Unrestricted
Time for a quick test.

Unrestricted
Result

So we can use the two approach’s with a careful considerations for the BADI
implementations order sequence. Hope this was helpful.

Unrestricted
Filter BADI It is type of BADI which has a filter value so that only those implementations which
satisfy the filter value are executed. The remaining implementations are not executed this type of
BADI is called a filter BADI.

Properties of BADI

 If WITH IN SAP checkbox is selected then this BADI is only used by sap.
 If multiple use checkbox is selected then it is a multiple implementation BADI.
 If multiple use checkbox is not selected then it is a single implementation BADI.
 If filter dependent checkbox is selected then it is filter dependent BADI. We need to specify
the filter type such as land1,bukrs, werks for the filter BADI.

Creating an Enhancement Spot


The enhancement spots are used to manage explicit enhancement options. It is the container in which
you develop your BAdI
The first thing you need to create a (simple) enhancement spot. This is the container in which you
develop your BAdI.
1) Go to tcode se18 and select radio button “Enhancement spot “ and give your enhancement
spot name as given below and click on create button.

Unrestricted
  2.  Enter a name and a short text description for the enhancement spot.

Creating a BAdI
  1.  To create a BAdI within the new enhancement spot, choose the Create BAdI pushbutton on the left,
as shown in the figure below:

 
  2.  In the dialog window that appears, enter the BAdI name z_badi_calc_vat and a short description.
You now have a BAdI in your enhancement spot.
  3.  Deselect the Multiple Use option because for the current calculation you need a single-use BAdI:

The BAdI Interface


Up to now, you still do not have a BAdI. You need an interface where you can define the methods which
determine what you can do with your BAdI.
  1.  Choose the arrow in front of the BAdI name.

Unrestricted
  2.  Double-click on the Interface icon.
Enter a name for the interface. You can choose an existing name or create a new one.

  3.  Choose the Change pushbutton.
This leads you to the Class Builder where you can create the methods you need for your BAdI. You
simply need to type in the name of the method get_vat and enter the parameters you need.

A BAdI interface has to implement the interface if_badi_interface. But if you create a


BAdI interface in the way shown above, this marker interface is already integrated in the
BAdI interface.

  4.  Determine the parameters of the method:

  5.  Save and activate the interface and the spot.


By completing the steps above, you have created an enhancement spot and a BAdI with an interface.
The interface has one method so far.

Unrestricted
However, just building a BAdI is not enough as it does not do anything. You need a BAdI instance and
this instance must be called somewhere in the code. Since the BAdI only defines an interface, you need
a class that implements this interface.

A BAdI definition is the place to insert an object plug-in that does something at runtime.
You still need an object that is plugged in to get something done.

Writing the Source Code


Now you need to write some ABAP code to use the BAdI. You need a variable that can refer to the BAdI
and some variables that are given as actual parameters to the BAdI method.
Next, you need to create a handle for that BAdI and call the BAdI method get_vat. The respective
commands are GET BADI and CALL BADI.
DATA: handle TYPE REF TO z_badi_calc_vat,
sum TYPE p,
vat TYPE p,
percent TYPE p.
sum = 50.
GET BADI handle.
CALL BADI handle->get_vats
EXPORTING im_amount = sum
IMPORTING ex_amount_vat = vat
    ex_percent_vat = percent.
WRITE: 'percentage:', percent, 'VAT:', vat.

A Fallback Class
If you run the program at this stage, it dumps. This is because it is mandatory to have exactly one active
implementation for a single-use BAdI. You can handle this error by catching the respective exception
cx_badi_not_implemented.
The better solution is to use a fallback class. This class is used if there is no active BAdI implementation.
The GET BADI command returns a handle to an instance of the fallback class and the respective CALL
BADI calls the methods of the fallback class instance. As soon as there is an active BAdI implementation,
the fallback class is no longer used at runtime.
Using a fallback class serves two functions at once:
●  The program runs with a single-use BAdI without throwing an exception.
●  It is guaranteed that the fallback class is not used any more as soon as a BAdI implementation is
supplied. The fallback class is selected conditionally. This is important because in most cases the
BAdI provider does not know the details of some process. This is why a BAdI is used.
To add a fallback class, proceed as follows:
  1.  Select the “Call fallback class if no implementation is executed” option and enter a name for the
class:

Unrestricted
  2.  Choose Change to go back to the Class Builder.
The respective method of the BAdI interface is already automatically defined. You only have to
implement it:
DATA: percent TYPE p VALUE 20.
ex_amount_vat = im_amount * percent / 100.
ex_percent_vat = percent.
  3.  Save and activate the class.
  4.  Navigate back to the enhancement spot and activate it.
  5.  Run the program.
The result should be:
percentage: 20 VAT: 10.

Difference between Classic BADI and Kernel BADI ?

Classic BADI’s is called by Proxy class cl_exithandler, Where Kernel BADI’s are called directly with the
reference to the BADI definition via GET BADI and CALL BADI statements.  That is one of the reasons why
Kernel BADI is 40-600 times faster than classic BADI.

In classic BAdIs, a BAdI object is created by calling a factory method, and referenced via a reference
variable of the type of the BAdI interface.ss

In Kernel BAdIs, a BAdI object is created via the ABAP statement GET BADI as a handle for the calls of
BAdI methods, and referenced via a reference variable of the type of the BAdI.

A classic BAdI can be called only once and the call positions are registered centrally.

In Kernel BAdIs, multiple calls are possible and the call positions are not registered centrally.

1.Kernel(New) BADIs are always assigned to an enhancement spot in SE18

Unrestricted
2. in Kernel BADI object is created with the GET BADI statement while In Classic BADI object is created by
calling factory method.

3. In New(Kernel) BADis multiple calls are possible but in classic BADIs multiple calls are not possible.

Classical BADI's called through CL_EXIT_HANDLER.


Kernel BADI'S called through GET BADI and CALL BADI

Question 27: How do you find BADI?


Approach1: 
Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in method GET_INSTANCE. Now go and
execute your transaction code for which you want to find BADI.
You will find the BADI in the changing parameter exit_name:

Approach 2:
Go to Tcode SE84-> Enhancements ->BADIs -> Definitions.
Find the package for the Tcode for which you are finding the BADI.
Enter it as shown and hit execute:

Unrestricted
Business Add-ins - Filter BADI - Application for displaying
customer data based on filter value - Country code
Skip to end of metadata


 Attachments:16
 Added by Harsh Dave, last edited by Harsh Dave on Jun 08, 2009  (view change)

Unrestricted
 show comment
Go to start of metadata

Business Add-ins (BADI) → Filter BADI

→ What is a Filter-BADI?

Filter dependence for BADI definitions means that each interface method automatically has an importing parameter
FLT_VAL assigned to it. This parameter must be filled with a filter value as current parameter when it is called

How to define a Filter-BADI and then implement it?

We encounter a business requirement where different country clients (customers) may have different country specific
applications. These applications can be integrated centrally in one standard application by means of a 'Filter'.

Here we consider a scenario for three country specific application (say) for India (IN), USA (US) and Germany (DE)
respectively. 

→ Note: Here the scenario will be dealt with a BADI created under customer name space for easy understanding. 

→ To enable a BADI to allow 'Filter' implementations, make the BADI filter dependent. In case of a standard BADI it should
be inbuilt 'Filter dependent'.

→ As usual create an interface method,

Unrestricted
→ Create interface parameters. Here 'FLT_VAL' indicates the parameter which will act as a filter,

→ Create an implementation for (say) filter value 'INDIA' that is 'IN'.

Unrestricted
→ Navigate inside the method to write the code,

Unrestricted
→ Observe the code for filter value 'INDIA',
methodzif_ex_dave_badi_filter~zdave_method_country.

  data:

    begin of fs_kna1,

     kunnr type kunnr,

     land1 type land1,

     name1 type name1,

     ort01 type ort01,

     pstlz type pstlz,

     regio type regio,

     stras type stras,

    end of fs_kna1.

  data:

      t_kna1 like

    standard table

          of fs_kna1.

    select kunnr

Unrestricted
           land1

           name1

           ort01

           pstlz

           regio

           stras

      from kna1

      into table

           t_kna1

     where kunnr = customer

       and land1 = flt_val.

  If sy-subrc eq 0.

    write:/2   'Customer'(001) color 1,

           15  'India Ctry Key'(002) color 2,

           35  'Name'(003)     color 3,

           65  'City'(004)     color 4,

           80  'PO code'(005)  color 5,

           95  'Region'(006)   color 6,

           110'Street'(007)   color 7.

    skip.

    loop at t_kna1 into fs_kna1.

Unrestricted
      write:/2   fs_kna1-kunnr color 1inverse,

             15  fs_kna1-land1 color 2inverse,

             35  fs_kna1-name1 color 3inverse,

             65  fs_kna1-ort01 color 4inverse,

             80  fs_kna1-pstlz color 5inverse,

             95  fs_kna1-regio color 6inverse,

             110fs_kna1-stras color 7inverse.

    endloop.

  endif.

endmethod.

→ Now, create a filter implementation for country code 'US' that is USA,

Unrestricted
→ Navigate inside the filter method to code for the filter condition,

Unrestricted
→ Observe the code for filter implementation 'USA',
methodzif_ex_dave_badi_filter~zdave_method_country.

  data:

    begin of fs_kna1,

     kunnr type kunnr,

     land1 type land1,

     name1 type name1,

     sortl type sortl,

     telf1 type telf1,

     telfx type telfx,

     adrnr type adrnr,

    end of fs_kna1.

  data:

      t_kna1 like

    standard table

          of fs_kna1.

Unrestricted
  select kunnr

         land1

         name1

         sortl

         telf1

         telfx

         adrnr

    from kna1

    into table

         t_kna1

   where kunnr = customer

     and land1 = flt_val.

  write:/2   'Customer'(001)  color 1,

         15  'USA Ctry Key'(002)  color 2,

         35  'Name'(003)      color 3,

         65  'Sort Name'(004) color 4,

         80  'Tel no'(005)    color 5,

         95  'Fax no'(006)    color 6,

         110'Addr no'(007)   color 7.

  skip.

  loop at t_kna1 into fs_kna1.

Unrestricted
    write:/2   fs_kna1-kunnr color 1inverse,

           15  fs_kna1-land1 color 2inverse,

           35  fs_kna1-name1 color 3inverse,

           65  fs_kna1-sortl color 4inverse,

           80  fs_kna1-telf1 color 5inverse,

           95  fs_kna1-telfx color 6inverse,

           110fs_kna1-adrnr color 7inverse.

  endloop.

endmethod.

→ Create an implementation for (say) filter value 'GERMANY' that is 'DE'.

Unrestricted
→ Navigate inside the method to write the code,

Unrestricted
→ Observe the code for filter implementation 'DE',
methodzif_ex_dave_badi_filter~zdave_method_country.

  data:

    begin of fs_kna1,

     kunnr type kunnr,

     land1 type land1,

     name1 type name1,

     anred type anred,

     erdat type erdat,

     ktokd type ktokd,

     lifnr type lifnr,

    end of fs_kna1.

  data:

       t_kna1 like standard table of fs_kna1.

  select kunnr

Unrestricted
         land1

         name1

         anred

         erdat

         ktokd

         lifnr

    from kna1

    into table

         t_kna1

   where kunnr = customer

     and land1 = flt_val.

  write:/2   'Customer'(001)    color 1,

         15  'DE Ctry Key'(002) color 2,

         35  'Name'(003)        color 3,

         65  'Title'(004)       color 4,

         80  'Created on'(005)  color 5,

         95  'Acct grp'(006)    color 6,

         110'Vendor'(007)      color 7.

  skip.

  loop at t_kna1 into fs_kna1.

    write:/2   fs_kna1-kunnr color 1inverse,

           15  fs_kna1-land1 color 2inverse,

Unrestricted
           35  fs_kna1-name1 color 3inverse,

           65  fs_kna1-anred color 4inverse,

           80  fs_kna1-erdat color 5inverse,

           95  fs_kna1-ktokd color 6inverse,

           110 fs_kna1-lifnr color 7inverse.

  endloop.

endmethod.

→ Now its time to call the enhancements in the customer application,

→ Now, execute the application (here report) and test the customer enhancement,

→ Test case I - Country code 'INDIA' (IN),

Unrestricted
→ Execute the test data and observe the functionality,\/]

→ Test case II - Country code 'USA' (US),

→ Execute the test data and observe the functionality,

→ Test case III - Country code 'Germany' (DE)

Unrestricted
→ Execute the test data and observe the functionality,

free and refresh in internal table


 You can use FREE to initialize an internal table (along with header line ) and release its memory space.
 REFRESH will only initialize an internal table (along with header line).

 If <itab> is not having header line, this will clear the entire contents.
CLEAR <itab>.
 If <itab> is having header line, this statement will just clear the contents of header line.
CLEAR <itab>[]

There are two types of Explicit Enhancement options available. For this, we now have two new ABAP
statements, viz.

1.Enhancement point (Syntax -ENHANCEMENT-POINT)


2. Enhancement section (Syntax - ENHANCEMENT-SECTION)

Enhancement point and Enhancement Section

Unrestricted
Enhancement point: It allow you to add your own source code without modifying original source code in
some predefined places.

Enhancement section: It is used to replace a set of code or statements with the customer (custom
code). In this technique the original source code does not get executed but, the customer implementation
(custom code) gets executed.

Adding Explicit Enhancement to custom program


Introduction:

Enhancement Framework is the new paradigm where all enhancement techniques are under one roof. It
can also be switched using Switch Framework. The following are different enhancement technologies
available under this framework.

• Source Code Enhancement : Implicit and explicit enhancement options

• Function Group Enhancement

• Class Enhancement

• Kernel-BADI Enhancement

Unrestricted
Source Code enhancement

Whenever enhancement needs to be incorporated directly into the ABAP source code, this technology
shall be provided. Implementing this technology is also called as Source Code Plug-In. There are two
types of Source Code enhancements possible.

• Implicit enhancement option:

Implicit enhancements are predefined enhancements provided by SAP in the source code.

• Explicit enhancement option

The explicit enhancements can be implemented by the customers or partners.

There are two types of Explicit Enhancement options available. For this, we now have two new ABAP
statements, viz.

1. Enhancement point (Syntax - ENHANCEMENT-POINT)


2. Enhancement section (Syntax - ENHANCEMENT-SECTION)

Enhancement section is used to replace a set of code or statements with the customer (custom code). In
this technique the original source code does not get executed but, the customer implementation (custom
code) gets executed.

Note - Explicit enhancements though can be placed anywhere in the source code but, not just anywhere
except some areas where SAP would allow (program allows). They are called explicit because their
position in the standard code is defined explicitly. On the other hand, we have implicit enhancements
whose position is implicit i.e. at the beginning and end of programs.

STEP 1: Create a package in transaction SE80 (Object navigator) Name YDEV

Unrestricted
STEP 2: Navigate to 'Enhancements' folder of your package. Package (YDEV) Enhancement.

   Right click the 'Enhancements'  'Create'  'Enhancement Spot'.

Fill in the details in the 'Create Enhancement Spot' dialog.

And save it into created package. Observe the enhancement spot created under the 'Enhancement
Spots' folder.

Unrestricted
STEP 3:  'Right Click' the spot created and 'Implement' it (Create an Implementation).

Unrestricted
Fill in all the details in the 'Create Enhancement Implementation' dialog.

STEP 4: Now, we need to 'Activate' the enhancement spot. In addition with the Enhancement spot the
'Enhancement Implementation' will get activated.

Unrestricted
STEP 5:  Here we are applying enhancements to a CUSTOM program not a standard program to
demonstrate the functionality. So we create a simple program 'YDEV_CODE' (say) it is retrieving records
from the database table 'VBAK' (Sales Document Header) and displaying a few records.

Now, if the customer wants to replace the set of logic with his own logic (say) like retrieving records from
database table 'VBAP' (Sales Document Item) and then display a few records, he/she will create an
enhancement section which goes like,

Create a program YDEV_CODE.  

Unrestricted
OUTPUT

Unrestricted
STEP 6: Right click the area which is appropriate to apply the enhancement

Note - Explicit enhancements though can be placed anywhere in the source code but, not just anywhere
except some areas where SAP would allow (program allows). 

Unrestricted
Now, in the 'Create Enhancement Option' fill in the details, here fill the name under 'Enhancement-
section' only. Then fill in the Enhancement Spot Implementation Name which we created earlier.

Unrestricted
Now we are able to see program lines have Enhancement-Section…End Enhancement-Section.

Note - Make sure that the code which has to be replaced is within the 'ENHANCEMENT-SECTION...' and
'END-ENHANCEMENT-SECTION'.

Unrestricted
TEP 7: Now to include the custom code in the program which will replace the original code, enable the
'Enhancement Mode' by clicking on the 'Spiral' button.

Place the cursor on the 'Enhancement-section' and navigate to 'Edit'  'Enhancement


Operations'  'Create Implementation'.

Fill in the details for the 'Create Enhancement Implementation' dialog. Click on 'Create' button for the
'Select or Create Enhancement Implementation' dialog.

Unrestricted
STEP 8: Now, write the code within the 'ENHANCEMENT' and 'ENDENHANCEMENT' statements as the
replacement code.

Unrestricted
STEP 9:  Don't forget to 'Activate' the enhancement   Switch the 'Enhancement' mode OFF and
'Activate' the entire program.

Unrestricted
STEP 10: Execute the transaction/program to find out the difference.

Before Enhancement:

  

After Enhancement:

Unrestricted
Summary:

1.     Here we deals with the enhancement of a 'Z' program it is possible to 'CREATE' an


'ENHANCEMENT-SECTION'. But, in case of a 'STANDARD SAP' program there are certain
places (provided by SAP) like 'ENHANCEMENT-POINT...' and 'ENHANCEMENT-SECTION...'
where we can create implementations based on customer’s business functionality.

2.     There can be only one and only one 'ACTIVE' implementation for an 'ENHANCEMENT-
SECTION'.

Source Code:

*&---------------------------------------------------------------------*
*& Report  YDEV_CODE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  YDEV_CODE.
TABLES : VBAK, VBAP.
DATA : IT_VBAK TYPE STANDARD TABLE OF VBAK INITIAL SIZE 0,
       WA_VBAK TYPE VBAK,
       IT_VBAP TYPE STANDARD TABLE OF VBAP INITIAL SIZE 0,
       WA_VBAP TYPE VBAP.

INITIALIZATION.
  REFRESH : IT_VBAK,

Unrestricted
            IT_VBAP.
  CLEAR : WA_VBAK,
          WA_VBAP.

START-OF-SELECTION.
ENHANCEMENT-SECTION YDEV_ENHANCE_SECTION SPOTS YDEV_IMPLEMENT_SPOT .
SELECT *
    FROM VBAP
    INTO TABLE IT_VBAP[]
    UP TO 15 ROWS.

  WRITE: /02 'Sales Document',
          20 'Date',
          40 'Time',
          65 'Name of Person'.
ULINE .
  IF IT_VBAP[] IS NOT INITIAL.
    LOOP AT IT_VBAP INTO WA_VBAP.
      WRITE: /02 WA_VBAP-VBELN,
              20 WA_VBAP-POSNR,
              40 WA_VBAP-MATNR,
              65 WA_VBAP-MATWA.
    ENDLOOP.
  ENDIF.
END-ENHANCEMENT-SECTION.
*$*$-Start: YDEV_ENHANCE_SECTION----------------------------------------------------------------$*$*
ENHANCEMENT 1  YDEV_IMPLEMENT_ENHC_SECTION.    "active version
SELECT *
    FROM VBAP
    INTO TABLE IT_VBAP[]
    UP TO 10 ROWS.

  WRITE: /02 'Sales Document',
          20 'Sales Item',
          40 'Material Number',
          65 'Material entered'.
ULINE .
  IF IT_VBAP[] IS NOT INITIAL.
    LOOP AT IT_VBAP INTO WA_VBAP.
      WRITE: /02 WA_VBAP-VBELN,
              20 WA_VBAP-POSNR,
              40 WA_VBAP-MATNR,
              65 WA_VBAP-MATWA.
    ENDLOOP.
  ENDIF.
ENDENHANCEMENT.
*$*$-End:   YDEV_ENHANCE_SECTION----------------------------------------------------------------$*$*

Unrestricted
 Difference between implicit enhancement option and explicit
enhancement option ?

 Implicit enhancement option: Implicit Enhancement options are automatically available at


certain pre-defined places. Some of the implicit options are:

• At the end of all the programs (Includes, Reports, Function pool, Module pool, etc.), after the last
statement

• At the beginning and end of all FORM subroutines

• At the end of all Function Modules

 We can not have Implicit enhancement option inside Module module in module pool program.
Please see below screen shot.

To view all the implicit options available in a source code, choose ‘Edit -> Enhancement Operations ->
Show Implicit Enhancement Options’ from the editor.

Steps to Implement the Implicit enhancement option:

Step1: Go to SE38 and Open include MV45AFZB

Step2: In order to implement any of these Source code enhancements, you need to be in ‘change
Enhancement mode’ (the spiral icon available in the editor).

Unrestricted
Step3: Go to EDIT option in the menu and choose Enhancement Operations -> Show
implicit Enhancement Options

All Implicit Enhancement option will be displayed. All yellow lines indicate Implicit
Enhancement options. In ABAP programs, implicit enhancement options are predefined
at the following places:

•Begin/End of an include.

•Begin/End of Method/Function Module/Form Routine

•End of a structure

Unrestricted
•End of Private/Protected/Public Section of a local class

Step4: Place the cursor on the yellow line and choose

Enhancement implementation  Create.

Step5: Give Implementation name and then create.

Unrestricted
Step6: Here Editor will be enabled to write the code. Write your own code save and
activate it.

Step 7:Once the development is completed you can test the scenario.

When Sales person (lzn4rm) tries to Open Sales order no 174, it gives error message ’Access Denied’.

Note: Sales order 174 is created by another sales person (lz8xzf).

Unrestricted
Explicit enhancement option: The explicit enhancements can be implemented by the customers or
partners.

There are two types of Explicit Enhancement options available. For this, we now have two new ABAP
statements, viz.

1. Enhancement point (Syntax-ENHANCEMENT-POINT)


2. Enhancement section (Syntax - ENHANCEMENT-SECTION)

Enhancement point: It allow you to add your own source code without modifying original source code in
some predefined places.

Enhancement section: It is used to replace a set of code or statements with the customer (custom
code). In this technique the original source code does not get executed but, the customer implementation
(custom code) gets executed.

end of page and top of page


 Top of page trigger when report encounter the first write, skip or new-line statements.
 End of page trigger when page size is over or report display gets over.

Unrestricted
Internal Session and External Session
 External session is nothing but the window you have opened in your screen .By Default you can open 6
external sessions ( 6 windows = you can increase it via basis’s setting). Internal session is created
when you call any Functional module or any other task in your program. counts for internal sessions
are 9.

Unrestricted

You might also like