SAP Support for a Function Module

There are two attributes (displayed in the Attributes tab of the function module) to consider before using a function module:

The interface is read-only. You should check that any function module called from the interface is read-only. There is no way for the server to check if a function module is read-only. This responsibility has to be deferred to the user.

Consideration should also be given to system security. If a function module is RFC-enabled, it does not mean it is bound to SAP security. From our own experience, only the subset of function modules with a name starting with BAPI may include SAP security.

  1. Create Synonym Time

    A function module may have a set of Import/Export/Changing/Tables parameters. It may also include a set of exceptions. (See current limitations below).

    Every parameter must be prototyped to a data type that can be translated into a WebFOCUS server data type. If a parameter cannot be mapped, a warning is issued (FOC44492), and the parameter will be rejected. An example is the LOCAL_CAT import parameter in the READ_TEXT function module.

    Parameters can be prototyped as LIKE or TYPE. In case of TYPE, this type must be externalized, that is, defined outside the scope of the function group where the function module is defined. An example where the TYPE cannot be found is in the SELKZ_KUPAV table parameter in the SD_PARTNER_SELECTION function module. This parameter is typed as LV09A_TY_PRTNR_ITAB, defined in the LV09A type group. In this case, an error message will be issued (FOC44488), and the parameter will be rejected.

    The interface can handle either single fields or single-level structures, but it cannot handle compound structures, such as the IT_COMP_SIMUPARAM_RANGES import parameter in the ACEDS_ACCRUAL_FOR_ACRTYPE_CALC function module. In this case, an error message will be issued (FOC44491), and the parameter will be rejected.

    When the structure of a table parameter contains only four contiguous fields named SIGN, OPTION, contains(LOW), and contains(HIGH), this particular table is viewed as a select option table, and will be declared as such in the Access File. This, outside of single-value import, is the most efficient way to pass a set of restrictions to a function module.

  2. Limitations
  3. Error/Warning Messages

    Upon error, if the parameter on which the error occurred is optional, the synonym will still be created without the corresponding parameter. If the parameter is required, the creation of the synonym will be aborted.

    Note: Properties for a given parameter are found using the DDID_FIELDINFO_GET function module. If this function module cannot retrieve properties for the parameter, the parameter is flagged with (FOC44488).

    ABAP exceptions generated by a SAP function module are now trapped at TABLE run time.

    The resulting error will be:

    (FOC1695) SAP/R3 REQUEST ERROR   :
              [optional error message sent by the function module]
    (FOC1736) SAP/R3 ERROR EXECUTING ABAP4 PROGRAM : function_module_name


iWay Software