SAP Function Modules

ISH_KHSTATV2003_INIT SAP Function module







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

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


Pattern for FM ISH_KHSTATV2003_INIT - ISH KHSTATV2003 INIT





CALL FUNCTION 'ISH_KHSTATV2003_INIT' "
  EXPORTING
    i_einri =                   " tn01-einri
    i_ausbegdt =                " sy-datum
    i_ausenddt =                " sy-datum
    i_fatyp =                   " fatyp
    i_exthosp24 =               " ri_bwart
  TABLES
    it_fachr_hierarchie =       " rnkhstatv2002_fachr
    it_ent_kh =                 " rnrangebwart
    it_auf_kh =                 " rnrangebwart
    it_tot =                    " rnrangebwart
    it_orgid =                  " rnsorgid
    it_falar =                  " rnrangefalar
    it_tnkfh =                  " rntnkfh
    it_norg =                   " rnnorg
    it_bwart_newborn =          " rnrangebwart
    .  "  ISH_KHSTATV2003_INIT

ABAP code example for Function Module ISH_KHSTATV2003_INIT





The ABAP code below is a full code listing to execute function module ISH_KHSTATV2003_INIT 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:
it_it_fachr_hierarchie  TYPE STANDARD TABLE OF RNKHSTATV2002_FACHR,"TABLES PARAM
wa_it_fachr_hierarchie  LIKE LINE OF it_it_fachr_hierarchie ,
it_it_ent_kh  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_ent_kh  LIKE LINE OF it_it_ent_kh ,
it_it_auf_kh  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_auf_kh  LIKE LINE OF it_it_auf_kh ,
it_it_tot  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_tot  LIKE LINE OF it_it_tot ,
it_it_orgid  TYPE STANDARD TABLE OF RNSORGID,"TABLES PARAM
wa_it_orgid  LIKE LINE OF it_it_orgid ,
it_it_falar  TYPE STANDARD TABLE OF RNRANGEFALAR,"TABLES PARAM
wa_it_falar  LIKE LINE OF it_it_falar ,
it_it_tnkfh  TYPE STANDARD TABLE OF RNTNKFH,"TABLES PARAM
wa_it_tnkfh  LIKE LINE OF it_it_tnkfh ,
it_it_norg  TYPE STANDARD TABLE OF RNNORG,"TABLES PARAM
wa_it_norg  LIKE LINE OF it_it_norg ,
it_it_bwart_newborn  TYPE STANDARD TABLE OF RNRANGEBWART,"TABLES PARAM
wa_it_bwart_newborn  LIKE LINE OF it_it_bwart_newborn .


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

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

"populate fields of struture and append to itab
append wa_it_fachr_hierarchie to it_it_fachr_hierarchie.

"populate fields of struture and append to itab
append wa_it_ent_kh to it_it_ent_kh.

"populate fields of struture and append to itab
append wa_it_auf_kh to it_it_auf_kh.

"populate fields of struture and append to itab
append wa_it_tot to it_it_tot.

"populate fields of struture and append to itab
append wa_it_orgid to it_it_orgid.

"populate fields of struture and append to itab
append wa_it_falar to it_it_falar.

"populate fields of struture and append to itab
append wa_it_tnkfh to it_it_tnkfh.

"populate fields of struture and append to itab
append wa_it_norg to it_it_norg.

"populate fields of struture and append to itab
append wa_it_bwart_newborn to it_it_bwart_newborn. . CALL FUNCTION 'ISH_KHSTATV2003_INIT' EXPORTING i_einri = ld_i_einri i_ausbegdt = ld_i_ausbegdt i_ausenddt = ld_i_ausenddt i_fatyp = ld_i_fatyp i_exthosp24 = ld_i_exthosp24 TABLES it_fachr_hierarchie = it_it_fachr_hierarchie it_ent_kh = it_it_ent_kh it_auf_kh = it_it_auf_kh it_tot = it_it_tot it_orgid = it_it_orgid it_falar = it_it_falar it_tnkfh = it_it_tnkfh it_norg = it_it_norg it_bwart_newborn = it_it_bwart_newborn . " ISH_KHSTATV2003_INIT
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_i_einri  TYPE TN01-EINRI ,
it_it_fachr_hierarchie  TYPE STANDARD TABLE OF RNKHSTATV2002_FACHR ,
wa_it_fachr_hierarchie  LIKE LINE OF it_it_fachr_hierarchie,
ld_i_ausbegdt  TYPE SY-DATUM ,
it_it_ent_kh  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_ent_kh  LIKE LINE OF it_it_ent_kh,
ld_i_ausenddt  TYPE SY-DATUM ,
it_it_auf_kh  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_auf_kh  LIKE LINE OF it_it_auf_kh,
ld_i_fatyp  TYPE FATYP ,
it_it_tot  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_tot  LIKE LINE OF it_it_tot,
ld_i_exthosp24  TYPE RI_BWART ,
it_it_orgid  TYPE STANDARD TABLE OF RNSORGID ,
wa_it_orgid  LIKE LINE OF it_it_orgid,
it_it_falar  TYPE STANDARD TABLE OF RNRANGEFALAR ,
wa_it_falar  LIKE LINE OF it_it_falar,
it_it_tnkfh  TYPE STANDARD TABLE OF RNTNKFH ,
wa_it_tnkfh  LIKE LINE OF it_it_tnkfh,
it_it_norg  TYPE STANDARD TABLE OF RNNORG ,
wa_it_norg  LIKE LINE OF it_it_norg,
it_it_bwart_newborn  TYPE STANDARD TABLE OF RNRANGEBWART ,
wa_it_bwart_newborn  LIKE LINE OF it_it_bwart_newborn.


SELECT single EINRI
FROM TN01
INTO ld_i_einri.


"populate fields of struture and append to itab
append wa_it_fachr_hierarchie to it_it_fachr_hierarchie.
ld_i_ausbegdt = '20210129'.

"populate fields of struture and append to itab
append wa_it_ent_kh to it_it_ent_kh.
ld_i_ausenddt = '20210129'.

"populate fields of struture and append to itab
append wa_it_auf_kh to it_it_auf_kh.
ld_i_fatyp = '20210129'.

"populate fields of struture and append to itab
append wa_it_tot to it_it_tot.
ld_i_exthosp24 = '20210129'.

"populate fields of struture and append to itab
append wa_it_orgid to it_it_orgid.

"populate fields of struture and append to itab
append wa_it_falar to it_it_falar.

"populate fields of struture and append to itab
append wa_it_tnkfh to it_it_tnkfh.

"populate fields of struture and append to itab
append wa_it_norg to it_it_norg.

"populate fields of struture and append to itab
append wa_it_bwart_newborn to it_it_bwart_newborn.

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