Skip to Content
User Experience Insights
Author's profile photo Vaibhav Khollam

Enhancement to grey out short text field in PR based on certain conditions

Hi All,

This blog post is just a consolidation of various other blogs posts across the SCN community.

My requirement was disabling the short text field in purchase requisition based on certain conditions. The purpose of this blog posts is to display the enhancement done for this requirement.

Since there were not any complete blogs posts over the community, I decided to write this article.

 

We all know the functionality of field selection in transactional documents.

Details on functionality of field selection is explained very beautifully in below blog post:

https://blogs.sap.com/2015/01/19/a-brief-interpretation-and-faq-about-field-selection-and-screen-layout-used-in-mm-module/

 

There is another functionality named Metafield which influences the field selections.

What is a Metafield? How does Metafield influences the field selection? This is explained in below blog:

https://blogs.sap.com/2015/02/19/field-selection-an-insight-on-the-technical-implementation/

 

Metafield value can be obtained through debugging or alternatively through FM – MEMFS_BUILD_MAPPING_PO_DOC

Pass the below application values to import parameter – IM_APPLICATION

Application for PR       – MMPUR_PR_DOC [We will be using this for our enhancement]

Application for PO      – MMPUR_PO_DOC

The metafield value obtained for short text is 69, we will be using same in our enhancement.

The metafield values above are the link into field selection customizing, table T162-FAU*.

 

Field selection configuration for PR

Path – OLME à Purchase Requisition à Define Screen Layout at Document Level

 

For our requirement we will consider two standard field selection keys:

Header Level               – NBB

Standard Item level     – PT0B

The configurations from these two field selection keys will influence our enhancement. We will be overriding the optional entry to display state for certain conditions.

Our enhancement is based on assumption that the short text field status is set to OPTIONAL for both these field selection keys – NBB & PT0B.

To override the configuration settings we need to add Implicit enhancement at end of below FM’s

FM for PR        – MEREQBADI_FS_ITEM [We will be using this for our enhancement]

FM for PO        – MEPOBADI_FS_ITEM

 

We will disable the short text field based on below conditions:

  • PR document type – NB
  • Plant – 1A00
  • Material is entered at line item

Below are the values of Field Status is stored in table – TBKKI_01

+          – Required Entry
–           – Hidden
*          – Display
.           – Optional

Below is the sample Code:

Testing

There are other ways as well to achieve this requirement by using below BADI methods

To Summarize, based on certain conditions we can override the field status set in configuration by implementing this enhancement or BADI.

Please feel free to comment & suggest any changes required for this documentation. Please do share your feedback or thoughts on the same.

Thank you very much.

Assigned tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Bhumika dodia
      Bhumika dodia

      Hi,

      Nice Explanation!!!