VB_CREATE_BATCH 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 VB_CREATE_BATCH into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
V01Z
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'VB_CREATE_BATCH' "Create Batch
* EXPORTING
* new_lgort = " mchb-lgort Storage location of batch
* bypass_lock = SPACE " am07m-xselk Communication Structure
* message_when_auto = SPACE " am07m-xselk
* x_bncom = " bncom Communication Structure
* qm_zustd = " dm07m-qm_zustd
* ref_matnr = " mcha-matnr Reference Material
* ref_charg = " mcha-charg
* ref_werks = " mcha-werks Reference Plant
* kzcla = " t156-kzcla
* xkcfc = " t156-xkcfc
* class = " klah-class
* no_check_of_qm_char = SPACE " am07m-xselk
* buffer_refresh = SPACE " am07m-xselk
* no_change_document = SPACE " am07m-xselk
* check_external = X " am07m-xselk
* check_customer = X " am07m-xselk
* no_cfc_calls = SPACE " am07m-xselk
* no_change_of_bwtar = SPACE " am07m-xselk Checkbox
IMPORTING
ymcha = " mcha
* TABLES
* char_of_batch = " clbatch
* new_batch = " mcha
* new_batch_stoloc = " mchb
* return = " bapiret2 Return Parameter(s)
EXCEPTIONS
NO_MATERIAL = 1 "
NO_BATCH = 2 "
NO_PLANT = 3 "
MATERIAL_NOT_FOUND = 4 "
PLANT_NOT_FOUND = 5 "
STOLOC_NOT_FOUND = 6 "
LOCK_ON_MATERIAL = 7 "
LOCK_ON_PLANT = 8 "
LOCK_ON_BATCH = 9 "
LOCK_SYSTEM_ERROR = 10 "
NO_AUTHORITY = 11 "
BATCH_EXIST = 12 "
STOLOC_EXIST = 13 "
ILLEGAL_BATCH_NUMBER = 14 "
NO_BATCH_HANDLING = 15 "
NO_VALUATION_AREA = 16 "
VALUATION_TYPE_NOT_FOUND = 17 "
NO_VALUATION_FOUND = 18 "
ERROR_AUTOMATIC_BATCH_NUMBER = 19 "
CANCELLED = 20 "
WRONG_STATUS = 21 "
INTERVAL_NOT_FOUND = 22 "
NUMBER_RANGE_NOT_EXTERN = 23 "
OBJECT_NOT_FOUND = 24 "
ERROR_CHECK_BATCH_NUMBER = 25 "
NO_EXTERNAL_NUMBER = 26 "
NO_CUSTOMER_NUMBER = 27 "
NO_CLASS = 28 "
ERROR_IN_CLASSIFICATION = 29 "
INCONSISTENCY_IN_KEY = 30 "
REGION_OF_ORIGIN_NOT_FOUND = 31 "
COUNTRY_OF_ORIGIN_NOT_FOUND = 32 "
. " VB_CREATE_BATCH
The ABAP code below is a full code listing to execute function module VB_CREATE_BATCH 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).
| ld_ymcha | TYPE MCHA , |
| it_char_of_batch | TYPE STANDARD TABLE OF CLBATCH,"TABLES PARAM |
| wa_char_of_batch | LIKE LINE OF it_char_of_batch , |
| it_new_batch | TYPE STANDARD TABLE OF MCHA,"TABLES PARAM |
| wa_new_batch | LIKE LINE OF it_new_batch , |
| it_new_batch_stoloc | TYPE STANDARD TABLE OF MCHB,"TABLES PARAM |
| wa_new_batch_stoloc | LIKE LINE OF it_new_batch_stoloc , |
| it_return | TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM |
| wa_return | LIKE LINE OF it_return . |
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_ymcha | TYPE MCHA , |
| it_char_of_batch | TYPE STANDARD TABLE OF CLBATCH , |
| wa_char_of_batch | LIKE LINE OF it_char_of_batch, |
| ld_new_lgort | TYPE MCHB-LGORT , |
| it_new_batch | TYPE STANDARD TABLE OF MCHA , |
| wa_new_batch | LIKE LINE OF it_new_batch, |
| ld_bypass_lock | TYPE AM07M-XSELK , |
| it_new_batch_stoloc | TYPE STANDARD TABLE OF MCHB , |
| wa_new_batch_stoloc | LIKE LINE OF it_new_batch_stoloc, |
| ld_message_when_auto | TYPE AM07M-XSELK , |
| it_return | TYPE STANDARD TABLE OF BAPIRET2 , |
| wa_return | LIKE LINE OF it_return, |
| ld_x_bncom | TYPE BNCOM , |
| ld_qm_zustd | TYPE DM07M-QM_ZUSTD , |
| ld_ref_matnr | TYPE MCHA-MATNR , |
| ld_ref_charg | TYPE MCHA-CHARG , |
| ld_ref_werks | TYPE MCHA-WERKS , |
| ld_kzcla | TYPE T156-KZCLA , |
| ld_xkcfc | TYPE T156-XKCFC , |
| ld_class | TYPE KLAH-CLASS , |
| ld_no_check_of_qm_char | TYPE AM07M-XSELK , |
| ld_buffer_refresh | TYPE AM07M-XSELK , |
| ld_no_change_document | TYPE AM07M-XSELK , |
| ld_check_external | TYPE AM07M-XSELK , |
| ld_check_customer | TYPE AM07M-XSELK , |
| ld_no_cfc_calls | TYPE AM07M-XSELK , |
| ld_no_change_of_bwtar | TYPE AM07M-XSELK . |
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 VB_CREATE_BATCH or its description.