Skip to Content

Make EKKO-ZTERM non editable in ME21N ME22N

Hi experts,

is it possible to make non-editable field EKKO-ZTERM in ME21N and ME22N depending on a condition? I'm triing to do it in IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER but I don't know how.

thanks in advance,


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on May 21 at 10:12 AM


    instead try method PROCESS_HEADER

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21 at 10:13 AM

    Hi Maria Merino

    I read the BADI documentation and debugged a bit and here is what I found out.

    In the FIELDSELECTION_HEADER method of the BADI you need to assign the field ID and display option:

    • '-' Field is suppressed
    • '*' Field is purely a display field
    • '.' Input field
    • '+' Mandatory field

    You can find the field IDs in the type pool MMMFD.

    In the method of your the BADI code should look something like this.

      ls_field_selection TYPE mmpur_fs.
      ls_field_selection-metafield = mmmfd_pmnttrms.
      ls_field_selection-fieldstatus = '*'. " display
      INSERT ls_field_selection INTO TABLE ch_fieldselection

    However, the issue is that this method is called only if there is a custom field on one of the tabs of the header screen (custom fields tab). You can see this in function MEPOBADI_FS_HEADER.

    The MMMFD_CUST_01 is defined as follows.

    The method is commented as a firewall, as it's supposed to prevent from changing standard fields' attributes, but once you get the BADI method to be called, the logic I showed works. The filtering part does not prevent from anything, except the BADI method being called.

    To add this custom screen with custom fields you need to implement BADI ME_GUI_PO_CUST and in that BADI add new screen to the transaction.

    You can check examples prepared by SAP, both for ME_GUI_PO_CUST and ME_PROCESS_PO_CUST BADIs:



    Hope this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi

      Another way would be to dynamically select a screen variant prepared beforehand (with the field disabled).


      IF condition = abap_true.
        ch_key0 = 'SOME_SCREEN_VARIANT_NAME'.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.