Skip to Content
Author's profile photo Pranav Agrawal

Modification to Purchase Order Screen

INTRODUCTION: The document gives the details of the methods to enhance the screen in the purchase order considering example scenarios.

Modification to purchase order screen

Problem Statement: Consider a scenario, where there is a need to add field(s) in the purchase order header and to add the desired functionality there upon.

Analysis of problem Statement:  There is no direct way to add a field to any of the existing screens neither in header data screen nor in Item screen i.e. there are no enhancements provided for the existing tabs.

For example there is no enhancement to customize Org. Data Tab in ME21N.


Solution: First priority is to introduce a new field into the Purchase Order Header table and add functionality accordingly.

For this, what needs to be done is the addition of the field in Include structure CI_EKKODB  meant for enhancement in Purchase order header table (EKKO) The visual description for the same is shown in the below screenshot.

For this, we need to introduce a new field into the include standard structure of EKKO, ‘CI_EKKO’ same goes with EKPO as ‘CI_EKPO for purchase order item table.


As shown above,‘ZZTEST1’ is added into EKKO table.

The appending a field to Header table is done and next step is to add it to the purchase order screen.

To add any field to the purchase order screen (ME21N, ME22N, and ME23N) a custom tab needs to be created.



In the above screenshot “Customer Data” is the custom created Tab.

This can be achieved via enhancements or via BADI.

  • Method 1: SCREEN EXIT.
  • Method2: BADI.


Screen Exit Method:

Tech Specs:

Enhancement: MM06E005

Create project to implement this enhancement, activate this.


In the above screenshot i.e. in the screen exit screen no. 101, 111, 201, 211, 301, 311.

Basically, these are to add a new tab to header as well as item data part. The description for screen is provided in below two lines through which one can classify item and header level screens.

101, 201, 301-> Header Data New Tab

111, 211, 311-> Item Data New Tab

Here in Include Table you might be seeing two include structure i.e. CI_EKKODB, CI_EKPODB.

The structure I_EKKODB is for appending any additional fields to PO header table (EKKO).

The structure I_EKPODB is for appending any additional fields to PO Item table (EKPO).

Consider a scenario here requirement is to add a tab to header data, so we use 101 to achieve the equirement.

  1. Double click on screen ‘0101’ then it ill redirect to module pool program screen. Click on the layout and draw a field in the screen, the way it is depicted in the screen below, then activate the changes.


2. After activation a new tab in the screen will be created with name Customer data, as shown in the screenshot below.


3. In order to change the ‘Customer Data’ tab name to any custom tab name the below steps can be followed:

Go to Program: SAPLXM06 in SE38

Then goto->Text Element->Text Symbols

Make a new text symbol with the same number as of your screen number in layout of which you inserted a new field.

Say “IGTR” (Tab’s new name) -> activate.


4. After activating the name will be changed from ‘Customer Data to’ -> ‘IGTR’ or the custom name you gave in SAPLXM06.

As shown in example below.


Now it can be considered that most of the part of our requirement is done i.e. The screen is made so is the field in the screen.

Now, the next step is to make this field store and retrieve the values to and from the Purchase order header table (EKKO) as per the user actions. For this logic is to be written in the identified exit.


We use EXIT_SAPMM06E_012 is highlighted as this the exit can be used to fill the additional fields in PO header.


Can be seen in debugging mode the field(s) in the structure reflects i.e. the same fields that were added in PO header include Structure.


Let’s say we have set the additional field ZZTEST1 For which the value is being updated in purchase order header table (EKKO).


Now it is observed that we are done with the changes into the Header table.

Consider a PO in which the field is populated i.e. when a Purchase Order is opened in ME22N, ME23N it should reflect on screen.

The change has to be done in the PBO of the screen as well i.e. the screen’s layout in which the field(s) was/ were introduced. Just Retrieve the data based on your required condition and populate to the screen field as shown below:

* Fetching the Header data through Field Symbol

Note:  Case needs to be considered:

While creation of PO through ME21N, say we create one item in the PO and delete it.
Then ME21N screen re-opens (we are not opening new transaction) and the header data still remains with the additional field set.

So, if the item is created and deleted, header field still remains in the header which is not correct.

Steps: Check the PO item table i.e. EKPO i.e. if it contains the data, else clear the flag.



      CLEAR:  <screen-field>.

Note: The main draw back in this method of field addition is that the new tab can’t be controlled and will appear in all the PO’s once it is created.

The second method though the BADI overcomes this issue.

