SAP Function Modules

OIU_VA_AVG_TEST_FOR_MONTH SAP Function module - Average Test For The Month (AM) Theoretical Calc Method







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

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


Pattern for FM OIU_VA_AVG_TEST_FOR_MONTH - OIU VA AVG TEST FOR MONTH





CALL FUNCTION 'OIU_VA_AVG_TEST_FOR_MONTH' "Average Test For The Month (AM) Theoretical Calc Method
  EXPORTING
    i_eff_from_dt =             " oiu_pr_wctcm-eff_from_dt
    i_eff_to_dt =               " oiu_pr_wctcm-eff_to_dt
    i_wl_no =                   " oiu_pr_wctcm-wl_no
    i_wc_no =                   " oiu_pr_wctcm-wc_no
*   i_rto_cd =                  " oiu_pr_wctcm-rto_cd
*   i_wt_majpd_cd =             " oiu_pr_wctcm-wt_majpd_cd
    i_strm_type_cd =            " oiu_pr_wcdt-strm_type_cd
*   i_tst_qy =                  " oiu_pr_wctcm-tst_qy
    i_majpd =                   " roiu_pr_request-majpd_cd
*   i_prd_hrs =                 " oiu_pr_wcdt-hrs  Number of Hours
*   i_vt_cd =                   " roiu_pr_dnap-vt_cd
    i_request =                 " roiu_pr_request
  IMPORTING
    e_theo_vol =                " oiupr_vol_fac  Volumes and Factor
  EXCEPTIONS
    FATAL_ERROR = 1             "
    WARNING_ERROR = 2           "
    .  "  OIU_VA_AVG_TEST_FOR_MONTH

ABAP code example for Function Module OIU_VA_AVG_TEST_FOR_MONTH





The ABAP code below is a full code listing to execute function module OIU_VA_AVG_TEST_FOR_MONTH 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_theo_vol  TYPE OIUPR_VOL_FAC .


SELECT single EFF_FROM_DT
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_eff_from_dt).


SELECT single EFF_TO_DT
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_eff_to_dt).


SELECT single WL_NO
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_wl_no).


SELECT single WC_NO
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_wc_no).


SELECT single RTO_CD
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_rto_cd).


SELECT single WT_MAJPD_CD
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_wt_majpd_cd).


SELECT single STRM_TYPE_CD
FROM OIU_PR_WCDT
INTO @DATA(ld_i_strm_type_cd).


SELECT single TST_QY
FROM OIU_PR_WCTCM
INTO @DATA(ld_i_tst_qy).


DATA(ld_i_majpd) = some text here

SELECT single HRS
FROM OIU_PR_WCDT
INTO @DATA(ld_i_prd_hrs).


DATA(ld_i_vt_cd) = some text here
DATA(ld_i_request) = 'Check type of data required'. . CALL FUNCTION 'OIU_VA_AVG_TEST_FOR_MONTH' EXPORTING i_eff_from_dt = ld_i_eff_from_dt i_eff_to_dt = ld_i_eff_to_dt i_wl_no = ld_i_wl_no i_wc_no = ld_i_wc_no * i_rto_cd = ld_i_rto_cd * i_wt_majpd_cd = ld_i_wt_majpd_cd i_strm_type_cd = ld_i_strm_type_cd * i_tst_qy = ld_i_tst_qy i_majpd = ld_i_majpd * i_prd_hrs = ld_i_prd_hrs * i_vt_cd = ld_i_vt_cd i_request = ld_i_request IMPORTING e_theo_vol = ld_e_theo_vol EXCEPTIONS FATAL_ERROR = 1 WARNING_ERROR = 2 . " OIU_VA_AVG_TEST_FOR_MONTH
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 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_theo_vol  TYPE OIUPR_VOL_FAC ,
ld_i_eff_from_dt  TYPE OIU_PR_WCTCM-EFF_FROM_DT ,
ld_i_eff_to_dt  TYPE OIU_PR_WCTCM-EFF_TO_DT ,
ld_i_wl_no  TYPE OIU_PR_WCTCM-WL_NO ,
ld_i_wc_no  TYPE OIU_PR_WCTCM-WC_NO ,
ld_i_rto_cd  TYPE OIU_PR_WCTCM-RTO_CD ,
ld_i_wt_majpd_cd  TYPE OIU_PR_WCTCM-WT_MAJPD_CD ,
ld_i_strm_type_cd  TYPE OIU_PR_WCDT-STRM_TYPE_CD ,
ld_i_tst_qy  TYPE OIU_PR_WCTCM-TST_QY ,
ld_i_majpd  TYPE ROIU_PR_REQUEST-MAJPD_CD ,
ld_i_prd_hrs  TYPE OIU_PR_WCDT-HRS ,
ld_i_vt_cd  TYPE ROIU_PR_DNAP-VT_CD ,
ld_i_request  TYPE ROIU_PR_REQUEST .


SELECT single EFF_FROM_DT
FROM OIU_PR_WCTCM
INTO ld_i_eff_from_dt.


SELECT single EFF_TO_DT
FROM OIU_PR_WCTCM
INTO ld_i_eff_to_dt.


SELECT single WL_NO
FROM OIU_PR_WCTCM
INTO ld_i_wl_no.


SELECT single WC_NO
FROM OIU_PR_WCTCM
INTO ld_i_wc_no.


SELECT single RTO_CD
FROM OIU_PR_WCTCM
INTO ld_i_rto_cd.


SELECT single WT_MAJPD_CD
FROM OIU_PR_WCTCM
INTO ld_i_wt_majpd_cd.


SELECT single STRM_TYPE_CD
FROM OIU_PR_WCDT
INTO ld_i_strm_type_cd.


SELECT single TST_QY
FROM OIU_PR_WCTCM
INTO ld_i_tst_qy.


ld_i_majpd = some text here

SELECT single HRS
FROM OIU_PR_WCDT
INTO ld_i_prd_hrs.


ld_i_vt_cd = some text here
ld_i_request = 'Check type of data required'.

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