SAP BAPI_STANDARDMATERIAL_CREATE Function Module for Create/Extend Material









BAPI_STANDARDMATERIAL_CREATE is a standard bapi standardmaterial create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create/Extend Material 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 bapi standardmaterial create FM, simply by entering the name BAPI_STANDARDMATERIAL_CREATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: 1001DIA
Program Name: SAPL1001DIA
Main Program: SAPL1001DIA
Appliation area: M
Release date: 05-Mar-1999
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_STANDARDMATERIAL_CREATE 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 'BAPI_STANDARDMATERIAL_CREATE'"Create/Extend Material
EXPORTING
* NEWMATERIAL = ' ' "Number of new material
* NEWMATERIAL_EVG = "Long Material Number

IMPORTING
MATERIAL = "Number of new material
NEWMATERIAL = "Number of new material
RETURN = "Return Parameter
* MATERIAL_EVG = "
* NEWMATERIAL_EVG = "Long Material Number
.



IMPORTING Parameters details for BAPI_STANDARDMATERIAL_CREATE

NEWMATERIAL - Number of new material

Data type: BAPIMATALL-MATERIAL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NEWMATERIAL_EVG - Long Material Number

Data type: BAPIMGVMATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_STANDARDMATERIAL_CREATE

MATERIAL - Number of new material

Data type: BAPIMATALL-MATERIAL
Optional: No
Call by Reference: No ( called with pass by value option)

NEWMATERIAL - Number of new material

Data type: BAPIMATALL-MATERIAL
Optional: No
Call by Reference: No ( called with pass by value option)

RETURN - Return Parameter

Data type: BAPIRET1
Optional: No
Call by Reference: No ( called with pass by value option)

MATERIAL_EVG -

Data type: BAPIMGVMATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

NEWMATERIAL_EVG - Long Material Number

Data type: BAPIMGVMATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_STANDARDMATERIAL_CREATE 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_material  TYPE BAPIMATALL-MATERIAL, "   
lv_newmaterial  TYPE BAPIMATALL-MATERIAL, "   SPACE
lv_newmaterial  TYPE BAPIMATALL-MATERIAL, "   
lv_newmaterial_evg  TYPE BAPIMGVMATNR, "   
lv_return  TYPE BAPIRET1, "   
lv_material_evg  TYPE BAPIMGVMATNR, "   
lv_newmaterial_evg  TYPE BAPIMGVMATNR. "   

  CALL FUNCTION 'BAPI_STANDARDMATERIAL_CREATE'  "Create/Extend Material
    EXPORTING
         NEWMATERIAL = lv_newmaterial
         NEWMATERIAL_EVG = lv_newmaterial_evg
    IMPORTING
         MATERIAL = lv_material
         NEWMATERIAL = lv_newmaterial
         RETURN = lv_return
         MATERIAL_EVG = lv_material_evg
         NEWMATERIAL_EVG = lv_newmaterial_evg
. " BAPI_STANDARDMATERIAL_CREATE




ABAP code using 7.40 inline data declarations to call FM BAPI_STANDARDMATERIAL_CREATE

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 MATERIAL FROM BAPIMATALL INTO @DATA(ld_material).
 
"SELECT single MATERIAL FROM BAPIMATALL INTO @DATA(ld_newmaterial).
DATA(ld_newmaterial) = ' '.
 
"SELECT single MATERIAL FROM BAPIMATALL INTO @DATA(ld_newmaterial).
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!