SAP Function Modules

ISH_KHSTATV2005_INIT_SA5 SAP Function module







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

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


Pattern for FM ISH_KHSTATV2005_INIT_SA5 - ISH KHSTATV2005 INIT SA5





CALL FUNCTION 'ISH_KHSTATV2005_INIT_SA5' "
  EXPORTING
    i_einri =                   " tn01-einri
    i_ausbegdt =                " sy-datum
    i_ausenddt =                " sy-datum
    i_fatyp_beseinri =          " tnkfa-fatyp
  IMPORTING
    e_quartal =                 " quartal
  TABLES
    it_norg_bes_einri =         " rnnorg
    it_fachr_hier_bes_einri =   " rnkhstatv2002_fachr
    it_vstat =                  " rnrangebwart
    it_nstat =                  " rnrangebwart
    .  "  ISH_KHSTATV2005_INIT_SA5

ABAP code example for Function Module ISH_KHSTATV2005_INIT_SA5





The ABAP code below is a full code listing to execute function module ISH_KHSTATV2005_INIT_SA5 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_quartal  TYPE QUARTAL ,
it_it_norg_bes_einri  TYPE STANDARD TABLE OF RNNORG,"TABLES PARAM
wa_it_norg_bes_einri  LIKE LINE OF it_it_norg_bes_einri ,
it_it_fachr_hier_bes_einri  TYPE STANDARD TABLE OF RNKHSTATV2002_FACHR,"TABLES PARAM
wa_it_fachr_hier_bes_einri  LIKE LINE OF it_it_fachr_hier_bes_einri ,
it_it_vstat  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_vstat  LIKE LINE OF it_it_vstat ,
it_it_nstat  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_nstat  LIKE LINE OF it_it_nstat .


SELECT single EINRI
FROM TN01
INTO @DATA(ld_i_einri).

DATA(ld_i_ausbegdt) = '20210129'.
DATA(ld_i_ausenddt) = '20210129'.

SELECT single FATYP
FROM TNKFA
INTO @DATA(ld_i_fatyp_beseinri).


"populate fields of struture and append to itab
append wa_it_norg_bes_einri to it_it_norg_bes_einri.

"populate fields of struture and append to itab
append wa_it_fachr_hier_bes_einri to it_it_fachr_hier_bes_einri.

"populate fields of struture and append to itab
append wa_it_vstat to it_it_vstat.

"populate fields of struture and append to itab
append wa_it_nstat to it_it_nstat. . CALL FUNCTION 'ISH_KHSTATV2005_INIT_SA5' EXPORTING i_einri = ld_i_einri i_ausbegdt = ld_i_ausbegdt i_ausenddt = ld_i_ausenddt i_fatyp_beseinri = ld_i_fatyp_beseinri IMPORTING e_quartal = ld_e_quartal TABLES it_norg_bes_einri = it_it_norg_bes_einri it_fachr_hier_bes_einri = it_it_fachr_hier_bes_einri it_vstat = it_it_vstat it_nstat = it_it_nstat . " ISH_KHSTATV2005_INIT_SA5
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_quartal  TYPE QUARTAL ,
ld_i_einri  TYPE TN01-EINRI ,
it_it_norg_bes_einri  TYPE STANDARD TABLE OF RNNORG ,
wa_it_norg_bes_einri  LIKE LINE OF it_it_norg_bes_einri,
ld_i_ausbegdt  TYPE SY-DATUM ,
it_it_fachr_hier_bes_einri  TYPE STANDARD TABLE OF RNKHSTATV2002_FACHR ,
wa_it_fachr_hier_bes_einri  LIKE LINE OF it_it_fachr_hier_bes_einri,
ld_i_ausenddt  TYPE SY-DATUM ,
it_it_vstat  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_vstat  LIKE LINE OF it_it_vstat,
ld_i_fatyp_beseinri  TYPE TNKFA-FATYP ,
it_it_nstat  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_nstat  LIKE LINE OF it_it_nstat.


SELECT single EINRI
FROM TN01
INTO ld_i_einri.


"populate fields of struture and append to itab
append wa_it_norg_bes_einri to it_it_norg_bes_einri.
ld_i_ausbegdt = '20210129'.

"populate fields of struture and append to itab
append wa_it_fachr_hier_bes_einri to it_it_fachr_hier_bes_einri.
ld_i_ausenddt = '20210129'.

"populate fields of struture and append to itab
append wa_it_vstat to it_it_vstat.

SELECT single FATYP
FROM TNKFA
INTO ld_i_fatyp_beseinri.


"populate fields of struture and append to itab
append wa_it_nstat to it_it_nstat.

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