SAP Function Modules

VBDRV_SA_DATABASE_SELECTION SAP Function module







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

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


Pattern for FM VBDRV_SA_DATABASE_SELECTION - VBDRV SA DATABASE SELECTION





CALL FUNCTION 'VBDRV_SA_DATABASE_SELECTION' "
  EXPORTING
    is_special_stock =          " drvn_sa_special_stock  Batch Derivation, Overall Release: ID "Read Special Stock"
* TABLES
*   it_matnr_range =            " matnr_rang    Range table for material number - general use
*   it_werks_range =            " werks_rang    Range for WERKS
*   it_charg_range =            " sel_charg     Transfer Batch Selection Criteria to Read MCHP
*   it_vfdat_range =            " drvn_datum_range
*   it_hsdat_range =            " drvn_datum_range
*   it_verab_range =            " drvn_datum_range
*   it_qpart_range =            " qrg01         Ranges for the inspection type (data element QPART)
*   it_zusch_range =            " range_c1
*   et_selection =              " drvn_sa
    .  "  VBDRV_SA_DATABASE_SELECTION

ABAP code example for Function Module VBDRV_SA_DATABASE_SELECTION





The ABAP code below is a full code listing to execute function module VBDRV_SA_DATABASE_SELECTION 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_matnr_range  TYPE STANDARD TABLE OF MATNR_RANG,"TABLES PARAM
wa_it_matnr_range  LIKE LINE OF it_it_matnr_range ,
it_it_werks_range  TYPE STANDARD TABLE OF WERKS_RANG,"TABLES PARAM
wa_it_werks_range  LIKE LINE OF it_it_werks_range ,
it_it_charg_range  TYPE STANDARD TABLE OF SEL_CHARG,"TABLES PARAM
wa_it_charg_range  LIKE LINE OF it_it_charg_range ,
it_it_vfdat_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE,"TABLES PARAM
wa_it_vfdat_range  LIKE LINE OF it_it_vfdat_range ,
it_it_hsdat_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE,"TABLES PARAM
wa_it_hsdat_range  LIKE LINE OF it_it_hsdat_range ,
it_it_verab_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE,"TABLES PARAM
wa_it_verab_range  LIKE LINE OF it_it_verab_range ,
it_it_qpart_range  TYPE STANDARD TABLE OF QRG01,"TABLES PARAM
wa_it_qpart_range  LIKE LINE OF it_it_qpart_range ,
it_it_zusch_range  TYPE STANDARD TABLE OF RANGE_C1,"TABLES PARAM
wa_it_zusch_range  LIKE LINE OF it_it_zusch_range ,
it_et_selection  TYPE STANDARD TABLE OF DRVN_SA,"TABLES PARAM
wa_et_selection  LIKE LINE OF it_et_selection .

DATA(ld_is_special_stock) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_matnr_range to it_it_matnr_range.

"populate fields of struture and append to itab
append wa_it_werks_range to it_it_werks_range.

"populate fields of struture and append to itab
append wa_it_charg_range to it_it_charg_range.

"populate fields of struture and append to itab
append wa_it_vfdat_range to it_it_vfdat_range.

"populate fields of struture and append to itab
append wa_it_hsdat_range to it_it_hsdat_range.

"populate fields of struture and append to itab
append wa_it_verab_range to it_it_verab_range.

"populate fields of struture and append to itab
append wa_it_qpart_range to it_it_qpart_range.

"populate fields of struture and append to itab
append wa_it_zusch_range to it_it_zusch_range.

"populate fields of struture and append to itab
append wa_et_selection to it_et_selection. . CALL FUNCTION 'VBDRV_SA_DATABASE_SELECTION' EXPORTING is_special_stock = ld_is_special_stock * TABLES * it_matnr_range = it_it_matnr_range * it_werks_range = it_it_werks_range * it_charg_range = it_it_charg_range * it_vfdat_range = it_it_vfdat_range * it_hsdat_range = it_it_hsdat_range * it_verab_range = it_it_verab_range * it_qpart_range = it_it_qpart_range * it_zusch_range = it_it_zusch_range * et_selection = it_et_selection . " VBDRV_SA_DATABASE_SELECTION
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_is_special_stock  TYPE DRVN_SA_SPECIAL_STOCK ,
it_it_matnr_range  TYPE STANDARD TABLE OF MATNR_RANG ,
wa_it_matnr_range  LIKE LINE OF it_it_matnr_range,
it_it_werks_range  TYPE STANDARD TABLE OF WERKS_RANG ,
wa_it_werks_range  LIKE LINE OF it_it_werks_range,
it_it_charg_range  TYPE STANDARD TABLE OF SEL_CHARG ,
wa_it_charg_range  LIKE LINE OF it_it_charg_range,
it_it_vfdat_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE ,
wa_it_vfdat_range  LIKE LINE OF it_it_vfdat_range,
it_it_hsdat_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE ,
wa_it_hsdat_range  LIKE LINE OF it_it_hsdat_range,
it_it_verab_range  TYPE STANDARD TABLE OF DRVN_DATUM_RANGE ,
wa_it_verab_range  LIKE LINE OF it_it_verab_range,
it_it_qpart_range  TYPE STANDARD TABLE OF QRG01 ,
wa_it_qpart_range  LIKE LINE OF it_it_qpart_range,
it_it_zusch_range  TYPE STANDARD TABLE OF RANGE_C1 ,
wa_it_zusch_range  LIKE LINE OF it_it_zusch_range,
it_et_selection  TYPE STANDARD TABLE OF DRVN_SA ,
wa_et_selection  LIKE LINE OF it_et_selection.

ld_is_special_stock = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_matnr_range to it_it_matnr_range.

"populate fields of struture and append to itab
append wa_it_werks_range to it_it_werks_range.

"populate fields of struture and append to itab
append wa_it_charg_range to it_it_charg_range.

"populate fields of struture and append to itab
append wa_it_vfdat_range to it_it_vfdat_range.

"populate fields of struture and append to itab
append wa_it_hsdat_range to it_it_hsdat_range.

"populate fields of struture and append to itab
append wa_it_verab_range to it_it_verab_range.

"populate fields of struture and append to itab
append wa_it_qpart_range to it_it_qpart_range.

"populate fields of struture and append to itab
append wa_it_zusch_range to it_it_zusch_range.

"populate fields of struture and append to itab
append wa_et_selection to it_et_selection.

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