Adding new fields to condition field catalog

Introduction

In many business scenarios, the standard condition field catalog may not fully meet specific pricing or determination requirements. When a required field is not available in the standard catalog, it becomes necessary to enhance the condition field catalog and make the new field available for condition record determination. This process involves a combination of configuration and technical development to ensure the field is properly defined, populated at runtime, and integrated into the condition technique.

To successfully achieve this, the underlying configuration settings and required coding enhancements must be implemented correctly so that the new field can be included in condition tables, access sequences, and ultimately used during condition determination without any inconsistencies.

 

Basics of modification in pricing

The following communication structures are relevant in pricing:

  • KOMK (Pricing communication header)
  • KOMP (Pricing communication item)
  • KOMG (Allowed fields for condition structures)
  • For technical reasons, communication structure KOMG is used. It combines the fields from KOMK and KOMP that are relevant for pricing in the standard system and are offered in the field catalog of condition tables. If you want to use a new field in the field catalog, you must add the field to KOMP or KOMK in the following INCLUDES:
  • Header data in INCLUDE KOMKAZ in KOMK
  • Item data in INCLUDE KOMPAZ in KOMP

When you use INCLUDES, the field is automatically added to KOMG and the field catalog.

  • The routines for assigning values to the new fields in order processing are found in the include MV45AFZZ. Use the following user exits:
  • USEREXIT_PRICING_PREPARE_TKOMK (Sales order header fields)
  • USEREXIT_PRICING_PREPARE_TKOMP (Sales order item fields)
  • The routines for assigning values to the new fields in billing are found in the include RV60AFZZ. Use the following user exits:
  • USEREXIT_PRICING_PREPARE_TKOMK (Billing header fields)
  • USEREXIT_PRICING_PREPARE_TKOMP (Billing item fields)

 

Example

I want to add the new partner function called “End customer” to the field catalog and determine pricing based on that end customer mentioned in the sales order header.

 

Steps to follow

Create data element for new field

  • Go to SE11
  • Enter “ZZKUNNR” under field “Data Type” and press

 

Remember that new data fields must start with the letters “ZZ” or “YY”, since SAP reserved these letters to protect them from being overwritten during a release upgrade.

  • Select and press

 

  • You’ll need to have a Access key to proceed

 

Get it from your basis consultant and enter it under field and press

  • Maintain below data

 

  • Save

  • Check it

  • Activate

Now you have created a new data element as “ZZKUNNR”

 

Add the date element to condition structure

First you need to identify where this field is in the sales order (Header or line item). Since I need to refer header partner functions I need to add my new date element to KOMKAZ structure. If it’s line item data, then you need to add it to KOMPAZ structure.

 

Adding ZZKUNNR to KOMKAZ structure

  • Go to SE11
  • Enter KOMKAZ under and press
  • You’ll have to give the access key here as well.
  • Maintain below data

 

  • Save

  • Check it

  • Activate

 

Note:

Due to the changes in the structure KOMKAZ, the field ZZKUNNR is now known in the structures KOMG and KOMK because the structure KOMKAZ is included in both structures.

 

Add new field to condition field catalog

  • Go to below IMG path

 

  • Add the new field there

 

  • Save

This new filed will be available for you to add in to the condition table under condition table creation IMG step.

 

Populating the field for sales order processing and billing document processing

Now you need to add this field to relevant user exists in order to pick it in sales / billing document processing.

For this you can use below includes and user exits.

  • Include- MV45AFZZ. Use the following user exits:
  • USEREXIT_PRICING_PREPARE_TKOMK (For Sales order header fields)
  • USEREXIT_PRICING_PREPARE_TKOMP (For Sales order item fields)
  • Include – RV60AFZZ. Use the following user exits:
  • USEREXIT_PRICING_PREPARE_TKOMK (For Billing header fields)
  • USEREXIT_PRICING_PREPARE_TKOMP (For Billing item fields)

In order to code it;

  • Go to SE38
  • Enter relevant include

 

  • Press Change
  • You’ll have to give the developer key here
  • Since I’m referring to the sales document header partner function, I have to use below user exit. USEREXIT_PRICING_PREPARE_TKOMK
  • Sample code is as follows

 

Here it checks the sales order header partner function “XE” and pass it to the “ZZKUNNR” field in the condition catalog.

  • You need to add same to the billing user exit under include RV60AFZZ as well.

 

Add field to Allowed Fields per Usage and Application

  • Go to SE11
  • Enter table T681F

 

  • Press

  • You’ll need Access key and a developer key here as well
  • Add below values

 

Note:

Use “E” has been added for fields in rebate processing.

Data sources

  • SAP Note 21040 – Allowed Fields not appearing for condition table
  • SAP Note 531835 – Using field PSTYV in the condition access
  • Documentation available in then IMG node for adding new fields

 

Disclaimer

This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else.

Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.

Leave a Reply

Your email address will not be published. Required fields are marked *