SAP CHANGE_BATCH_STATUS_SERNR Function Module for NOTRANSL: Chargenzustandsänderung mit Serialnummern
CHANGE_BATCH_STATUS_SERNR is a standard change batch status sernr SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Chargenzustandsänderung mit Serialnummern 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 change batch status sernr FM, simply by entering the name CHANGE_BATCH_STATUS_SERNR into the relevant SAP transaction such as SE37 or SE38.
Function Group: IPW1
Program Name: SAPLIPW1
Main Program: SAPLIPW1
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CHANGE_BATCH_STATUS_SERNR 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 'CHANGE_BATCH_STATUS_SERNR'"NOTRANSL: Chargenzustandsänderung mit Serialnummern.
EXPORTING
M_CHARGE = "
MBLNR = "Material Document Number
MJAHR = "
BLART = "
BWART = "Movement Type
SHKZG = "Debit/Credit Indicator
LBBSA_OLD = "
LBBSA_NEW = "
BUDAT = "Posting Date in the Document
CHANGING
* T_SMESG = "Message table message collector
TABLES
BS_PLANT_TABLE = "
EXCEPTIONS
NO_SERIALNUMBERS = 1 SERIALNUMBER_ERRORS = 2
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_SAPLIPW1_001 Automatic Serial Number Assignment
EXIT_SAPLIPW1_002 Check on Copying Object List
EXIT_SAPLIPW1_003 Serial Numbers, User Exit for Additional Fields
EXIT_SAPLIPW1_004 Serial Numbers, User Exit After Exiting the Serial Screen
EXIT_SAPLIPW1_008 Check of Serial Number - Character String
IMPORTING Parameters details for CHANGE_BATCH_STATUS_SERNR
M_CHARGE -
Data type: SER03-CHARGEOptional: No
Call by Reference: No ( called with pass by value option)
MBLNR - Material Document Number
Data type: SER03-MBLNROptional: No
Call by Reference: No ( called with pass by value option)
MJAHR -
Data type: SER03-MJAHROptional: No
Call by Reference: No ( called with pass by value option)
BLART -
Data type: SER03-BLARTOptional: No
Call by Reference: No ( called with pass by value option)
BWART - Movement Type
Data type: SER03-BWARTOptional: No
Call by Reference: No ( called with pass by value option)
SHKZG - Debit/Credit Indicator
Data type: SER03-SHKZGOptional: No
Call by Reference: No ( called with pass by value option)
LBBSA_OLD -
Data type: EQBS-LBBSAOptional: No
Call by Reference: No ( called with pass by value option)
LBBSA_NEW -
Data type: EQBS-LBBSAOptional: No
Call by Reference: No ( called with pass by value option)
BUDAT - Posting Date in the Document
Data type: MKPF-BUDATOptional: No
Call by Reference: Yes
CHANGING Parameters details for CHANGE_BATCH_STATUS_SERNR
T_SMESG - Message table message collector
Data type: TSMESGOptional: Yes
Call by Reference: Yes
TABLES Parameters details for CHANGE_BATCH_STATUS_SERNR
BS_PLANT_TABLE -
Data type: BATCH_PLANT_SERNPOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_SERIALNUMBERS -
Data type:Optional: No
Call by Reference: Yes
SERIALNUMBER_ERRORS -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CHANGE_BATCH_STATUS_SERNR 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_t_smesg | TYPE TSMESG, " | |||
| lv_m_charge | TYPE SER03-CHARGE, " | |||
| lt_bs_plant_table | TYPE STANDARD TABLE OF BATCH_PLANT_SERNP, " | |||
| lv_no_serialnumbers | TYPE BATCH_PLANT_SERNP, " | |||
| lv_mblnr | TYPE SER03-MBLNR, " | |||
| lv_serialnumber_errors | TYPE SER03, " | |||
| lv_mjahr | TYPE SER03-MJAHR, " | |||
| lv_blart | TYPE SER03-BLART, " | |||
| lv_bwart | TYPE SER03-BWART, " | |||
| lv_shkzg | TYPE SER03-SHKZG, " | |||
| lv_lbbsa_old | TYPE EQBS-LBBSA, " | |||
| lv_lbbsa_new | TYPE EQBS-LBBSA, " | |||
| lv_budat | TYPE MKPF-BUDAT. " |
|   CALL FUNCTION 'CHANGE_BATCH_STATUS_SERNR' "NOTRANSL: Chargenzustandsänderung mit Serialnummern |
| EXPORTING | ||
| M_CHARGE | = lv_m_charge | |
| MBLNR | = lv_mblnr | |
| MJAHR | = lv_mjahr | |
| BLART | = lv_blart | |
| BWART | = lv_bwart | |
| SHKZG | = lv_shkzg | |
| LBBSA_OLD | = lv_lbbsa_old | |
| LBBSA_NEW | = lv_lbbsa_new | |
| BUDAT | = lv_budat | |
| CHANGING | ||
| T_SMESG | = lv_t_smesg | |
| TABLES | ||
| BS_PLANT_TABLE | = lt_bs_plant_table | |
| EXCEPTIONS | ||
| NO_SERIALNUMBERS = 1 | ||
| SERIALNUMBER_ERRORS = 2 | ||
| . " CHANGE_BATCH_STATUS_SERNR | ||
ABAP code using 7.40 inline data declarations to call FM CHANGE_BATCH_STATUS_SERNR
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 CHARGE FROM SER03 INTO @DATA(ld_m_charge). | ||||
| "SELECT single MBLNR FROM SER03 INTO @DATA(ld_mblnr). | ||||
| "SELECT single MJAHR FROM SER03 INTO @DATA(ld_mjahr). | ||||
| "SELECT single BLART FROM SER03 INTO @DATA(ld_blart). | ||||
| "SELECT single BWART FROM SER03 INTO @DATA(ld_bwart). | ||||
| "SELECT single SHKZG FROM SER03 INTO @DATA(ld_shkzg). | ||||
| "SELECT single LBBSA FROM EQBS INTO @DATA(ld_lbbsa_old). | ||||
| "SELECT single LBBSA FROM EQBS INTO @DATA(ld_lbbsa_new). | ||||
| "SELECT single BUDAT FROM MKPF INTO @DATA(ld_budat). | ||||
Search for further information about these or an SAP related objects