Implementing ABAP Functions
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
Create a function group for your ABAP functions
In the Top-Include of the function group enter the line
TYPE-POOLS: TPLIC
. The group TPLIC contains important types for the Template Analysis.
Create function modules in the function group:
- First define the interface Choose the tab page Import In the rows of column Import Parameter enter:
-
PERIOD_FROM
(starting period)
PERIOD_CNT
(number of periods)
CALL_PROG
(calling program); in this line enter
SY-REPID
in column
Reference field/structure.
In the column Transfer values set the respective flag
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
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.
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).