SAP Function Modules

ISH_KHSTATV2004_SA2_MVMT_CALC SAP Function module







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

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


Pattern for FM ISH_KHSTATV2004_SA2_MVMT_CALC - ISH KHSTATV2004 SA2 MVMT CALC





CALL FUNCTION 'ISH_KHSTATV2004_SA2_MVMT_CALC' "
  EXPORTING
    i_einri =                   " tn01-einri
    i_ausbegdt =                " sy-datum
    i_ausenddt =                " sy-datum
    i_fatyp =                   " fatyp
    i_fachr_insges =            " ish_fachr
*   i_call_for_sa1 = OFF        " xfeld
  TABLES
    it_sa2 =                    " rnkhstatv2002_sa2
    it_ent_kh =                 " rnrangebwart
    it_auf_kh =                 " rnrangebwart
    it_tot =                    " rnrangebwart
    it_bewegungen =             " rnsbew
    it_falldaten =              " rnspat
    it_nfal =                   " nfal
    it_nbew =                   " nbew
    it_nur_intensiv =           " rnsbew
    it_int_tage =               " rnkhstatv2002_int_tage
    it_sa1_faelle_int =         " ish_falnr_struct
    it_sa1_faelle_int_beatmet =   " ish_falnr_struct
    it_sa1_faelle_fa_int =      " ish_falnr_struct
    it_sa1_faelle_fa_int_beatmet =   " ish_falnr_struct
    it_billmode =               " rnkhstatv_billmode
    it_p61_dayservices_nlei =   " nlei
    .  "  ISH_KHSTATV2004_SA2_MVMT_CALC

ABAP code example for Function Module ISH_KHSTATV2004_SA2_MVMT_CALC





The ABAP code below is a full code listing to execute function module ISH_KHSTATV2004_SA2_MVMT_CALC 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_sa2  TYPE STANDARD TABLE OF RNKHSTATV2002_SA2,"TABLES PARAM
wa_it_sa2  LIKE LINE OF it_it_sa2 ,
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_bewegungen  TYPE STANDARD TABLE OF RNSBEW,"TABLES PARAM
wa_it_bewegungen  LIKE LINE OF it_it_bewegungen ,
it_it_falldaten  TYPE STANDARD TABLE OF RNSPAT,"TABLES PARAM
wa_it_falldaten  LIKE LINE OF it_it_falldaten ,
it_it_nfal  TYPE STANDARD TABLE OF NFAL,"TABLES PARAM
wa_it_nfal  LIKE LINE OF it_it_nfal ,
it_it_nbew  TYPE STANDARD TABLE OF NBEW,"TABLES PARAM
wa_it_nbew  LIKE LINE OF it_it_nbew ,
it_it_nur_intensiv  TYPE STANDARD TABLE OF RNSBEW,"TABLES PARAM
wa_it_nur_intensiv  LIKE LINE OF it_it_nur_intensiv ,
it_it_int_tage  TYPE STANDARD TABLE OF RNKHSTATV2002_INT_TAGE,"TABLES PARAM
wa_it_int_tage  LIKE LINE OF it_it_int_tage ,
it_it_sa1_faelle_int  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT,"TABLES PARAM
wa_it_sa1_faelle_int  LIKE LINE OF it_it_sa1_faelle_int ,
it_it_sa1_faelle_int_beatmet  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT,"TABLES PARAM
wa_it_sa1_faelle_int_beatmet  LIKE LINE OF it_it_sa1_faelle_int_beatmet ,
it_it_sa1_faelle_fa_int  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT,"TABLES PARAM
wa_it_sa1_faelle_fa_int  LIKE LINE OF it_it_sa1_faelle_fa_int ,
it_it_sa1_faelle_fa_int_beatmet  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT,"TABLES PARAM
wa_it_sa1_faelle_fa_int_beatmet  LIKE LINE OF it_it_sa1_faelle_fa_int_beatmet ,
it_it_billmode  TYPE STANDARD TABLE OF RNKHSTATV_BILLMODE,"TABLES PARAM
wa_it_billmode  LIKE LINE OF it_it_billmode ,
it_it_p61_dayservices_nlei  TYPE STANDARD TABLE OF NLEI,"TABLES PARAM
wa_it_p61_dayservices_nlei  LIKE LINE OF it_it_p61_dayservices_nlei .


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_fachr_insges) = '20210129'.
DATA(ld_i_call_for_sa1) = '20210129'.

"populate fields of struture and append to itab
append wa_it_sa2 to it_it_sa2.

"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_bewegungen to it_it_bewegungen.

"populate fields of struture and append to itab
append wa_it_falldaten to it_it_falldaten.

"populate fields of struture and append to itab
append wa_it_nfal to it_it_nfal.

"populate fields of struture and append to itab
append wa_it_nbew to it_it_nbew.

"populate fields of struture and append to itab
append wa_it_nur_intensiv to it_it_nur_intensiv.

"populate fields of struture and append to itab
append wa_it_int_tage to it_it_int_tage.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_int to it_it_sa1_faelle_int.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_int_beatmet to it_it_sa1_faelle_int_beatmet.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_fa_int to it_it_sa1_faelle_fa_int.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_fa_int_beatmet to it_it_sa1_faelle_fa_int_beatmet.

