Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!



Fill RESBD Structure from EBP Component Structure   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

This SAP enhancement enables you to change the process of material quantity calculation in the master recipe and the process order as follows:

  • You can enhance the entry data for additional fields and columns.
Example: in your calculations, you can take account of characteristic values from BOM items and reservations that have not been entered in a batch class and that are therefore not contained in the standard system.
  • In this enhancement, you can define formulas for quantity calculations that are to be carried out in the SAP material quantity calculation.
Example: you can deduce the formulas for those batches that were specified in the order from a material component formula.
  • You can call up an external application, like Microsoft Excel, for example, to carry out complex quantity calculations for operations, BOM items and reservations.
  • In this enhancement, you can define calculations for values that have no calculation in the standard system, for example, for quantities or characteristic values of the header material.
    You can carry out the calculation either in the SAP material quantity calculation or in an external application.
  • You can transfer the results of the enhancement to the SAP material quantity calculation, or you can deactivate the material quantity calculation. The results can be saved in the standard system.
If you want to use SAP's material quantity calculation, note that the formulas defined there can change the values transferred from the enhancement. You should therefore check all formulas.

The following parameters are transferred from either the master recipe or the process order to the enhancement function:

APPLICATION Material quantity calculation source, for example,
  MR master recipe and 40 for process order.
KEY The material quantity calculation ID. It consists of
  material number, plant, production version and
  model number (at present, always 01)
  Background: a material can be assigned several
  production versions.
  You can create one material quantity calculation
  for each production version.
VERSION The material quantity calculation version. One
  version is created with each change number.
IN_CAUFVD The process order header structure. This structure
  is transferred if the enhancement is called up from
  the process order.
IN_RCM01 The structure in the master data help field (recipe
  and BOMs), for example, field DATUV for the
  periodic master data explosion. This structure is
  transferred if the process order is called up for
  the enhancement.
DISPLAY_IMP Indicator for display mode for
  material quantity calculation (display or change)
RECALL_IMP Indicator for material quantity calculation with
  temporarily created order (for product costing,
  for example)
DISPLAY_LST_IMP Indicator: print list of formulas

The following parameters are transferred from the enhancement function to either the master recipe or the process order:

CHANGED_VALUE Value has been changed and is to be saved
CHANGED Formula has been changed and is to be saved
SUBRC SY-SUBRC (return value)

The following material quantity calculation tables are transferred:

IN_COL Column structure of material quantity calculation
IN_ROW Line layout
IN_JOIN Values and formulas per line
IN_KALT Material quantity calculation header
IN_PLPOE Database tables with operations from the
  master recipe
IN_STPO Database tables with BOM components of
  material quantity calculation
IN_RESBDGET Database tables with the reservations of material
  quantity calculation
IN_AFVGDGET Database tables with the operations from the order
IN_ROW_DEF Index to the database tables

RETURN_CODE controls behavior after the enhancement has been exited. If a value <> 0 is transferred, material quantity calculation is not called up.

For more information on parameters, refer to the interface description of function module EXIT_SAPLCOML_001.


The enhancement contains all the data necessary to represent formulas and results from a master recipe or a process order with the aid of the user's own tools.
In the enhancement, you can read and mix formula tables. If necessary, you can also read characteristics. Then you can add in your own evaluation. See also how the function module CALCULATION_SHEET works.
Finally, decide whether changed values and formulas are to be saved in the standard system.
If the SAP material quantity calculation is no longer to be carried out, enter a corresponding return code.


Table IN_ROW_DEF represents the sequence of operations and components in the material quantity calculation. It contains an index to a data record in the table for every object. Example:

OpNO ItemNO ObjID TabNO Index
0014 GA40 2 PLPO 3
0010   1 PLPO 1
0012   2 PLPO 2
0012 GA50 0 STPO 1


  loop at in_row_def
                tabnm = 'STPO' or
                tabnm = 'RESB'.
* Index for access to material quantity calculation line table
     tabix_tmp = sy-tabix + 1.
* reading a BOM component
     read table in_stpo index in_row_def-index.
* reading a material quantity calculation line
      read table in_row index tabix_tmp.
      read table in_join with key row = in_row-id.
* changing a value, value to be saved later
     in_join-value = 'xxxxx'.
     in_join-form_ind = Space.
     modify in_injoin index tabix_tmp.
     changed_value = 'X'.
   end loop.




Make the following settings in the enhancement (see the syntax example in the section How do you read a table):

  • Change the corresponding entry in table IN_JOIN.
You will find the header quantity in the first table entry.
The subsequent table entries contain the operation and component quantities according to sort numbers.
  • Set the following values:
Import parameter CANGEND_VALUE = "X" to save a value
Import parameter CHANGED = "X" to save a formula

The time at which the data is saved depends on whether you call up material quantity calculation directly after the enhancement:

  • If you do not call up material quantity calculation (RETURN_CODE <> 0), the data is saved as soon as you exit the enhancement.
  • If you call up the material quantity calculation (RETURN_CODE = 0), you can save the data in the material quantity calculation as follows:
  • Formulas: by choosing function save formula or transfer result

  • Values: by choosing function transfer result

If you exit material quantity calculation without saving your data, the parameter values set for the enhancement will be reset. (CANGEND_VALUE = "X" and CHANGED = "X"). You will also lose the results from the enhancement.

The data is saved in the following database tables:

  • Header table KALT
  • Formula table KALC
  • Changes to the header quantity in recipe, BOM and order
  • Changes to the header characteristic values in the classified material master
  • Changes to the operation or component quantities in recipe, BOM and order
  • Characteristic values from the classified BOM header
  • Characteristic values from classified BOM components
  • Characteristic values from the components' classified material master

ABAP Short Reference   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 13389 Date: 20220126 Time: 132359     sap01-206 ( 97 ms )