SAP Function Modules

VBSK_DATA_COLLECT SAP Function module - FM FOR V.21







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

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


Pattern for FM VBSK_DATA_COLLECT - VBSK DATA COLLECT





CALL FUNCTION 'VBSK_DATA_COLLECT' "FM FOR V.21
  EXPORTING
    werror = 'X'                " abap_bool
    oerror = 'X'                " abap_bool
    on_cance =                  " abap_bool
    smart =                     " vbsk-smart    Group type
  TABLES
    samnr =                     " range_samnr   Transfer Structure for Select Options
    gt_xvbsk =                  " vbsk          Collective Processing for a Sales Document Header
    vstel =                     " range_vstel   Transfer Structure for Select Options
    ernam =                     " range_ernam   Transfer Structure for Select Options
    erdat =                     " jbidkondsel   Transfer Structure for Select Options
  CHANGING
    ld_rc =                     " int4          Natural number
    .  "  VBSK_DATA_COLLECT

ABAP code example for Function Module VBSK_DATA_COLLECT





The ABAP code below is a full code listing to execute function module VBSK_DATA_COLLECT 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_samnr  TYPE STANDARD TABLE OF RANGE_SAMNR,"TABLES PARAM
wa_samnr  LIKE LINE OF it_samnr ,
it_gt_xvbsk  TYPE STANDARD TABLE OF VBSK,"TABLES PARAM
wa_gt_xvbsk  LIKE LINE OF it_gt_xvbsk ,
it_vstel  TYPE STANDARD TABLE OF RANGE_VSTEL,"TABLES PARAM
wa_vstel  LIKE LINE OF it_vstel ,
it_ernam  TYPE STANDARD TABLE OF RANGE_ERNAM,"TABLES PARAM
wa_ernam  LIKE LINE OF it_ernam ,
it_erdat  TYPE STANDARD TABLE OF JBIDKONDSEL,"TABLES PARAM
wa_erdat  LIKE LINE OF it_erdat .

DATA(ld_ld_rc) = 'Check type of data required'.
DATA(ld_werror) = 'Check type of data required'.
DATA(ld_oerror) = 'Check type of data required'.
DATA(ld_on_cance) = 'Check type of data required'.

SELECT single SMART
FROM VBSK
INTO @DATA(ld_smart).


"populate fields of struture and append to itab
append wa_samnr to it_samnr.

"populate fields of struture and append to itab
append wa_gt_xvbsk to it_gt_xvbsk.

"populate fields of struture and append to itab
append wa_vstel to it_vstel.

"populate fields of struture and append to itab
append wa_ernam to it_ernam.

"populate fields of struture and append to itab
append wa_erdat to it_erdat. . CALL FUNCTION 'VBSK_DATA_COLLECT' EXPORTING werror = ld_werror oerror = ld_oerror on_cance = ld_on_cance smart = ld_smart TABLES samnr = it_samnr gt_xvbsk = it_gt_xvbsk vstel = it_vstel ernam = it_ernam erdat = it_erdat CHANGING ld_rc = ld_ld_rc . " VBSK_DATA_COLLECT
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_ld_rc  TYPE INT4 ,
ld_werror  TYPE ABAP_BOOL ,
it_samnr  TYPE STANDARD TABLE OF RANGE_SAMNR ,
wa_samnr  LIKE LINE OF it_samnr,
ld_oerror  TYPE ABAP_BOOL ,
it_gt_xvbsk  TYPE STANDARD TABLE OF VBSK ,
wa_gt_xvbsk  LIKE LINE OF it_gt_xvbsk,
ld_on_cance  TYPE ABAP_BOOL ,
it_vstel  TYPE STANDARD TABLE OF RANGE_VSTEL ,
wa_vstel  LIKE LINE OF it_vstel,
ld_smart  TYPE VBSK-SMART ,
it_ernam  TYPE STANDARD TABLE OF RANGE_ERNAM ,
wa_ernam  LIKE LINE OF it_ernam,
it_erdat  TYPE STANDARD TABLE OF JBIDKONDSEL ,
wa_erdat  LIKE LINE OF it_erdat.

ld_ld_rc = 'Check type of data required'.
ld_werror = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_samnr to it_samnr.
ld_oerror = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_gt_xvbsk to it_gt_xvbsk.
ld_on_cance = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_vstel to it_vstel.

SELECT single SMART
FROM VBSK
INTO ld_smart.


"populate fields of struture and append to itab
append wa_ernam to it_ernam.

"populate fields of struture and append to itab
append wa_erdat to it_erdat.

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