Professional Documents
Culture Documents
Disable Standard Field in ME22N, ME21N - SAP Blogs
Disable Standard Field in ME22N, ME21N - SAP Blogs
Community
Welcome Learners!
Find out more
Join the new SAP BTP Learning group for guidance
and support to achieve your learnings goals.
Technical Articles
Enio Rafael
December 5, 2018
| 2 minute read
Hi everyone.
Like
RSS Feed I saw a lot of questions about how to disable a standard field in ME22N and
ME21N. So I decided to share my solution for this problem.
First of all, SAP don’t offer an standard way for reach this solution. And in my
case i wanted to include some specific code to decide disable or not that field.
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 1/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
select *
from zmmt001
im_header = im_header
im_item = im_item.
loop at fields.
CHANGING
field_selection = field_selection.
endloop.
ENDENHANCEMENT.
As you can see, there is a table called ZMMT001, which will store the field number
and the method that we wanna use to process.
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 2/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
public
final
create public .
public section.
methods CONSTRUCTOR
importing
methods NET_PRICE
changing
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF field_state,
END OF field_state.
ENDCLASS.
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 3/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
* <SIGNATURE>-----------------------------------------------------
* | Instance Public Method ZCL_LOCK_PO_FIELD->CONSTRUCTOR
* +---------------------------------------------------------------
* | [--->] IM_HEADER TYPE REF TO IF_PURCHASE_O
* | [--->] IM_ITEM TYPE REF TO IF_PURCHASE_O
* +---------------------------------------------------------------
METHOD constructor.
ENDMETHOD.
* <SIGNATURE>-----------------------------------------------------
* | Instance Public Method ZCL_LOCK_PO_FIELD->NET_PRICE
* +---------------------------------------------------------------
* | [<-->] FIELD_SELECTION TYPE MMPUR_FS
* +---------------------------------------------------------------
METHOD net_price.
* ....
"//Disable field
field_selection-fieldstatus = field_state-disabled.
ENDMETHOD.
ENDCLASS.
Thanks,
Enio.
Alert Moderator
Assigned Tags
ABAP Development
MM Purchasing
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 4/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
abap objects
ME21
me22
Calling custom developed Adobe Form from standard Transaction Code for Print Output in SAP ABAP
By
suman kolatum Feb 07, 2020
Related Questions
Assing Screen variants to users Purchase order
By
Maria Merino Jul 23, 2020
Coffee Corner
Join the new Coffee Corner Discussion Group.
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 5/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
8 Comments
thankyou for sharing knowledge. May I ask where is this function (MEPOBADI_FS_ITEM) called? from its
name look like it only affect on item level, what about header?
Like 0 | Share
Hi Quynh.
Yes, the function MEPOBADI_FS_ITEM is called for every item, as you can see in the print below
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 6/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
About header, the function that you can use is MEPOBADI_FS_HEADER. As i could see, it works
exactly like item. So you can use the same implementation.
Enio.
Like 0 | Share
Alexandre Henrat
December 5, 2018 at 12:46 pm
Hi,
For the record, the field-control logic is explained in OSS note 2287838
Like 1 | Share
Michael Bennett
December 14, 2018 at 5:46 am
Hi,
Would a transaction variant with screen variants allow you to do something similar without code? We lock
down many fields in ME29N using a screen variants as part of a transaction variant set by transaction
SHD0.
Regards,
Michael
Like 1 | Share
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 7/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
take care
Moçatto
Like 1 | Share
Kellen Yan
April 22, 2021 at 6:45 am
Regards,
Kellen
Like 0 | Share
Hi,
Can we use the functionality to lock fields at position level within the tabs? (i.e. Quantities/Weights tab)
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 8/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
ME22N
Thanks in advance
Like 0 | Share
Harshit Varshney
July 29, 2021 at 5:34 am
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 9/10
27.11.2021 21:39 Disable standard field in ME22N,ME21N | SAP Blogs
MODIFY ch_fieldselection FROM w_fieldselection.
CLEAR w_fieldselection.
ENDLOOP.
Like 0 | Share
Find us on
Newsletter Support
https://blogs.sap.com/2018/12/05/disable-standard-field-in-me22nme21n/ 10/10