SAP VB_BATCH_GET_DETAIL Function Module for Display Batch
VB_BATCH_GET_DETAIL is a standard vb batch get detail SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Display Batch 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 vb batch get detail FM, simply by entering the name VB_BATCH_GET_DETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: V01Z
Program Name: SAPLV01Z
Main Program: SAPLV01Z
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function VB_BATCH_GET_DETAIL 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 'VB_BATCH_GET_DETAIL'"Display Batch.
EXPORTING
MATNR = "Reference Material
* CHARG = "
* WERKS = "Reference Plant
* GET_CLASSIFICATION = "
* EXISTENCE_CHECK = "
* READ_FROM_BUFFER = "Checkbox
* NO_CLASS_INIT = ' ' "Checkbox
* LOCK_BATCH = ' ' "Lock Mode
IMPORTING
YMCHA = "
CLASSNAME = "
TABLES
* CHAR_OF_BATCH = "
EXCEPTIONS
NO_MATERIAL = 1 NO_BATCH = 2 NO_PLANT = 3 MATERIAL_NOT_FOUND = 4 PLANT_NOT_FOUND = 5 NO_AUTHORITY = 6 BATCH_NOT_EXIST = 7 LOCK_ON_BATCH = 8
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLV01Z_001 Determination of Internal Number Ranges for Automatic Batch Number
EXIT_SAPLV01Z_002 Modification of New Batch Numbers (from Internal Assignment)
EXIT_SAPLV01Z_003 Determination of External Number Ranges for Batch Number
EXIT_SAPLV01Z_004 Check New Batch Number According to Customer Rule
EXIT_SAPLV01Z_005 Check Batch Status if Change Carried Out
EXIT_SAPLV01Z_006 Check Batch Valuation if Change Carried Out
EXIT_SAPLV01Z_011 Create Determination of Source Batch
EXIT_SAPLV01Z_012 Type of Batch Classification
EXIT_SAPLV01Z_013 Master Data Maintenance for Batches
EXIT_SAPLV01Z_014 Enhanced Classification for Batches
IMPORTING Parameters details for VB_BATCH_GET_DETAIL
MATNR - Reference Material
Data type: MARA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
CHARG -
Data type: MCH1-CHARGOptional: Yes
Call by Reference: No ( called with pass by value option)
WERKS - Reference Plant
Data type: T001W-WERKSOptional: Yes
Call by Reference: No ( called with pass by value option)
GET_CLASSIFICATION -
Data type: AM07M-XSELKOptional: Yes
Call by Reference: No ( called with pass by value option)
EXISTENCE_CHECK -
Data type: AM07M-XSELKOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_FROM_BUFFER - Checkbox
Data type: AM07M-XSELKOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_CLASS_INIT - Checkbox
Data type: AM07M-XSELKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOCK_BATCH - Lock Mode
Data type: ENQMODEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for VB_BATCH_GET_DETAIL
YMCHA -
Data type: MCHAOptional: No
Call by Reference: No ( called with pass by value option)
CLASSNAME -
Data type: KLAH-CLASSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for VB_BATCH_GET_DETAIL
CHAR_OF_BATCH -
Data type: CLBATCHOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_MATERIAL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BATCH -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PLANT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MATERIAL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PLANT_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BATCH_NOT_EXIST -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCK_ON_BATCH -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for VB_BATCH_GET_DETAIL 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_matnr | TYPE MARA-MATNR, " | |||
| lv_ymcha | TYPE MCHA, " | |||
| lv_no_material | TYPE MCHA, " | |||
| lt_char_of_batch | TYPE STANDARD TABLE OF CLBATCH, " | |||
| lv_charg | TYPE MCH1-CHARG, " | |||
| lv_no_batch | TYPE MCH1, " | |||
| lv_classname | TYPE KLAH-CLASS, " | |||
| lv_werks | TYPE T001W-WERKS, " | |||
| lv_no_plant | TYPE T001W, " | |||
| lv_get_classification | TYPE AM07M-XSELK, " | |||
| lv_material_not_found | TYPE AM07M, " | |||
| lv_existence_check | TYPE AM07M-XSELK, " | |||
| lv_plant_not_found | TYPE AM07M, " | |||
| lv_no_authority | TYPE AM07M, " | |||
| lv_read_from_buffer | TYPE AM07M-XSELK, " | |||
| lv_no_class_init | TYPE AM07M-XSELK, " SPACE | |||
| lv_batch_not_exist | TYPE AM07M, " | |||
| lv_lock_batch | TYPE ENQMODE, " SPACE | |||
| lv_lock_on_batch | TYPE ENQMODE. " |
|   CALL FUNCTION 'VB_BATCH_GET_DETAIL' "Display Batch |
| EXPORTING | ||
| MATNR | = lv_matnr | |
| CHARG | = lv_charg | |
| WERKS | = lv_werks | |
| GET_CLASSIFICATION | = lv_get_classification | |
| EXISTENCE_CHECK | = lv_existence_check | |
| READ_FROM_BUFFER | = lv_read_from_buffer | |
| NO_CLASS_INIT | = lv_no_class_init | |
| LOCK_BATCH | = lv_lock_batch | |
| IMPORTING | ||
| YMCHA | = lv_ymcha | |
| CLASSNAME | = lv_classname | |
| TABLES | ||
| CHAR_OF_BATCH | = lt_char_of_batch | |
| EXCEPTIONS | ||
| NO_MATERIAL = 1 | ||
| NO_BATCH = 2 | ||
| NO_PLANT = 3 | ||
| MATERIAL_NOT_FOUND = 4 | ||
| PLANT_NOT_FOUND = 5 | ||
| NO_AUTHORITY = 6 | ||
| BATCH_NOT_EXIST = 7 | ||
| LOCK_ON_BATCH = 8 | ||
| . " VB_BATCH_GET_DETAIL | ||
ABAP code using 7.40 inline data declarations to call FM VB_BATCH_GET_DETAIL
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.| "SELECT single MATNR FROM MARA INTO @DATA(ld_matnr). | ||||
| "SELECT single CHARG FROM MCH1 INTO @DATA(ld_charg). | ||||
| "SELECT single CLASS FROM KLAH INTO @DATA(ld_classname). | ||||
| "SELECT single WERKS FROM T001W INTO @DATA(ld_werks). | ||||
| "SELECT single XSELK FROM AM07M INTO @DATA(ld_get_classification). | ||||
| "SELECT single XSELK FROM AM07M INTO @DATA(ld_existence_check). | ||||
| "SELECT single XSELK FROM AM07M INTO @DATA(ld_read_from_buffer). | ||||
| "SELECT single XSELK FROM AM07M INTO @DATA(ld_no_class_init). | ||||
| DATA(ld_no_class_init) | = ' '. | |||
| DATA(ld_lock_batch) | = ' '. | |||
Search for further information about these or an SAP related objects