Show TOC

Implementing Business Logic for a Planning Function Type in ABAP ClassesLocate this document in the navigation structure

If you implement and define an ABAP class, you can implement a customer-specific planning function type.

Prerequisites

  • You have created a planning function type.

Context

You want to implement an ABAP class for the new planning function type and define its parameters.

Procedure

  1. You are in the Properties tab page. Create an ABAP class and implement the relevant interface.
    Screen Area Description
    Implementation

    Enter the name of the ABAP class that implements the procedure. The ABAP class has to implement one of the two interfaces:

    • IF_RSPLFA_SRVTYPE_IMP_EXEC

    • IF_RSPLFA_SRVTYPE_IMP_EXEC_REF

      The latter interface is relevant if you need reference data for your procedure. Implementing methods of the specified interfaces is optional, with the exception of method EXECUTE.

      The class can also implement specific test methods that are executed at runtime. This is done using interface IF_RSPLFA_SRVTYPE_IMP_CHECK.

      You can select the following indicators:

    • Reference Data If this flag is set, reference data is needed when you execute the planning function.

    • Without Blocks: If this flag is set, the transaction data is processed without creating blocks, meaning that all characteristic values in the transaction data can be changed.

      Note

      In this case you cannot create conditions since the selection table for each condition may only contain characteristics that can also be used to create blocks.

    • Process Empty Records: If this flag is not set, all empty records are ignored during processing.

    Characteristic Usage Interface Display

    Using Web Dynpro and development components, you can create your own user interface instead of the standard user interface for characteristic usage. You can also set the following flags:

    • Hide Column of Characteristics To Be Changed: Setting this flag is recommended if you want to perform processing without blocks, or if the characteristics you want to change are the result of other settings.

    • Display First When Creating: If this flag is set, the user interface of the characteristic usage is displayed firstly when a planning function is created. Otherwise, the user interface with the parameter values is displayed.

    Parameter Interface

    By using Web Dynpro and development components, you can create your own user interface instead of the standard user interface for parameters.

  2. Go to the Parameters tab page.

    Create the required parameters using Create Parameters or Create Components in the context menu for an object in the parameter hierarchy. You can change the details of existing parameters by choosing Properties in the context menu. With and , you can change the sequence of the parameters. The sequence of the parameters is taken into account when you create a planning function for this planning function type.

    With the Parameter is Tabular indicator you can mark a parameter as a table; it will then behave like an internal table. In this table, each row of the tabular parameter has the properties that correspond to the selected parameter type. The flag is valid for all parameter types (in the context menu with Properties) with the exception of Key Figure Selection or if parameters are used as components of a structure parameter.

    Parameter Type Description

    Elementary

    (Elementary Parameter)

    The value of an elementary parameter is the value of a specific InfoObject. This means that every elementary parameter is based on an InfoObject and thus inherits its technical properties. If the InfoObject is a characteristic, the system automatically checks the validity of a value entered by the user based on the master data.

    InfoProvider InfoObject

    The parameter can include the name of an InfoObject from the current InfoProvider (aggregation level). You can define the valid InfoObjects by selecting Restrict. InfoObject:

    • Key Figures Only are valid.

    • All characteristics

      Only characteristics are valid, but these have no restrictions.

    • Block Characteristics Only

      Block characteristics are used to group the transaction data (see Without Blocks above)

    • Characteristics To Be Changed Only

      Only characteristics that are changed by a planning function are valid. Block characteristics are therefore not valid.

    • Condition Characteristics Only

      Only characteristics that are used in the planning function to define the condition are valid.

    Data Selection

    Data selection parameters can include selection critera from a number of characteristics, depending on which are needed for defining filters. This is therefore a special selection table. You define the characteristics that are valid for the data selection by selecting Chars. Restriction:

    • All Characteristics

      All characteristics of the InfoProvider are valid.

    • Block Characteristics Only

      Block characteristics are used to group the transaction data (see Without Blocks above)

    • Characteristics To Be Changed Only

      Only characteristics that are changed by a planning function are valid. Block characteristics are therefore not valid.

    • Condition Characteristics Only

      Only characteristics that are used in the planning function to define the condition are valid.

    Structure

    (Structure Parameter)

    With a structure parameter, you can declare other parameters as components of the structure parameter and thus combine them into a structure. Parameters of type Elementary, InfoObject of the InfoProvider and Data Selection are valid as components.

    To declare a parameter as a component, choose either Create Component in the context menu of a structure parameter or its components, or Start of the navigation path Properties Next navigation step Structure Parameter End of the navigation path in the context menu of another parameter.

    Key Figure Selection

    This parameter type selects the key figures to be processed. It is therefore a special case of the type InfoObject of the InfoProvider.

Example

The planning function types delivered by SAP are based on the same technical concept as the customer's own planning function types and can thus be viewed in the maintenance of the planning function types.

Example

The function type Delete( 0RSPL_DELETE) is a simple example. There is only one parameter (KYFSEL) for selecting key figures to delete. In the associated ABAP class, interfaces IF_RSPLFA_SRVTYPE_IMP_CHECK and IF_RSPLFA_SRVTYPE_IMP_EXEC are implemented.