Entering content frameThis graphic is explained in the accompanying text Example: Creating Functions Locate the document in its SAP Library structure

Starting Situation

You want to create a template in such a way that a business process "Quality Inspection" is only activated when the confirmed quantities of an order deviates from the total order quantity. In order to do this you need a function that allows you to access the confirmed order quantities. You create this is in the following way: (a function for the total order quantity already exists).

Note

The function Order_Yield_Confirmed already exists in the standard SAP System. This gives you the opportunity to compare executed tasks with data in the System.

Selection Window

In the selection window you decide in which template application, environment and sub-environment the new function should be placed. For this example:

  1. In section Defining Environments and Function Trees, choose This graphic is explained in the accompanying text :
  2. In the Template Application field enter: COB All environments and sub-environments that exist within the chosen template application are listed in the screen area to the left.
  3. Expand the Environment 001; Cost Estimates/Production Orders and also the structure node Order Data
  4. Select the structure node.
  5. Choose Edit ® Function ® Create
  6. In dialog box Creating functions, enter a description for the new function: Order_Yield_Confirmed
  7. Choose Lower level The tab index of the function transaction appear on the right screen area.
  8. Make your entries using the tab index.

Basic Data Tab

Here, you describe the function and can also create documentation for it.

  1. Description: Confirmed period based order quantities .
  2. Logical Function Name: K_ABC_GET_ORDER_CONFIRMATION
  3. Environment: 102
  4. Namespace: Select using F4
  5. Click on the documentation Icon (This graphic is explained in the accompanying text) to create documentation for the function.

For more information, see Functions – Basic Data and Languages.

Implementation Tab

Choose the function module, to which the results of the function should be delivered You determine, therefore which data the function should supply. We are assuming here, that the appropriate function module exists.

  1. ABAP Function Name: Select the function module: K_ABC_GET_ORDER_CONFIRMATION using F4.
  2. Result type: The function module delivers a numerical value, therefore select Num. Value/String
  3. F4 possible entries for comparison/parameters: in the Possible Entries field Enter QUANTITY

Effect: The following is achieved by this entry: when defining Methods (activation) as a comparison operand 2 all functions contained by the data element QUANTITY are displayed (See Section: Results).

For more information, see Realization of the Function.

Parameter Tab

Here, you determine exactly which data the function should supply. You indicate among other things to which fiscal year and which controlling area the data should belong.

  1. ABAP Function: K_ABC_GET_ORDER_CONFIRMATION
  2. ABAP Parameter: Invisible parameters (default values in brackets): Order confirmation number (Order confirmation number), fiscal year (current fiscal year), controlling area (Function ORDER_CONTROLLING_AREA), order number (function ORDER_NUMBER)
  3. Literal: Confirmation quantity type , F4 data element QUANTITY . This entry in the column Possible Entries means that when selecting comparison parameters ( see section Results) only functions where the data element QUANTITY was entered, in the possible entries field on the implementation tab, are selected.

For more information, see Function Parameters.

Uses Tab

On this tab you determine in which cells of the template the function can be used.

  1. On the overview tab select Quantity and Activation for the cells Business process, Calculation row (business process) and Flexible function (business process).
  2. Goto the All Columns tab.
  3. Deselect the ticks from the columns Plan Activ. and Plan Qty.
  4. In the lines Business process, Calculation row and Flexible functions of the column Actual Qty, choose This graphic is explained in the accompanying text and select Formula component. The function can then be used as an element of a formula for quantitive determination.
  5. In the column Act Acty use This graphic is explained in the accompanying text to select Column heading and column entry. This means that the function can be used as comparison operand 1 and 2.

For more information, see Function Uses.

Function Hierarchy Tab

On this tab you enter within which function trees the function should be contained.

For more information, see Additional Function Trees.

Language Tab

Enter external, language dependent descriptions for the functions in different languages, for example Confirmed period based order quantities and Periodengerecht rückgemeldete Menge für Auftrag.

For more information, see Functions – Basic Data and Languages.

Result

Y ou can now use the function in template maintenance to compare confirmed order quantities and total order quantities.

Column: Actual Activation

Comparison operand 1 = Function Order Yield Confirmed with parameter Confirmed Yield This function can be selected as a parameter, because you also selected the F4 data element QUANTITY (see section above: Parameter).

Unlike

Comparison operand 2 = Function Total Order Quantity. This function can be chosen as the same F4 data element was selected as with the Confirmed Order quantities (F4 Help Possible entries for comparison/parameters on Implementation tab), namely the data element QUANTITY (see section above: Implementation Tab).

This means that the quality process will only be activated when the confirmed order yield deviates from the total order quantity.

Column: Actual Quantity

in the column Actual Quantity you can enter a 1. This means that a new quality process will be executed, everytime the activation criteria are met.

 

 

 

Leaving content frame