SAP MARC_SERNP Function Module for NOTRANSL: Prüfen Serialnummernprofil
MARC_SERNP is a standard marc sernp 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: Prüfen Serialnummernprofil 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 marc sernp FM, simply by entering the name MARC_SERNP into the relevant SAP transaction such as SE37 or SE38.
Function Group: MG09
Program Name: SAPLMG09
Main Program: SAPLMG09
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MARC_SERNP 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 'MARC_SERNP'"NOTRANSL: Prüfen Serialnummernprofil.
EXPORTING
WMARC_SERNP = "Serial Number Profile
* P_MESSAGE = ' ' "
* WMARC_WERKS = "Plant
WMARC_XCHPF = "Batch Mgmt Req. Ind.
WMARC_BWTTY = "
* WMARC_RGEKZ = "
WMARA_MEINS = "Base Unit of Measure
WRMMG1_MATNR = "Material Number
LMARC_SERNP = "
WMBEW_BWTAR = "Valuation Type
KZ_MEINS_DIMLESS = "
IMPORTING
WMARC_SERNP = "Serial Number Profile
KZ_MEINS_DIMLESS = "
EXCEPTIONS
MEINS_NOT_DIMLESS = 1 SER_EXIST = 2 RGEKZ_EXIST = 3
IMPORTING Parameters details for MARC_SERNP
WMARC_SERNP - Serial Number Profile
Data type: MARC-SERNPOptional: No
Call by Reference: No ( called with pass by value option)
P_MESSAGE -
Data type: RMMG08_012-MSGTYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WMARC_WERKS - Plant
Data type: MARC-WERKSOptional: Yes
Call by Reference: No ( called with pass by value option)
WMARC_XCHPF - Batch Mgmt Req. Ind.
Data type: MARC-XCHPFOptional: No
Call by Reference: No ( called with pass by value option)
WMARC_BWTTY -
Data type: MARC-BWTTYOptional: No
Call by Reference: No ( called with pass by value option)
WMARC_RGEKZ -
Data type: MARC-RGEKZOptional: Yes
Call by Reference: No ( called with pass by value option)
WMARA_MEINS - Base Unit of Measure
Data type: MARA-MEINSOptional: No
Call by Reference: No ( called with pass by value option)
WRMMG1_MATNR - Material Number
Data type: RMMG1-MATNROptional: No
Call by Reference: No ( called with pass by value option)
LMARC_SERNP -
Data type: MARC-SERNPOptional: No
Call by Reference: No ( called with pass by value option)
WMBEW_BWTAR - Valuation Type
Data type: MBEW-BWTAROptional: No
Call by Reference: Yes
KZ_MEINS_DIMLESS -
Data type: T130F-KZREFOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MARC_SERNP
WMARC_SERNP - Serial Number Profile
Data type: MARC-SERNPOptional: No
Call by Reference: No ( called with pass by value option)
KZ_MEINS_DIMLESS -
Data type: T130F-KZREFOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
MEINS_NOT_DIMLESS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SER_EXIST -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RGEKZ_EXIST -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MARC_SERNP 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_wmarc_sernp | TYPE MARC-SERNP, " | |||
| lv_wmarc_sernp | TYPE MARC-SERNP, " | |||
| lv_meins_not_dimless | TYPE MARC, " | |||
| lv_p_message | TYPE RMMG08_012-MSGTYP, " SPACE | |||
| lv_wmarc_werks | TYPE MARC-WERKS, " | |||
| lv_ser_exist | TYPE MARC, " | |||
| lv_wmarc_xchpf | TYPE MARC-XCHPF, " | |||
| lv_kz_meins_dimless | TYPE T130F-KZREF, " | |||
| lv_rgekz_exist | TYPE T130F, " | |||
| lv_wmarc_bwtty | TYPE MARC-BWTTY, " | |||
| lv_wmarc_rgekz | TYPE MARC-RGEKZ, " | |||
| lv_wmara_meins | TYPE MARA-MEINS, " | |||
| lv_wrmmg1_matnr | TYPE RMMG1-MATNR, " | |||
| lv_lmarc_sernp | TYPE MARC-SERNP, " | |||
| lv_wmbew_bwtar | TYPE MBEW-BWTAR, " | |||
| lv_kz_meins_dimless | TYPE T130F-KZREF. " |
|   CALL FUNCTION 'MARC_SERNP' "NOTRANSL: Prüfen Serialnummernprofil |
| EXPORTING | ||
| WMARC_SERNP | = lv_wmarc_sernp | |
| P_MESSAGE | = lv_p_message | |
| WMARC_WERKS | = lv_wmarc_werks | |
| WMARC_XCHPF | = lv_wmarc_xchpf | |
| WMARC_BWTTY | = lv_wmarc_bwtty | |
| WMARC_RGEKZ | = lv_wmarc_rgekz | |
| WMARA_MEINS | = lv_wmara_meins | |
| WRMMG1_MATNR | = lv_wrmmg1_matnr | |
| LMARC_SERNP | = lv_lmarc_sernp | |
| WMBEW_BWTAR | = lv_wmbew_bwtar | |
| KZ_MEINS_DIMLESS | = lv_kz_meins_dimless | |
| IMPORTING | ||
| WMARC_SERNP | = lv_wmarc_sernp | |
| KZ_MEINS_DIMLESS | = lv_kz_meins_dimless | |
| EXCEPTIONS | ||
| MEINS_NOT_DIMLESS = 1 | ||
| SER_EXIST = 2 | ||
| RGEKZ_EXIST = 3 | ||
| . " MARC_SERNP | ||
ABAP code using 7.40 inline data declarations to call FM MARC_SERNP
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 SERNP FROM MARC INTO @DATA(ld_wmarc_sernp). | ||||
| "SELECT single SERNP FROM MARC INTO @DATA(ld_wmarc_sernp). | ||||
| "SELECT single MSGTYP FROM RMMG08_012 INTO @DATA(ld_p_message). | ||||
| DATA(ld_p_message) | = ' '. | |||
| "SELECT single WERKS FROM MARC INTO @DATA(ld_wmarc_werks). | ||||
| "SELECT single XCHPF FROM MARC INTO @DATA(ld_wmarc_xchpf). | ||||
| "SELECT single KZREF FROM T130F INTO @DATA(ld_kz_meins_dimless). | ||||
| "SELECT single BWTTY FROM MARC INTO @DATA(ld_wmarc_bwtty). | ||||
| "SELECT single RGEKZ FROM MARC INTO @DATA(ld_wmarc_rgekz). | ||||
| "SELECT single MEINS FROM MARA INTO @DATA(ld_wmara_meins). | ||||
| "SELECT single MATNR FROM RMMG1 INTO @DATA(ld_wrmmg1_matnr). | ||||
| "SELECT single SERNP FROM MARC INTO @DATA(ld_lmarc_sernp). | ||||
| "SELECT single BWTAR FROM MBEW INTO @DATA(ld_wmbew_bwtar). | ||||
| "SELECT single KZREF FROM T130F INTO @DATA(ld_kz_meins_dimless). | ||||
Search for further information about these or an SAP related objects