SAP Function Modules

KERG_GENERATE_TEMP_REPORT SAP Function module







KERG_GENERATE_TEMP_REPORT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name KERG_GENERATE_TEMP_REPORT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: KERG
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM KERG_GENERATE_TEMP_REPORT - KERG GENERATE TEMP REPORT





CALL FUNCTION 'KERG_GENERATE_TEMP_REPORT' "
* EXPORTING
*   i_erkrs =                   " tkebwl-erkrs
*   i_isource =                 " tkebwl-isource
*   i_fnam_part =               " tkebwl-fnam_part
*   i_transtruc =               " tkebwlg-transtruc
*   i_template = 'RKEVRK57'     " trdir-name
  IMPORTING
    e_repid =                   " sy-repid
* TABLES
*   i_t_valuefields =           " sbiwa_t_fields
*   i_t_calckeyf =              " sbiwa_t_fields
  EXCEPTIONS
    TEMPLATE_NOT_FOUND = 1      "
    UNKNOWN_GENERATION_SHORTCUT = 2  "
    SYNTAX_ERROR_IN_GEN_PROG = 3  "
    VARIABLE_SUBST_FAILED = 4   "
    .  "  KERG_GENERATE_TEMP_REPORT

ABAP code example for Function Module KERG_GENERATE_TEMP_REPORT





The ABAP code below is a full code listing to execute function module KERG_GENERATE_TEMP_REPORT including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_e_repid  TYPE SY-REPID ,
it_i_t_valuefields  TYPE STANDARD TABLE OF SBIWA_T_FIELDS,"TABLES PARAM
wa_i_t_valuefields  LIKE LINE OF it_i_t_valuefields ,
it_i_t_calckeyf  TYPE STANDARD TABLE OF SBIWA_T_FIELDS,"TABLES PARAM
wa_i_t_calckeyf  LIKE LINE OF it_i_t_calckeyf .


SELECT single ERKRS
FROM TKEBWL
INTO @DATA(ld_i_erkrs).


SELECT single ISOURCE
FROM TKEBWL
INTO @DATA(ld_i_isource).


SELECT single FNAM_PART
FROM TKEBWL
INTO @DATA(ld_i_fnam_part).


SELECT single TRANSTRUC
FROM TKEBWLG
INTO @DATA(ld_i_transtruc).


SELECT single NAME
FROM TRDIR
INTO @DATA(ld_i_template).


"populate fields of struture and append to itab
append wa_i_t_valuefields to it_i_t_valuefields.

"populate fields of struture and append to itab
append wa_i_t_calckeyf to it_i_t_calckeyf. . CALL FUNCTION 'KERG_GENERATE_TEMP_REPORT' * EXPORTING * i_erkrs = ld_i_erkrs * i_isource = ld_i_isource * i_fnam_part = ld_i_fnam_part * i_transtruc = ld_i_transtruc * i_template = ld_i_template IMPORTING e_repid = ld_e_repid * TABLES * i_t_valuefields = it_i_t_valuefields * i_t_calckeyf = it_i_t_calckeyf EXCEPTIONS TEMPLATE_NOT_FOUND = 1 UNKNOWN_GENERATION_SHORTCUT = 2 SYNTAX_ERROR_IN_GEN_PROG = 3 VARIABLE_SUBST_FAILED = 4 . " KERG_GENERATE_TEMP_REPORT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_repid  TYPE SY-REPID ,
ld_i_erkrs  TYPE TKEBWL-ERKRS ,
it_i_t_valuefields  TYPE STANDARD TABLE OF SBIWA_T_FIELDS ,
wa_i_t_valuefields  LIKE LINE OF it_i_t_valuefields,
ld_i_isource  TYPE TKEBWL-ISOURCE ,
it_i_t_calckeyf  TYPE STANDARD TABLE OF SBIWA_T_FIELDS ,
wa_i_t_calckeyf  LIKE LINE OF it_i_t_calckeyf,
ld_i_fnam_part  TYPE TKEBWL-FNAM_PART ,
ld_i_transtruc  TYPE TKEBWLG-TRANSTRUC ,
ld_i_template  TYPE TRDIR-NAME .


SELECT single ERKRS
FROM TKEBWL
INTO ld_i_erkrs.


"populate fields of struture and append to itab
append wa_i_t_valuefields to it_i_t_valuefields.

SELECT single ISOURCE
FROM TKEBWL
INTO ld_i_isource.


"populate fields of struture and append to itab
append wa_i_t_calckeyf to it_i_t_calckeyf.

SELECT single FNAM_PART
FROM TKEBWL
INTO ld_i_fnam_part.


SELECT single TRANSTRUC
FROM TKEBWLG
INTO ld_i_transtruc.


SELECT single NAME
FROM TRDIR
INTO ld_i_template.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name KERG_GENERATE_TEMP_REPORT or its description.