Skip to Content
Author's profile photo Jayesh Mudaliar

Creating Custom Fields in ME31K , ME32K , ME33K

Custom Fields in ME31K , ME32K , ME33K

As we know the enhancement to the screen is not impossible but it is not supported because we need some S_DEVELOP authorisation and modify some of the Standard table with z fields .That why please consider this document only if water is above your head and is a critical requirement of client

1) Create a Project using CMOD Tcode.

2) Give the enhancement name MM06E005.

3) Go to component Tab.

4) go to SAPMM06E                       0201 (This is for Header if you want to add tab on Header)

go to layout and design the screen according to your requirement



It seems you have created your screen. Now go back to PBO and create a module with any name I name it as PBO so as to remove any confusion as described below. Just double click to create it will ask you to create with some name like this ZXM06O01 or whatever just press enter to create save it in your request.

Now we are reaching towards the conclusion as we are going to play with the data we are going to insert in our fields.


First of all in the first screen you will see    EXIT_SAPMM06E_006 double click on that you will find

INCLUDE ZXM06U36-> double click on that->it will ask to create and save it in your request. This is the first exit which is executed so we will export our values from there. After implementing this exit just put a hard break point and for testing execute me33k with->enter agreement number -> execute.

Click on Header our breakpoint will be triggered. This indicates everything is fine (ALL IS WELL).See the below screen the Yellow field is our custom field. Now from here we will export our values so do like this


IF i_ekkozvat is NOT INITIAL.
FREE MEMORY ID ‘ZVAT’.
zvat
= i_ekkozvat.
EXPORT zvat to MEMORY id ‘ZVAT’ .
ENDIF.

IF i_ekkozdelivery is NOT INITIAL.
FREE MEMORY ID ‘ZDELIVERY’.
zdelivery
= i_ekkozdelivery.
EXPORT zdelivery to MEMORY id ‘ZDELIVERY’ .
ENDIF.

IF i_ekkoZFREIGHT is NOT INITIAL.
FREE MEMORY ID ‘ZFREIGHT’.
ZFREIGHT
= i_ekkoZFREIGHT.
EXPORT ZFREIGHT to MEMORY id ‘ZFREIGHT’ .
ENDIF.



In the above part you have exported the values but so as to store this values in table you need to go to the PBO which we have created.It will lead to ZXM06O01 which system has automatically created .

Now here we will manipulate our custom screen like storing the values in standard table or your z table. We will import the value which have been exported earlier.

IF sytcode EQ ‘ME21N’ OR sytcode EQ ‘ME22N’ OR sytcode EQ ‘ME23N’.

  

     DATA: zvat TYPE zvat.

     DATA: zdelivery(30) TYPE c.

     DATA: zfreight(50) TYPE c.

     DATA: i_trtyp .

     IMPORT zvat TO zvat FROM MEMORY ID ‘ZVAT’.

     IMPORT zdelivery TO zdelivery FROM MEMORY ID ‘ZDELIVERY’.

     IMPORT zfreight TO zfreight FROM MEMORY ID ‘ZFREIGHT’.

     IMPORT i_trtyp TO i_trtyp FROM MEMORY ID ‘I_TRTYP’.

     ekko_cizvat = zvat.

     ekko_cizdelivery = zdelivery.

     ekko_cizfreight = zfreight.

     IF i_trtyp = ‘A’.

**   if sy-tcode = ‘ME23N’ OR sy-tcode EQ ‘ME29N’..

       LOOP AT SCREEN.

         IF screengroup1 = ‘VAT’ OR screen–name = ‘EKKO_CI-ZVAT’.

           screeninput = 0.

         ENDIF.

         IF screengroup1 = ‘DEL’ OR screenname = ‘EKKO_CI-ZDELIVERY’.

           screeninput = 0.

         ENDIF.

         IF screengroup1 = ‘FRT’ OR screenname = ‘EKKO_CI-ZFREIGHT’..

           screeninput = 0.

         ENDIF.

         MODIFY SCREEN.

       ENDLOOP.

**  endif.

     ENDIF.

     IF i_trtyp <> ‘A’.

**   if sy-tcode = ‘ME23N’ OR sy-tcode EQ ‘ME29N’..

       LOOP AT SCREEN.

         IF screengroup1 = ‘VAT’ OR screenname = ‘EKKO_CI-ZVAT’.

           screeninput = 1.

         ENDIF.

         IF screengroup1 = ‘DEL’ OR screenname = ‘EKKO_CI-ZDELIVERY’.

           screeninput = 1.

         ENDIF.

         IF screengroup1 = ‘FRT’ OR screenname = ‘EKKO_CI-ZFREIGHT’..

           screeninput = 1.

         ENDIF.

         MODIFY SCREEN.

       ENDLOOP.

**  endif.

     ENDIF.

   ENDIF.

Now as per the document everything has been explained regarding storing and retrieving the values from fields. You might have noticed that I have used the zvat field in ekko_ci which is the standard. For doing this you will require S_DEVELOP Authorization to append standard table with your Z feild so consult your basis team soon you get authorization do like this go to se11-> ekko ->scroll down to find CI_EKKODB structure for more explanation find the screen shot

double click on this CI_EKKODB it will ask you to create the structure -> click on yes button ->the following screen will be displayed.

now create the z data element  for your fields and enter it save it and activate it.

Now you are ready with the custom fields in Header and your standard table will look like this.

Enjoy SAP

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Satya Tiwari
      Satya Tiwari

      Could someone tell me what is the difference between the  ""validity start  , "valididy end" in Header data and  "validity on" , "validity to" in Item condition (PB0) .

      Basically i am not getting for what header data is and from where its fetching ""validity start  , "valididy end"  , its not same as "validity on" , "validity to" in Item condition (PB0) .

      Author's profile photo SRIRAM KOMPELL
      SRIRAM KOMPELL

      Hi Jayesh,

      Nice blog. Thanks.

      i would like to know is it possible to enhance the Item screen of Purchase Contract.

      i tried it but i could see no exit has given by SAP for this requirement. In this case,

      the only way is to modify the existing screen which is not recommendable.

      Any ideas/thoughts from your side pertaining to this.

      Regards

      Sri Ram