Start of Content Area

Overview documentationInterface of the Function Module  Locate the document in its SAP Library structure

In a function, you refer to an ABAP function module whose input and output data is copied as table entries.

For information on how to create function modules, see the SAP Library BC Basis ABAP Workbench ABAP Workbench: Tools Function Builder.

Note

If you want to specify a function module in a function, the name of your function module cannot have more than 18 characters.

The ABAP interface of an external function module is hard coded and comprises the following elements:

Interface Import Parameters

Parameter Name

Typing

Reference Field

Content

GLOBALS

LIKE

CUOV_00

Global parameters for calling a function. However, the list of fields currently only contains the date.

 

Table Interface

Tables MATCH and QUERY are required to transfer characteristics to ABAP code and back.

 

Parameter Name

Typing

Reference Type

Content

QUERY

LIKE

CUOV_01

Table of input parameters and the expected output parameters

MATCH

LIKE

CUOV_01

Table of output parameters

All partial fields except ATCIO must be filled in a MATCH entry (especially format ATFOR)

 

Structure CUOV_01 comprises the following fields:

·        VARNAM (characteristic name)

·        ATFOR (format of the value)

·        ATWRT (alphanumeric characteristic value in internal format)

·        ATFLV (numeric characteristic value)

·        ATCIO (Indicator: input (I) or output (O) parameter)

The fields ATFOR, ATWRT, and ATFLV only have values assigned for input parameters.

 

Exceptions:

FAIL

This exception shows that the condition represented by the function is not fulfilled.

INTERNAL_ERROR

This exception shows that a runtime error has occurred processing the function.

 

Note

Do not enter any other import parameters or table parameters unless you define them as optional.

The type of dependency in which the function is used determines which data is transferred to the function module and which is returned:

·        If you want to use a function with your function module for checking the values entered (for example, in preconditions and selection conditions, and in the conditional part of actions and procedures), enter the input values you want to check in structure QUERY. The function module then informs you whether the values are allowed or not (exception FAIL).

·        If you want to use the function module for inferring values, enter the input values and the characteristics required in structure QUERY. The output values are returned in structure MATCH.

Note

If you transport the product model into another SAP system, you must maintain the module manually.

The following help functions are supported for accessing import parameters:

·        CUOV_GET_FUNCTION_ARGUMENT: Read characteristics

·        CUOV_GET_FUNCTION_ARGUMENT: Transfer characteristics

If you use these modules for modeling, you can access entries in table QUERY directly by name or enter a return value in table MATCH.

 

 

End of Content Area