Method 2:



Primarily Create an instance say X through which the tab elements needs to be referred to the program i.e. as of type of work area bearing the structure of RE_SUBSCRIBERS table.

Then what needs to be check is the application i.e. whether it is PO, SO, Delivery via parameter IM_APPLICATION and current operating position of the program needs to be checked whether it is item or header level via IM_ELEMENT. 

There are various other parameters which need to assign via instance created i.e.

  • NAME, which deals with the tab name that will be displayed in ME21N, ME22Nand ME23N.
  • DYPRO, the screen number which it will refer to.
  • PROGRAM, the program name where the DYNPRO (screen) can be traced.
  • STRUCT_NAME, the structure to which the field has been appended i.e. in PO header or PO item level.
  • POSITION, the position of the tab among the existing tabs, the height of the screen can be defined here. Currently it supports two screen sizes i.e. when value <=7 a seven line sub screen, when it is >7, then a 16 line sub screen.


  • In Method1 i.e. through screen exit, the whole of the code will only work upon click on check button or save button.
    • However, to trigger the same logic before save or check ,we need to implement BADI ‘ME_PROCESS_PO_CUST’ and the method in which you need to write the same logic in method ‘PROCESS_ITEM’.
    • In Method 1 i.e. through screen exit we won’t be able to control the custom tab i.e. say IGTR (as it appears in screenshot on page 7), If this is required we should go for method 2. Through BADI ‘ME_GUI_PO_CUST’.

If specific requirement is not provided i.e. the Tab is not restricted to any particular order Type then I would recommend going with method 1 as in terms of complexity it is low and is easier as compared to the second method.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Dear Pranav,

      Its really a nice document. Keep sharing the good work.

      Best regards,


      Author's profile photo Former Member
      Former Member

      Hi Pranav,

      Its nice docs but when I am start adding second additional  tab in po item .I am unable to do it [ Doing with BADI - PO_GUI_SCREEN *].

      Please confirm how many tab allow by sap in PO item .



      Author's profile photo Pranav Agrawal
      Pranav Agrawal
      Blog Post Author

      Hi Alter,

      By the screen exit as I explained it will add only one tab to Purchase Order, both to header and item and by using ME_GUI_PO_CUST BADI you can add other tabs. I am not sure about the number, but I had added more than 4 tabs, you can validate at your end.


      Pranav Agrawal

      Author's profile photo Former Member
      Former Member

      Hi Pranav,

      Its good to see your reply .But my problem is when I have added new item details in subscribe method with add new screen , new program and new structure in PO item .

      System has accepted all input , BADI is executed successfully but at a time only one custom tab display . when I use same structure that used in previous custom tab both tabs are display .

      My point is why it is not accepted multiple structure with same program name .



      Author's profile photo Pranav Agrawal
      Pranav Agrawal
      Blog Post Author

      Hi Ravi,

      I am actually not able to recollect what you just said in the response above. The crux of what I understood and the response from my end on that is:

      You can add maximum of 9 custom fields that can be distributed among different tabs.

      The structure that you should use is CI_EKPODB, as that will help you to maintain data sync.

      I tried to display again four tabs and the tabs are appearing and expected and follow on operations are working as expected.

      Let me know what type of issues are being faced at your end. I will publish a doc on the same in some time.


      Pranav Agrawal

      Author's profile photo kumar kumar
      kumar kumar

      Dear Pranav, Good document.Thank u Regards Kumar

      Author's profile photo Manish Agrawal
      Manish Agrawal

      Hello Pranav,

      Is it allowed to add a new Z Column in Item Overview section?

      Somehow I remember it is not allowed as SAP will not support that Application then. Thus asking.


      Manish Agrawal

      Author's profile photo Former Member
      Former Member

      Thanks for useful document.


      Author's profile photo Renjith Michael
      Renjith Michael


      Thanks for sharing this very useful document.

      Author's profile photo Dnyandeo Sonje
      Dnyandeo Sonje

      Hi Pranav,

      i am changing  text symbol for item screen but it shows Customer data by default.

      how to change it??

      screen no 111.

      Thanks in advance.

      Author's profile photo Robert Cusolito
      Robert Cusolito

      To change the name of the new tab from 'Customer Data' to something else, you need to make the change in your own language.  If you've added a text, it likely will only be in the screen's original language (DE).  You need to use menu option Goto->Translate, and add a translation into your logon language.  After that, re-active screen SAPLXM06 0101 or 0102.