SAP Function Modules

K_VARIANCES_BATCH_LIST_WRITE SAP Function module







K_VARIANCES_BATCH_LIST_WRITE 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 K_VARIANCES_BATCH_LIST_WRITE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM K_VARIANCES_BATCH_LIST_WRITE - K VARIANCES BATCH LIST WRITE





CALL FUNCTION 'K_VARIANCES_BATCH_LIST_WRITE' "
  EXPORTING
    i_user =                    " c
    i_data_saved =              " sy-input
    i_cumul =                   " c
    i_err_count =               " kss10-err_count
    i_err_max =                 " kss10-err_max
    i_gjahr1 =                  " kss10-gjahr1
*   i_gjahr2 = SPACE            " kss10-gjahr2
    i_perio1 =                  " kss10-perio1
*   i_perio2 = SPACE            " kss10-perio2
*   i_varnr =                   " kss10-varnr
*   i_sortfname_1 =             " kdfit-fieldname
*   i_sortfname_2 =             " kdfit-fieldname
*   i_sortfname_3 =             " kdfit-fieldname
*   i_xdesc =                   " kss20-xdesc
*   i_batch_sum =               " sy-input
*   i_filter =                  " kdlit-fieldname
*   i_filter_val =              "
*   i_obj_var_alv =             " obj_var_alv_tab
*   i_listparam =               " obj_list_param_46a
*   i_log_data =                " obj_log_data
*   i_ls_rl =                   " schedman_ext
*   i_ls_message =              " schedman_message
*   i_report =                  " syrepid
*   i_test =                    " obj_var_global-test
*   i_prtxt =                   " pri_params-prtxt
*   i_plist =                   " pri_params-plist
  IMPORTING
    e_schedman_ls_ext =         " schedman_ext
  TABLES
    result =                    " kss03
    t_kv20a =                   " kv20a
*   et_spool =                  " schedman_spool
    .  "  K_VARIANCES_BATCH_LIST_WRITE

ABAP code example for Function Module K_VARIANCES_BATCH_LIST_WRITE





The ABAP code below is a full code listing to execute function module K_VARIANCES_BATCH_LIST_WRITE 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_schedman_ls_ext  TYPE SCHEDMAN_EXT ,
it_result  TYPE STANDARD TABLE OF KSS03,"TABLES PARAM
wa_result  LIKE LINE OF it_result ,
it_t_kv20a  TYPE STANDARD TABLE OF KV20A,"TABLES PARAM
wa_t_kv20a  LIKE LINE OF it_t_kv20a ,
it_et_spool  TYPE STANDARD TABLE OF SCHEDMAN_SPOOL,"TABLES PARAM
wa_et_spool  LIKE LINE OF it_et_spool .

DATA(ld_i_user) = 'Check type of data required'.
DATA(ld_i_data_saved) = 'some text here'.
DATA(ld_i_cumul) = 'some text here'.

DATA(ld_i_err_count) = 123

DATA(ld_i_err_max) = some text here

DATA(ld_i_gjahr1) = Check type of data required

DATA(ld_i_gjahr2) = Check type of data required

DATA(ld_i_perio1) = Check type of data required

DATA(ld_i_perio2) = Check type of data required

DATA(ld_i_varnr) = some text here

DATA(ld_i_sortfname_1) = some text here

DATA(ld_i_sortfname_2) = some text here

DATA(ld_i_sortfname_3) = some text here

DATA(ld_i_xdesc) = some text here
DATA(ld_i_batch_sum) = 'some text here'.

DATA(ld_i_filter) = some text here
DATA(ld_i_filter_val) = 'some text here'.
DATA(ld_i_obj_var_alv) = 'some text here'.
DATA(ld_i_listparam) = 'some text here'.
DATA(ld_i_log_data) = 'some text here'.
DATA(ld_i_ls_rl) = 'some text here'.
DATA(ld_i_ls_message) = 'some text here'.
DATA(ld_i_report) = 'some text here'.

DATA(ld_i_test) = some text here

DATA(ld_i_prtxt) = some text here

DATA(ld_i_plist) = some text here

"populate fields of struture and append to itab
append wa_result to it_result.

"populate fields of struture and append to itab
append wa_t_kv20a to it_t_kv20a.

