Hi,
In this post blog, I will show you how to change screen field properties and how to hide screen fields/tabs on purchase requisitions screens.(ME51N, ME52N, ME53N)
This blog post specifically will cover showing, hiding fields which can not be customized by using SPRO customizing settings.
In additional, it works on S/4HANA Cloud too.
In our example, I'll show you, hiding the fields which are 'Expected Value' and 'Overall Limit' fields.
Enhanced Limits = Screen Name.
We need to complete following steps;
- We will find metafield values.
- We will find out how values are named.
- We will create BAdI implementation.
First, we will find the metafield values of the fields on the screen. Metafield values are included in the
MMMFD Type Group.
MMMFD Simple Limits
Then we find out how the metafield values are named in the program from the
MAP_METAFIELD_TO_GFN method under the
CL_MM_PUR_S4_PR_FCNTRL_HELPER class.
Metafield Names
Then we implement
MM_PUR_S4_PR_FLDCNTRL_SIMPLE BAdI application. This BAdI
MM_PUR_S4_PR enhancement is located under the enhancement spot.
We implement MM_PUR_S4_PR_FLDCNTRL_SIMPLE BAdI that we need for the ME5*N screen.
Create Enhancement Implementation
Entering BAdI and class names then we choose our BAdI.
BAdI Implemantions
After that click Empty Class and continue.
Create Implement Class
Activate the incoming screen and continue by to the next screen.
Enhancement Implementation
Click the Adjust Enhancement Implementation and apply Interface Component.
Adjust Enhancement Implementation
Then press the Implement button and apply our method.
Implement Component
Finally, we write our code in the method as follows and activate it.
METHOD if_mm_pur_s4_pr_fldcntrl~modify_fieldcontrols.
TYPES ty_field TYPE RANGE OF prfield.
DATA(fields) = VALUE ty_field( sign = 'I' option = 'EQ'
( low = 'EXPECTEDOVERALLLIMITAMOUNT' )
( low = 'OVERALLLIMITAMOUNT' )
).
LOOP AT fieldselection_table ASSIGNING FIELD-SYMBOL(<field>)
WHERE field IN fields.
<field>-fieldstatus = '-' .
ENDLOOP.
ENDMETHOD.
Possible values for
fieldstatus;
- '-' Field is Hidden
- '*' Field is only Displayed, which means no entry is possible
- '+' Field is Mandatory, which means an entry must be made
- '.' Field is Optional, which means an entry may be made
Those are all the steps to enhance ME5*N screens. When you enter the ME5*N screens, you will see that the fields are hidden.
In additional, it works
MM_PUR_S4_PO_FLDCNTRL_SIMPLE on Purchase Order too.
You can also examine the
MMPUR_S_PURCHASEORDERITEM structure by Component Type.
Those are all the steps to enhance ME5*N screens.
I hope that helps you. And If you know any other alternative solution, feel free to comment.
Thanks for reading.
Kind Regards.