SAP VBSK_DATA_COLLECT_PRE_OPT Function Module for FM fior SDSAMPRO
VBSK_DATA_COLLECT_PRE_OPT is a standard vbsk data collect pre opt SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for FM fior SDSAMPRO processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for vbsk data collect pre opt FM, simply by entering the name VBSK_DATA_COLLECT_PRE_OPT into the relevant SAP transaction such as SE37 or SE38.
Function Group: V_21
Program Name: SAPLV_21
Main Program: SAPLV_21
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function VBSK_DATA_COLLECT_PRE_OPT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'VBSK_DATA_COLLECT_PRE_OPT'"FM fior SDSAMPRO.
EXPORTING
* WERROR = 'X' "
* OERROR = 'X' "
ON_CANCE = "
SMART = "Group type
CHANGING
LD_RC = "Natural Number
TABLES
SAMNR = "Transfer Structure for Select Options
GT_XVBSK = "Collective Processing for a Sales Document Header
VSTEL = "Transfer Structure for Select Options
ERNAM = "Transfer Structure for Select Options
ERDAT = "Transfer Structure for Select Options
IMPORTING Parameters details for VBSK_DATA_COLLECT_PRE_OPT
WERROR -
Data type: ABAP_BOOLDefault: 'X'
Optional: No
Call by Reference: Yes
OERROR -
Data type: ABAP_BOOLDefault: 'X'
Optional: No
Call by Reference: Yes
ON_CANCE -
Data type: ABAP_BOOLOptional: No
Call by Reference: Yes
SMART - Group type
Data type: VBSK-SMARTOptional: No
Call by Reference: Yes
CHANGING Parameters details for VBSK_DATA_COLLECT_PRE_OPT
LD_RC - Natural Number
Data type: INT4Optional: No
Call by Reference: Yes
TABLES Parameters details for VBSK_DATA_COLLECT_PRE_OPT
SAMNR - Transfer Structure for Select Options
Data type: RANGE_SAMNROptional: No
Call by Reference: Yes
GT_XVBSK - Collective Processing for a Sales Document Header
Data type: VBSKOptional: No
Call by Reference: Yes
VSTEL - Transfer Structure for Select Options
Data type: RANGE_VSTELOptional: No
Call by Reference: Yes
ERNAM - Transfer Structure for Select Options
Data type: RANGE_ERNAMOptional: No
Call by Reference: Yes
ERDAT - Transfer Structure for Select Options
Data type: JBIDKONDSELOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for VBSK_DATA_COLLECT_PRE_OPT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_ld_rc | TYPE INT4, " | |||
| lt_samnr | TYPE STANDARD TABLE OF RANGE_SAMNR, " | |||
| lv_werror | TYPE ABAP_BOOL, " 'X' | |||
| lv_oerror | TYPE ABAP_BOOL, " 'X' | |||
| lt_gt_xvbsk | TYPE STANDARD TABLE OF VBSK, " | |||
| lt_vstel | TYPE STANDARD TABLE OF RANGE_VSTEL, " | |||
| lv_on_cance | TYPE ABAP_BOOL, " | |||
| lt_ernam | TYPE STANDARD TABLE OF RANGE_ERNAM, " | |||
| lv_smart | TYPE VBSK-SMART, " | |||
| lt_erdat | TYPE STANDARD TABLE OF JBIDKONDSEL. " |
|   CALL FUNCTION 'VBSK_DATA_COLLECT_PRE_OPT' "FM fior SDSAMPRO |
| EXPORTING | ||
| WERROR | = lv_werror | |
| OERROR | = lv_oerror | |
| ON_CANCE | = lv_on_cance | |
| SMART | = lv_smart | |
| CHANGING | ||
| LD_RC | = lv_ld_rc | |
| TABLES | ||
| SAMNR | = lt_samnr | |
| GT_XVBSK | = lt_gt_xvbsk | |
| VSTEL | = lt_vstel | |
| ERNAM | = lt_ernam | |
| ERDAT | = lt_erdat | |
| . " VBSK_DATA_COLLECT_PRE_OPT | ||
ABAP code using 7.40 inline data declarations to call FM VBSK_DATA_COLLECT_PRE_OPT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| DATA(ld_werror) | = 'X'. | |||
| DATA(ld_oerror) | = 'X'. | |||
| "SELECT single SMART FROM VBSK INTO @DATA(ld_smart). | ||||
Search for further information about these or an SAP related objects