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
    • Currently the adapter does not support CHANGING parameters.
    • Data type prototypes must be resolved to a real unique ABAP data type. As such, ANY, ANY TABLE, STANDARD TABLE, and TABLE are not supported as data type prototypes.
    • TYPE C defaults to A1.
    • TYPE STRING defaults to A80. For those two types (C and STRING), it will be up to the user, with the help of the Synonym Editor, to adjust the length of defined fields to individual needs.
    • Data type must be one that is supported. Unsupported data types are VARC, PREC, LCHR, LRAW, RAWSTRING.
    • IMPORT parameters can be mapped to one single field (using either LIKE or TYPE).
    • EXPORT parameters can be either single fields or a structure (using either LIKE or TYPE). When the EXPORT parameter is a structure defined using TYPE, there are two possibilities:
      1. The parameter is referenced in the Data Dictionary as a structure (for example, BAPIRET2).
      2. It is referenced as a Table type (for example, BAPIRET2_T).
    • Even though the synonym can be created in all cases, table type, as an export parameter is not supported.
  3. Error/Warning Messages
    • (E) (FOC44488) DATATYPE data_type NOT FOUND FOR PARAMETER parameter_name
    • (E) (FOC44489) DDIF_FIELDINFO_GET INTERNAL ERROR FOR parameter_name
    • (E) (FOC44490) DDIF_FIELDINFO_GET UNDOCUMENTED ERROR FOR parameter_name
    • (E) (FOC44491) NESTED STRUCTURES NOT SUPPORTED. PARAMETER parameter_name
    • (E) (FOC44492) PARAMETER parameter_name DOESN'T HAVE A DATA TYPE
    • (W) (FOC44493) LIKELY SELECT OPTION TABLE table_name( parameter_name) WILL BE MAPPED TO AN INTERNAL TABLE

    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

WebFOCUS

Feedback