"populate fields of struture and append to itab
append wa_it_billmode to it_it_billmode.

"populate fields of struture and append to itab
append wa_it_p61_dayservices_nlei to it_it_p61_dayservices_nlei. . CALL FUNCTION 'ISH_KHSTATV2004_SA2_MVMT_CALC' EXPORTING i_einri = ld_i_einri i_ausbegdt = ld_i_ausbegdt i_ausenddt = ld_i_ausenddt i_fatyp = ld_i_fatyp i_fachr_insges = ld_i_fachr_insges * i_call_for_sa1 = ld_i_call_for_sa1 TABLES it_sa2 = it_it_sa2 it_ent_kh = it_it_ent_kh it_auf_kh = it_it_auf_kh it_tot = it_it_tot it_bewegungen = it_it_bewegungen it_falldaten = it_it_falldaten it_nfal = it_it_nfal it_nbew = it_it_nbew it_nur_intensiv = it_it_nur_intensiv it_int_tage = it_it_int_tage it_sa1_faelle_int = it_it_sa1_faelle_int it_sa1_faelle_int_beatmet = it_it_sa1_faelle_int_beatmet it_sa1_faelle_fa_int = it_it_sa1_faelle_fa_int it_sa1_faelle_fa_int_beatmet = it_it_sa1_faelle_fa_int_beatmet it_billmode = it_it_billmode it_p61_dayservices_nlei = it_it_p61_dayservices_nlei . " ISH_KHSTATV2004_SA2_MVMT_CALC
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_sa2  TYPE STANDARD TABLE OF RNKHSTATV2002_SA2 ,
wa_it_sa2  LIKE LINE OF it_it_sa2,
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,
it_it_bewegungen  TYPE STANDARD TABLE OF RNSBEW ,
wa_it_bewegungen  LIKE LINE OF it_it_bewegungen,
ld_i_fachr_insges  TYPE ISH_FACHR ,
ld_i_call_for_sa1  TYPE XFELD ,
it_it_falldaten  TYPE STANDARD TABLE OF RNSPAT ,
wa_it_falldaten  LIKE LINE OF it_it_falldaten,
it_it_nfal  TYPE STANDARD TABLE OF NFAL ,
wa_it_nfal  LIKE LINE OF it_it_nfal,
it_it_nbew  TYPE STANDARD TABLE OF NBEW ,
wa_it_nbew  LIKE LINE OF it_it_nbew,
it_it_nur_intensiv  TYPE STANDARD TABLE OF RNSBEW ,
wa_it_nur_intensiv  LIKE LINE OF it_it_nur_intensiv,
it_it_int_tage  TYPE STANDARD TABLE OF RNKHSTATV2002_INT_TAGE ,
wa_it_int_tage  LIKE LINE OF it_it_int_tage,
it_it_sa1_faelle_int  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT ,
wa_it_sa1_faelle_int  LIKE LINE OF it_it_sa1_faelle_int,
it_it_sa1_faelle_int_beatmet  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT ,
wa_it_sa1_faelle_int_beatmet  LIKE LINE OF it_it_sa1_faelle_int_beatmet,
it_it_sa1_faelle_fa_int  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT ,
wa_it_sa1_faelle_fa_int  LIKE LINE OF it_it_sa1_faelle_fa_int,
it_it_sa1_faelle_fa_int_beatmet  TYPE STANDARD TABLE OF ISH_FALNR_STRUCT ,
wa_it_sa1_faelle_fa_int_beatmet  LIKE LINE OF it_it_sa1_faelle_fa_int_beatmet,
it_it_billmode  TYPE STANDARD TABLE OF RNKHSTATV_BILLMODE ,
wa_it_billmode  LIKE LINE OF it_it_billmode,
it_it_p61_dayservices_nlei  TYPE STANDARD TABLE OF NLEI ,
wa_it_p61_dayservices_nlei  LIKE LINE OF it_it_p61_dayservices_nlei.


SELECT single EINRI
FROM TN01
INTO ld_i_einri.


"populate fields of struture and append to itab
append wa_it_sa2 to it_it_sa2.
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.

"populate fields of struture and append to itab
append wa_it_bewegungen to it_it_bewegungen.
ld_i_fachr_insges = '20210129'.
ld_i_call_for_sa1 = '20210129'.

"populate fields of struture and append to itab
append wa_it_falldaten to it_it_falldaten.

"populate fields of struture and append to itab
append wa_it_nfal to it_it_nfal.

"populate fields of struture and append to itab
append wa_it_nbew to it_it_nbew.

"populate fields of struture and append to itab
append wa_it_nur_intensiv to it_it_nur_intensiv.

"populate fields of struture and append to itab
append wa_it_int_tage to it_it_int_tage.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_int to it_it_sa1_faelle_int.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_int_beatmet to it_it_sa1_faelle_int_beatmet.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_fa_int to it_it_sa1_faelle_fa_int.

"populate fields of struture and append to itab
append wa_it_sa1_faelle_fa_int_beatmet to it_it_sa1_faelle_fa_int_beatmet.

"populate fields of struture and append to itab
append wa_it_billmode to it_it_billmode.

"populate fields of struture and append to itab
append wa_it_p61_dayservices_nlei to it_it_p61_dayservices_nlei.

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