"populate fields of struture and append to itab
append wa_et_spool to it_et_spool. . CALL FUNCTION 'K_VARIANCES_BATCH_LIST_WRITE' EXPORTING i_user = ld_i_user i_data_saved = ld_i_data_saved i_cumul = ld_i_cumul i_err_count = ld_i_err_count i_err_max = ld_i_err_max i_gjahr1 = ld_i_gjahr1 * i_gjahr2 = ld_i_gjahr2 i_perio1 = ld_i_perio1 * i_perio2 = ld_i_perio2 * i_varnr = ld_i_varnr * i_sortfname_1 = ld_i_sortfname_1 * i_sortfname_2 = ld_i_sortfname_2 * i_sortfname_3 = ld_i_sortfname_3 * i_xdesc = ld_i_xdesc * i_batch_sum = ld_i_batch_sum * i_filter = ld_i_filter * i_filter_val = ld_i_filter_val * i_obj_var_alv = ld_i_obj_var_alv * i_listparam = ld_i_listparam * i_log_data = ld_i_log_data * i_ls_rl = ld_i_ls_rl * i_ls_message = ld_i_ls_message * i_report = ld_i_report * i_test = ld_i_test * i_prtxt = ld_i_prtxt * i_plist = ld_i_plist IMPORTING e_schedman_ls_ext = ld_e_schedman_ls_ext TABLES result = it_result t_kv20a = it_t_kv20a * et_spool = it_et_spool . " K_VARIANCES_BATCH_LIST_WRITE
IF SY-SUBRC EQ 0. "All OK 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_schedman_ls_ext  TYPE SCHEDMAN_EXT ,
ld_i_user  TYPE C ,
it_result  TYPE STANDARD TABLE OF KSS03 ,
wa_result  LIKE LINE OF it_result,
ld_i_data_saved  TYPE SY-INPUT ,
it_t_kv20a  TYPE STANDARD TABLE OF KV20A ,
wa_t_kv20a  LIKE LINE OF it_t_kv20a,
ld_i_cumul  TYPE C ,
it_et_spool  TYPE STANDARD TABLE OF SCHEDMAN_SPOOL ,
wa_et_spool  LIKE LINE OF it_et_spool,
ld_i_err_count  TYPE KSS10-ERR_COUNT ,
ld_i_err_max  TYPE KSS10-ERR_MAX ,
ld_i_gjahr1  TYPE KSS10-GJAHR1 ,
ld_i_gjahr2  TYPE KSS10-GJAHR2 ,
ld_i_perio1  TYPE KSS10-PERIO1 ,
ld_i_perio2  TYPE KSS10-PERIO2 ,
ld_i_varnr  TYPE KSS10-VARNR ,
ld_i_sortfname_1  TYPE KDFIT-FIELDNAME ,
ld_i_sortfname_2  TYPE KDFIT-FIELDNAME ,
ld_i_sortfname_3  TYPE KDFIT-FIELDNAME ,
ld_i_xdesc  TYPE KSS20-XDESC ,
ld_i_batch_sum  TYPE SY-INPUT ,
ld_i_filter  TYPE KDLIT-FIELDNAME ,
ld_i_filter_val  TYPE STRING ,
ld_i_obj_var_alv  TYPE OBJ_VAR_ALV_TAB ,
ld_i_listparam  TYPE OBJ_LIST_PARAM_46A ,
ld_i_log_data  TYPE OBJ_LOG_DATA ,
ld_i_ls_rl  TYPE SCHEDMAN_EXT ,
ld_i_ls_message  TYPE SCHEDMAN_MESSAGE ,
ld_i_report  TYPE SYREPID ,
ld_i_test  TYPE OBJ_VAR_GLOBAL-TEST ,
ld_i_prtxt  TYPE PRI_PARAMS-PRTXT ,
ld_i_plist  TYPE PRI_PARAMS-PLIST .

ld_i_user = 'some text here'.

"populate fields of struture and append to itab
append wa_result to it_result.
ld_i_data_saved = 'some text here'.

"populate fields of struture and append to itab
append wa_t_kv20a to it_t_kv20a.
ld_i_cumul = 'some text here'.

"populate fields of struture and append to itab
append wa_et_spool to it_et_spool.

ld_i_err_count = 123

ld_i_err_max = some text here

ld_i_gjahr1 = Check type of data required

ld_i_gjahr2 = Check type of data required

ld_i_perio1 = Check type of data required

ld_i_perio2 = Check type of data required

ld_i_varnr = some text here

ld_i_sortfname_1 = some text here

ld_i_sortfname_2 = some text here

ld_i_sortfname_3 = some text here

ld_i_xdesc = some text here
ld_i_batch_sum = 'some text here'.

ld_i_filter = some text here
ld_i_filter_val = 'some text here'.
ld_i_obj_var_alv = 'some text here'.
ld_i_listparam = 'some text here'.
ld_i_log_data = 'some text here'.
ld_i_ls_rl = 'some text here'.
ld_i_ls_message = 'some text here'.
ld_i_report = 'some text here'.

ld_i_test = some text here

ld_i_prtxt = some text here

ld_i_plist = some text here

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 K_VARIANCES_BATCH_LIST_WRITE or its description.