Sie sind auf Seite 1von 1

3/23/2019 How To Create Field in KOMP, KOMG

How To Create Field in KOMP, KOMG

New Fields in Pricing

To use a field in pricing, one creates a condition table. This condition table is created using the allowed fields from the field catalog. Should the fields one requires not
list of allowed fields, one can add the fields from the list of available fields. However, one may find that a new field may not be in the list of available fields. For this r
create new fields for pricing. The document and item data in SD is stored in data tables, such as VBAK and VBAP (for the order transaction). Many of the fields from
available in the field catalog.

The field catalog is a structure (KOMG) that consists of two tables (KOMK and KOMP). These tables contain the header and item data for pricing respectively. They
because they are communications structures used to communicate the transaction data with the pricing procedure. Table KOMG contains the fields of tables KOMK an

If you require a field that is not in KOMG, it means that it is not in KOMK or KOMP. This means that the field you require cannot be used in pricing because there is n
this field from the transaction to the pricing procedure via the communication structures.

To use a field not defined in the field catalog, you need to add this field to the KOMK or KOMP structures, and then write the ABAP code to transfer the data in the fi
transaction tables to the communication structure. Follow these steps:

1. Create the field in the KOMK (header data) and KOMP (item data) tables using the standard includes provided for this requirement.
2. Write the code in the user exit to read the transaction data and transfer it to the KOM “x” structures.

Menu Path

The menu path here is IMG, Sales and distribution, System modification, Create new fields (using the condition technique), New fields for pricing.

Adding the Field to KOMK and KOMP

This process requires some knowledge of the ABAP dictionary and how to use the ABAP dictionary to create and change fields and tables. You may have to use an AB
you. If the field is from the header table (for example, the order table VBAK), you’ll need to add it to the include table KOMKAZ in table KOMK. If the field is from
example, the order item table VBAP), you’ll need to add it to the include table KOMPAZ in table KOMP.

Let’s say you need to use the “base material” to define a price and the base material is not in the pricing field catalog. The base material is a field on the material maste
and is defined as MARA-WRKST. Since this relates to the material, it is at the item level, so you would add the field to the KOMPAZ include table.
Note When you add a field to these tables, it must start with “ZZ.” Therefore, the field you add would be ZZWRKST. In ABAP, when you add the field, use the sa
field in the original table MARAWRKST.

After adding the field, generate the structure KOMP. This field is not available in the field catalog and can be used in condition tables.

Writing the ABAP Code

The field in the communications structure will be blank unless the ABAP code transfers the data from the material master to the field KOMPZZWRKST. Pricing occu
the invoice, so you need to put this code in both places. For the order transaction, write the ABAP code in user exit USEREXIT_PRICING_PREPARE_TKOMP in in
MV45AFZZ. For the billing transaction, write the ABAP code in user exit USEREXIT_PRICING_PREPARE_TKOMP in RV60AFZZ.

Note : The TKOMP is for the item level. If you are writing the code for a field at the header level, you would use the user exits that end with TKOMK. The ABAP co
Base material field from the material master table using the material from table VBAP/VBRP. It would then transfer this field to the structure TKOMP from MOVE M
TKOMP-ZZWRKST.

https://www.erpgreat.com/sap-sd/how-to-create-field-in-komp-komp.htm 1/2

Das könnte Ihnen auch gefallen