SAP Function Modules

RV_AVAILABILITY_CHECK SAP Function module - Create a List with ATP Quantities per Material and Plant







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

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


Pattern for FM RV_AVAILABILITY_CHECK - RV AVAILABILITY CHECK





CALL FUNCTION 'RV_AVAILABILITY_CHECK' "Create a List with ATP Quantities per Material and Plant
  EXPORTING
*   aufrufer = 'A'              " tmvfp-obvfp   Calling application
    beleg =                     " vbak-vbeln    Edited document
*   call_modus = SPACE          " sy-batch
*   ergebnisuebergabe = SPACE   " tvta-revfp
    material =                  " vbap-matnr
    position =                  " vbap-posnr
*   vbtyp = SPACE               " vbak-vbtyp
    werk =                      " vbap-werks
*   i_kuwev = SPACE             " kuwev
*   dialog_force = SPACE        "
*   trtyp_v_force = SPACE       " force_trtypv_delivery_atp  ATP Check for Deliveries: Check Mode Change Transaction
*   vgtyp = SPACE               " vbak-vbtyp    Sales Document Category
*   logic_cont =                " v03v_logic_cont  V03V: Control String for ATP Flow and Logic
  IMPORTING
    dialog =                    "
    sperre =                    " tmvf-acenq
    setdelta =                  "
  TABLES
    avbbd =                     " bv03v
    xmverf_pos =                " v03v_xmverf_pos
*   mdvpk_qu =                  " cv03v
*   vvbfs =                     " vbfs
*   xekpo =                     " ekpo
*   xeket =                     " eket
*   quota =                     " qv03v
*   iquota =                    " iv03v
*   xquot_vb =                  " quot_vb
*   xquot_ch =                  " quot_ch
*   xcatalogue =                " atpfield
    .  "  RV_AVAILABILITY_CHECK

ABAP code example for Function Module RV_AVAILABILITY_CHECK





The ABAP code below is a full code listing to execute function module RV_AVAILABILITY_CHECK 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_dialog  TYPE STRING ,
ld_sperre  TYPE TMVF-ACENQ ,
ld_setdelta  TYPE STRING ,
it_avbbd  TYPE STANDARD TABLE OF BV03V,"TABLES PARAM
wa_avbbd  LIKE LINE OF it_avbbd ,
it_xmverf_pos  TYPE STANDARD TABLE OF V03V_XMVERF_POS,"TABLES PARAM
wa_xmverf_pos  LIKE LINE OF it_xmverf_pos ,
it_mdvpk_qu  TYPE STANDARD TABLE OF CV03V,"TABLES PARAM
wa_mdvpk_qu  LIKE LINE OF it_mdvpk_qu ,
it_vvbfs  TYPE STANDARD TABLE OF VBFS,"TABLES PARAM
wa_vvbfs  LIKE LINE OF it_vvbfs ,
it_xekpo  TYPE STANDARD TABLE OF EKPO,"TABLES PARAM
wa_xekpo  LIKE LINE OF it_xekpo ,
it_xeket  TYPE STANDARD TABLE OF EKET,"TABLES PARAM
wa_xeket  LIKE LINE OF it_xeket ,
it_quota  TYPE STANDARD TABLE OF QV03V,"TABLES PARAM
wa_quota  LIKE LINE OF it_quota ,
it_iquota  TYPE STANDARD TABLE OF IV03V,"TABLES PARAM
wa_iquota  LIKE LINE OF it_iquota ,
it_xquot_vb  TYPE STANDARD TABLE OF QUOT_VB,"TABLES PARAM
wa_xquot_vb  LIKE LINE OF it_xquot_vb ,
it_xquot_ch  TYPE STANDARD TABLE OF QUOT_CH,"TABLES PARAM
wa_xquot_ch  LIKE LINE OF it_xquot_ch ,
it_xcatalogue  TYPE STANDARD TABLE OF ATPFIELD,"TABLES PARAM
wa_xcatalogue  LIKE LINE OF it_xcatalogue .


SELECT single OBVFP
FROM TMVFP
INTO @DATA(ld_aufrufer).


SELECT single VBELN
FROM VBAK
INTO @DATA(ld_beleg).

DATA(ld_call_modus) = 'some text here'.

SELECT single REVFP
FROM TVTA
INTO @DATA(ld_ergebnisuebergabe).


SELECT single MATNR
FROM VBAP
INTO @DATA(ld_material).


SELECT single POSNR
FROM VBAP
INTO @DATA(ld_position).


SELECT single VBTYP
FROM VBAK
INTO @DATA(ld_vbtyp).


SELECT single WERKS
FROM VBAP
INTO @DATA(ld_werk).

DATA(ld_i_kuwev) = 'some text here'.
DATA(ld_dialog_force) = 'some text here'.
DATA(ld_trtyp_v_force) = 'some text here'.

SELECT single VBTYP
FROM VBAK
INTO @DATA(ld_vgtyp).

DATA(ld_logic_cont) = 'some text here'.

"populate fields of struture and append to itab
append wa_avbbd to it_avbbd.

"populate fields of struture and append to itab
append wa_xmverf_pos to it_xmverf_pos.

"populate fields of struture and append to itab
append wa_mdvpk_qu to it_mdvpk_qu.

"populate fields of struture and append to itab
append wa_vvbfs to it_vvbfs.

"populate fields of struture and append to itab
append wa_xekpo to it_xekpo.

"populate fields of struture and append to itab
append wa_xeket to it_xeket.

"populate fields of struture and append to itab
append wa_quota to it_quota.

"populate fields of struture and append to itab
append wa_iquota to it_iquota.

