SAP Function Modules

J_3G_BEST_PRUEF_2_3 SAP Function module - Stock Check for Chronological Inventory Mgmt (With/Without Shrotfall Qty







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

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


Pattern for FM J_3G_BEST_PRUEF_2_3 - J 3G BEST PRUEF 2 3





CALL FUNCTION 'J_3G_BEST_PRUEF_2_3' "Stock Check for Chronological Inventory Mgmt (With/Without Shrotfall Qty)
  EXPORTING
    i_beltyp =                  " j_3gbelart-vbtyp  Document Category
    i_datum =                   " sy-datum      Document Date (Check Date)
*   i_datum_bis = 99991231      " sy-datum      To Date
    i_beweg =                   " j_3gbelk-j_3gbeweg  Movement Indicator
    i_ressource =               " j_3gabest-j_3gressou  Resource
    i_status =                  "               Indicator New/Delete/Cancel/Change
    i_daten =                   " j_3gbelp
  IMPORTING
    e_menge =                   " j_3ghbest-j_3gmenge  Available Quantity
  TABLES
    t_hbest =                   " j_3ghbest     Table With Available Stocks
    t_hbest_out =               " j_3ghbest     Table With Records to be Changed/Deleted
    t_tbest =                   " j_3gtbests
  EXCEPTIONS
    UNIT_FAULT = 1              "               Error During Quantity Conversion
    KEIN_BESTAND = 2            "               Stock for Resource Insufficient
    FOLGEBELEG = 3              "               Follow-On/Subsequent Documents Already Exist
    NO_BESTART = 4              "
    DOPPELTER_ZUGANG = 5        "
    DOPPELTER_VERSAND = 6       "
    ZUGANG_EXISTERT = 7         "
    .  "  J_3G_BEST_PRUEF_2_3

ABAP code example for Function Module J_3G_BEST_PRUEF_2_3





The ABAP code below is a full code listing to execute function module J_3G_BEST_PRUEF_2_3 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_menge  TYPE J_3GHBEST-J_3GMENGE ,
it_t_hbest  TYPE STANDARD TABLE OF J_3GHBEST,"TABLES PARAM
wa_t_hbest  LIKE LINE OF it_t_hbest ,
it_t_hbest_out  TYPE STANDARD TABLE OF J_3GHBEST,"TABLES PARAM
wa_t_hbest_out  LIKE LINE OF it_t_hbest_out ,
it_t_tbest  TYPE STANDARD TABLE OF J_3GTBESTS,"TABLES PARAM
wa_t_tbest  LIKE LINE OF it_t_tbest .


SELECT single VBTYP
FROM J_3GBELART
INTO @DATA(ld_i_beltyp).

DATA(ld_i_datum) = '20210129'.
DATA(ld_i_datum_bis) = '20210129'.

SELECT single J_3GBEWEG
FROM J_3GBELK
INTO @DATA(ld_i_beweg).


SELECT single J_3GRESSOU
FROM J_3GABEST
INTO @DATA(ld_i_ressource).

DATA(ld_i_status) = 'some text here'.
DATA(ld_i_daten) = '20210129'.

"populate fields of struture and append to itab
append wa_t_hbest to it_t_hbest.

"populate fields of struture and append to itab
append wa_t_hbest_out to it_t_hbest_out.

"populate fields of struture and append to itab
append wa_t_tbest to it_t_tbest. . CALL FUNCTION 'J_3G_BEST_PRUEF_2_3' EXPORTING i_beltyp = ld_i_beltyp i_datum = ld_i_datum * i_datum_bis = ld_i_datum_bis i_beweg = ld_i_beweg i_ressource = ld_i_ressource i_status = ld_i_status i_daten = ld_i_daten IMPORTING e_menge = ld_e_menge TABLES t_hbest = it_t_hbest t_hbest_out = it_t_hbest_out t_tbest = it_t_tbest EXCEPTIONS UNIT_FAULT = 1 KEIN_BESTAND = 2 FOLGEBELEG = 3 NO_BESTART = 4 DOPPELTER_ZUGANG = 5 DOPPELTER_VERSAND = 6 ZUGANG_EXISTERT = 7 . " J_3G_BEST_PRUEF_2_3
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "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_menge  TYPE J_3GHBEST-J_3GMENGE ,
ld_i_beltyp  TYPE J_3GBELART-VBTYP ,
it_t_hbest  TYPE STANDARD TABLE OF J_3GHBEST ,
wa_t_hbest  LIKE LINE OF it_t_hbest,
ld_i_datum  TYPE SY-DATUM ,
it_t_hbest_out  TYPE STANDARD TABLE OF J_3GHBEST ,
wa_t_hbest_out  LIKE LINE OF it_t_hbest_out,
ld_i_datum_bis  TYPE SY-DATUM ,
it_t_tbest  TYPE STANDARD TABLE OF J_3GTBESTS ,
wa_t_tbest  LIKE LINE OF it_t_tbest,
ld_i_beweg  TYPE J_3GBELK-J_3GBEWEG ,
ld_i_ressource  TYPE J_3GABEST-J_3GRESSOU ,
ld_i_status  TYPE STRING ,
ld_i_daten  TYPE J_3GBELP .


SELECT single VBTYP
FROM J_3GBELART
INTO ld_i_beltyp.


"populate fields of struture and append to itab
append wa_t_hbest to it_t_hbest.
ld_i_datum = '20210129'.

"populate fields of struture and append to itab
append wa_t_hbest_out to it_t_hbest_out.
ld_i_datum_bis = '20210129'.

"populate fields of struture and append to itab
append wa_t_tbest to it_t_tbest.

SELECT single J_3GBEWEG
FROM J_3GBELK
INTO ld_i_beweg.


SELECT single J_3GRESSOU
FROM J_3GABEST
INTO ld_i_ressource.

ld_i_status = 'some text here'.
ld_i_daten = '20210129'.

SAP Documentation for FM J_3G_BEST_PRUEF_2_3


Check of available stock (initially on chronological inventory management > ARTBES=1) for document type 2 (Equipment shipping ...See here for full SAP fm documentation


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