Show TOC

 Implementation of the Function

Use

In the Implementation view

  • Assign an ABAP program function to the logical function(with reference field)

  • You can determine the F4 selection for functions by using a data element (for field reference).

  • Fill the Result field for the function (in cases with function references)

  • For a function in the hierarchy derived from an existing function, include the associated sub-function (in cases with reference functions)

Features

Assigning Realizations (Field or Function references)

You can base a logical function on function modules or table fields, meaning that the function result comes from a module or from field contents. Make entries either in the ABAP Function Name field for a function module, or in the fields Table Name and Field Name for the table field.

Function Result Types

Functions based on function modules can have the following result types:

  • Number Value/String : Useful for functions in the editor.

  • Boolean values (true/false) : this result type is useful for functions in the editor that have true/false results.

    Note Note

    Functions that refer to a function module must either use Type of Parameter or Type of Function.

    End of the note.
  • Type of parameter : this results type (or type of function) must be used for functions in object determination. Choose ( F4 ) in the field of a function parameter that determines the results type at the time of processing. A parameter of this result type can refer to different table fields. It is therefore more flexible than the type of the a specified, fixed table field.

    Example Example

    For the function COMPONENTS_OF_GROUP, you enter ABAP parameter GROUP_FIELD in the Results field. In template maintenance, you enter the function SEND_PROCESS as a parameter.

    End of the example.
  • Type of function : this results type (or type of parameter) must be used for functions in object determination. Use F4 to choose from the valid functions.

Using Data Elements for DeterminingF4Selection for Comparisons/Parameter Selection

Comparisons

For comparisons made when you define methods , the system only provides functions (via F4 ) for the relational operand 2, whose data element is the same as that of relational operand 1. Each function that is realized as a table field is assigned a data element via the ABAP Dictionary. Functions based on function modules have no data element assignments.

You can use the F4 data element field to change the existing assignment, or create an assignment (for functions with reference to function modules) that makes additional comparisons possible.

Example Example

If the function that you selected as relational operand 1 is assigned data element KOKRS, the system does not offer functions for relational operand 2 using the assigned data element BUKRS. To allow comparisons of these functions, you must assign both functions the same data element, such as ORG_UNIT.

End of the example.

If you enter an asterisk ( * ) in the F4 data element field, this function is provided for all instances of relational operand 2, as long as it is generally allowed in this context.

Selecting Parameters

By using F4 for the parameter selection (all editors), the system only offers functions whose data elements match those of the parameters. If you enter a data element, in addition to the above, you also get all functions that contain the given data elements.

For more information, see Function Parameters and Function Uses .

See also : Example: Creating Functions

Table for Flexible Functions (Flex.Function Via).

Define a flexible function by making an entry in this field. You determine which table (for example: routing or BOM) is used for the evaluation runs of the flexible function, if this has been created in the template maintenance.

For more information, see Defining Flexible Functions .

Referring to the Reference Function

You can define a function by copying an existing function (such as one in the standard SAP system) and then modifying it for your own requirements. In this case, enter the function name of the reference in the Reference Function field.