!--a11y-->
You can generate your own ABAP code from the API function modules using transaction GENC. To do this, proceed as follows:
This structure always contains function module CALO_INIT_API (see
The start and end of a function module are marked by special character strings. The description of a function module that is to be shown in the structure is entered after the string that marks the start of a function module. You can change this description if required.
*&BPAPILogfile&:Initialize Logfile
perform api_init_logfile.
*&EPAPILogfile&
You can assign additional API modules that are predefined by SAP to the program. To do this, choose Edit
® New functions. You see a dialog box showing a list of APIs according to the areas they belong to. To copy a function module across, double-click on it.If a function module contains optional data, you can choose which parameters you want transferred to the interface.
For example, in characteristics maintenance functions, you can define whether the basic data, characteristic description, values, or value descriptions are transferred to the interface as parameters.
You can also define whether you want a characteristic to be created or changed by the module. Finally, you generate the function module in order to copy it to your program.
*&BPUSR& |
Start of function |
|
After this key, you enter the name that appears in the function structure | |
*&EPUSR& |
End of function |
In the Maintain characteristic module, for example, if you select basic data and characteristic values as the parameters for the interface, the following place holders must be replaced:
* Define basic data
perform ct_basics tables ct_characts
using '<ct_name>'
'<ct_type>'
<ct_length>
'<ct_status>'.
* Define value
perform ct_value tables ct_char_vals
using '<ct_name>'
'<ct_value>'
'<ct_default>'.
If you define the setting Collect messages, function module CALO_MSG_APPEND_DB_LOG must be called in order to write the log entries to the database (see APIs for the Log).
