SAP CBGL_MP07_GEN_DATA_GET Function Module for EHS: Read Material Data









CBGL_MP07_GEN_DATA_GET is a standard cbgl mp07 gen data get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for EHS: Read Material Data 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 cbgl mp07 gen data get FM, simply by entering the name CBGL_MP07_GEN_DATA_GET into the relevant SAP transaction such as SE37 or SE38.

Function Group: CBGL_MP07
Program Name: SAPLCBGL_MP07
Main Program: SAPLCBGL_MP07
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CBGL_MP07_GEN_DATA_GET 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 'CBGL_MP07_GEN_DATA_GET'"EHS: Read Material Data
EXPORTING
I_MATNR = "Material number
* I_WERK = "Plant
* I_FLG_UOM = TRUE "Determine UoMs

IMPORTING
E_PACKING_UOM = "Packaging Unit of Measure
E_WERK = "Plant Table for National (Centrally Agreed) Contracts
E_NAME1 = "Name

TABLES
E_PLANT_TAB = "EHS: Structure for Plant
* E_PACK_HIERARCHY_TAB = "EHS: Packaging Hierarchy
E_SHIP_MOD_TAB = "EHS: Structure for Modes of Transport
E_COUNTRY_TAB = "EHS: Structure for Countries
E_PARAM_TAB = "EHS: Parameter Values for Report Shipping

EXCEPTIONS
HIERARCHY_ERROR = 1 DETERMINATE_OUTERMOST_ERROR = 2 WRONG_PUOM = 3 NO_LABELING_DATA = 4 INTERNAL_ERROR = 5 PLANT_READ_ERROR = 6 READ_PACK_HIERARCHY_ERROR = 7 OVERFLOW = 8
.



IMPORTING Parameters details for CBGL_MP07_GEN_DATA_GET

I_MATNR - Material number

Data type: MATNR
Optional: No
Call by Reference: Yes

I_WERK - Plant

Data type: WERKS_D
Optional: Yes
Call by Reference: Yes

I_FLG_UOM - Determine UoMs

Data type: ESEBOOLE
Default: TRUE
Optional: No
Call by Reference: Yes

EXPORTING Parameters details for CBGL_MP07_GEN_DATA_GET

E_PACKING_UOM - Packaging Unit of Measure

Data type: CBGLE_PUOM
Optional: No
Call by Reference: Yes

E_WERK - Plant Table for National (Centrally Agreed) Contracts

Data type: WERKS_D
Optional: No
Call by Reference: Yes

E_NAME1 - Name

Data type: NAME1
Optional: No
Call by Reference: Yes

TABLES Parameters details for CBGL_MP07_GEN_DATA_GET

E_PLANT_TAB - EHS: Structure for Plant

Data type: CCGLS_PLANT
Optional: No
Call by Reference: Yes

E_PACK_HIERARCHY_TAB - EHS: Packaging Hierarchy

Data type: CCGLS_PACK_HIERARCHY
Optional: Yes
Call by Reference: Yes

E_SHIP_MOD_TAB - EHS: Structure for Modes of Transport

Data type: CCGLS_SHIPPING_MODES
Optional: No
Call by Reference: Yes

E_COUNTRY_TAB - EHS: Structure for Countries

Data type: CCGLS_COUNTRY_TAB
Optional: No
Call by Reference: Yes

E_PARAM_TAB - EHS: Parameter Values for Report Shipping

Data type: CVDDP
Optional: No
Call by Reference: Yes

EXCEPTIONS details

HIERARCHY_ERROR - Hierarchy determination error

Data type:
Optional: No
Call by Reference: Yes

DETERMINATE_OUTERMOST_ERROR - Error determining the shipment packaging unit

Data type:
Optional: No
Call by Reference: Yes

WRONG_PUOM - Incorrect packaging unit

Data type:
Optional: No
Call by Reference: Yes

NO_LABELING_DATA - No Label Data Found

Data type:
Optional: No
Call by Reference: Yes

INTERNAL_ERROR - Internal System Error

Data type:
Optional: No
Call by Reference: Yes

PLANT_READ_ERROR - Plant(s) could not be read

Data type:
Optional: No
Call by Reference: Yes

READ_PACK_HIERARCHY_ERROR - Error reading the packaging hierarchy

Data type:
Optional: No
Call by Reference: Yes

OVERFLOW - Overflow

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for CBGL_MP07_GEN_DATA_GET 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_i_matnr  TYPE MATNR, "   
lt_e_plant_tab  TYPE STANDARD TABLE OF CCGLS_PLANT, "   
lv_e_packing_uom  TYPE CBGLE_PUOM, "   
lv_hierarchy_error  TYPE CBGLE_PUOM, "   
lv_e_werk  TYPE WERKS_D, "   
lv_i_werk  TYPE WERKS_D, "   
lt_e_pack_hierarchy_tab  TYPE STANDARD TABLE OF CCGLS_PACK_HIERARCHY, "   
lv_determinate_outermost_error  TYPE CCGLS_PACK_HIERARCHY, "   
lv_e_name1  TYPE NAME1, "   
lv_i_flg_uom  TYPE ESEBOOLE, "   TRUE
lv_wrong_puom  TYPE ESEBOOLE, "   
lt_e_ship_mod_tab  TYPE STANDARD TABLE OF CCGLS_SHIPPING_MODES, "   
lt_e_country_tab  TYPE STANDARD TABLE OF CCGLS_COUNTRY_TAB, "   
lv_no_labeling_data  TYPE CCGLS_COUNTRY_TAB, "   
lt_e_param_tab  TYPE STANDARD TABLE OF CVDDP, "   
lv_internal_error  TYPE CVDDP, "   
lv_plant_read_error  TYPE CVDDP, "   
lv_read_pack_hierarchy_error  TYPE CVDDP, "   
lv_overflow  TYPE CVDDP. "   

  CALL FUNCTION 'CBGL_MP07_GEN_DATA_GET'  "EHS: Read Material Data
    EXPORTING
         I_MATNR = lv_i_matnr
         I_WERK = lv_i_werk
         I_FLG_UOM = lv_i_flg_uom
    IMPORTING
         E_PACKING_UOM = lv_e_packing_uom
         E_WERK = lv_e_werk
         E_NAME1 = lv_e_name1
    TABLES
         E_PLANT_TAB = lt_e_plant_tab
         E_PACK_HIERARCHY_TAB = lt_e_pack_hierarchy_tab
         E_SHIP_MOD_TAB = lt_e_ship_mod_tab
         E_COUNTRY_TAB = lt_e_country_tab
         E_PARAM_TAB = lt_e_param_tab
    EXCEPTIONS
        HIERARCHY_ERROR = 1
        DETERMINATE_OUTERMOST_ERROR = 2
        WRONG_PUOM = 3
        NO_LABELING_DATA = 4
        INTERNAL_ERROR = 5
        PLANT_READ_ERROR = 6
        READ_PACK_HIERARCHY_ERROR = 7
        OVERFLOW = 8
. " CBGL_MP07_GEN_DATA_GET




ABAP code using 7.40 inline data declarations to call FM CBGL_MP07_GEN_DATA_GET

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.

 
 
 
 
 
 
 
 
 
DATA(ld_i_flg_uom) = TRUE.
 
 
 
 
 
 
 
 
 
 


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!