Show TOC

 Implementing ABAP Functions Locate this document in the navigation structure

Use

Enter the name of the appropriate function module in field ABAP Function name if the result of the function should also be the result of the function module.

A multitude of function modules are standard in this SAP release. If these modules do not meet your needs, you can create your own by following these steps.

Procedure

  1. Create a function group for your ABAP functions

  2. In the Top-Include of the function group enter the line TYPE-POOLS: TPLIC . The group TPLIC contains important types for the Template Analysis.

  3. Create function modules in the function group:

    1. First define the interface Choose the tab page Import In the rows of column Import Parameter enter:

      1. PERIOD_FROM (starting period)

      2. PERIOD_CNT (number of periods)

      3. CALL_PROG (calling program); in this line enter SY-REPID in column Reference field/structure .

      4. In the column Transfer values set the respective flag

    2. Then choose the tab page Tables Enter RTABLE_VAL in the column Table Parameter , and TPLIC_RVAL_TAB in the column Associated type (this is contained in group TPLIC ). RTABLE_VAL is the results table; it contains the period with the resulting value of the function for each entry

  4. Fill in fields Period , with the corresponding periods, and Value , with the results of the period (PERIOD_CNT) at the end of the coding for the ABAP-Function in the results table for each period to be evaluated.

  5. Save your entries.

Result

The ABAP-Function you have created is now available for when you define functions. It can be called up in field ABAP Function name (tab page Implementation ).