"populate fields of struture and append to itab
append wa_xquot_vb to it_xquot_vb.

"populate fields of struture and append to itab
append wa_xquot_ch to it_xquot_ch.

"populate fields of struture and append to itab
append wa_xcatalogue to it_xcatalogue. . CALL FUNCTION 'RV_AVAILABILITY_CHECK' EXPORTING * aufrufer = ld_aufrufer beleg = ld_beleg * call_modus = ld_call_modus * ergebnisuebergabe = ld_ergebnisuebergabe material = ld_material position = ld_position * vbtyp = ld_vbtyp werk = ld_werk * i_kuwev = ld_i_kuwev * dialog_force = ld_dialog_force * trtyp_v_force = ld_trtyp_v_force * vgtyp = ld_vgtyp * logic_cont = ld_logic_cont IMPORTING dialog = ld_dialog sperre = ld_sperre setdelta = ld_setdelta TABLES avbbd = it_avbbd xmverf_pos = it_xmverf_pos * mdvpk_qu = it_mdvpk_qu * vvbfs = it_vvbfs * xekpo = it_xekpo * xeket = it_xeket * quota = it_quota * iquota = it_iquota * xquot_vb = it_xquot_vb * xquot_ch = it_xquot_ch * xcatalogue = it_xcatalogue . " RV_AVAILABILITY_CHECK
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_dialog  TYPE STRING ,
ld_aufrufer  TYPE TMVFP-OBVFP ,
it_avbbd  TYPE STANDARD TABLE OF BV03V ,
wa_avbbd  LIKE LINE OF it_avbbd,
ld_sperre  TYPE TMVF-ACENQ ,
ld_beleg  TYPE VBAK-VBELN ,
it_xmverf_pos  TYPE STANDARD TABLE OF V03V_XMVERF_POS ,
wa_xmverf_pos  LIKE LINE OF it_xmverf_pos,
ld_setdelta  TYPE STRING ,
ld_call_modus  TYPE SY-BATCH ,
it_mdvpk_qu  TYPE STANDARD TABLE OF CV03V ,
wa_mdvpk_qu  LIKE LINE OF it_mdvpk_qu,
ld_ergebnisuebergabe  TYPE TVTA-REVFP ,
it_vvbfs  TYPE STANDARD TABLE OF VBFS ,
wa_vvbfs  LIKE LINE OF it_vvbfs,
ld_material  TYPE VBAP-MATNR ,
it_xekpo  TYPE STANDARD TABLE OF EKPO ,
wa_xekpo  LIKE LINE OF it_xekpo,
ld_position  TYPE VBAP-POSNR ,
it_xeket  TYPE STANDARD TABLE OF EKET ,
wa_xeket  LIKE LINE OF it_xeket,
ld_vbtyp  TYPE VBAK-VBTYP ,
it_quota  TYPE STANDARD TABLE OF QV03V ,
wa_quota  LIKE LINE OF it_quota,
ld_werk  TYPE VBAP-WERKS ,
it_iquota  TYPE STANDARD TABLE OF IV03V ,
wa_iquota  LIKE LINE OF it_iquota,
it_xquot_vb  TYPE STANDARD TABLE OF QUOT_VB ,
wa_xquot_vb  LIKE LINE OF it_xquot_vb,
ld_i_kuwev  TYPE KUWEV ,
it_xquot_ch  TYPE STANDARD TABLE OF QUOT_CH ,
wa_xquot_ch  LIKE LINE OF it_xquot_ch,
ld_dialog_force  TYPE STRING ,
it_xcatalogue  TYPE STANDARD TABLE OF ATPFIELD ,
wa_xcatalogue  LIKE LINE OF it_xcatalogue,
ld_trtyp_v_force  TYPE FORCE_TRTYPV_DELIVERY_ATP ,
ld_vgtyp  TYPE VBAK-VBTYP ,
ld_logic_cont  TYPE V03V_LOGIC_CONT .


SELECT single OBVFP
FROM TMVFP
INTO ld_aufrufer.


"populate fields of struture and append to itab
append wa_avbbd to it_avbbd.

SELECT single VBELN
FROM VBAK
INTO ld_beleg.


"populate fields of struture and append to itab
append wa_xmverf_pos to it_xmverf_pos.
ld_call_modus = 'some text here'.

"populate fields of struture and append to itab
append wa_mdvpk_qu to it_mdvpk_qu.

SELECT single REVFP
FROM TVTA
INTO ld_ergebnisuebergabe.


"populate fields of struture and append to itab
append wa_vvbfs to it_vvbfs.

SELECT single MATNR
FROM VBAP
INTO ld_material.


"populate fields of struture and append to itab
append wa_xekpo to it_xekpo.

SELECT single POSNR
FROM VBAP
INTO ld_position.


"populate fields of struture and append to itab
append wa_xeket to it_xeket.

SELECT single VBTYP
FROM VBAK
INTO ld_vbtyp.


"populate fields of struture and append to itab
append wa_quota to it_quota.

SELECT single WERKS
FROM VBAP
INTO ld_werk.


"populate fields of struture and append to itab
append wa_iquota to it_iquota.

"populate fields of struture and append to itab
append wa_xquot_vb to it_xquot_vb.
ld_i_kuwev = 'some text here'.

"populate fields of struture and append to itab
append wa_xquot_ch to it_xquot_ch.
ld_dialog_force = 'some text here'.

"populate fields of struture and append to itab
append wa_xcatalogue to it_xcatalogue.
ld_trtyp_v_force = 'some text here'.

SELECT single VBTYP
FROM VBAK
INTO ld_vgtyp.

ld_logic_cont = '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 RV_AVAILABILITY_CHECK or its description.