How does the SAP BTP platform ABAP programming environment maintain the custom Unit Of Measure database table T006

Under the ABAP On-Premises system, we can easily maintain the Unit of Measure database table T006 in SAPGUI:
[Picture]

ABAP database table T006 is an important data table in the SAP system, which is used to store information related to units of measure. In the SAP system, units of measure are used to represent various materials, services, and units of measure. This information is critical to business processes such as materials management, planning, manufacturing, sales, purchasing, and more. The T006 table is used to store all units of measure and related descriptions, conversion factors, etc. As requested, here is a detailed explanation of the T006 database table to help you better understand what this table does.

  1. Table composition: The T006 table contains several fields for storing different attributes of the unit of measure. Here is a brief description of some of the main fields:

    • MANDT: client. This is a 3-digit number that uniquely identifies the client in the SAP system.

    • MSEHI: Internal representation of a unit of measure. This is a 3-bit character that uniquely identifies the unit of measure.

    • MSEH3: External representation of units of measure. This is a 3-bit character used to display the unit of measure in the system.

    • MSEHL: Description of units of measure. This is a text of up to 20 characters in length that describes the purpose and meaning of the unit of measure.

    • MSEH6: Conversion factors between units of measure and base units. This is a floating point number representing the conversion factor from the unit of measure to the base unit.

    • MSEH5: Conversion factors for units of measure to other units of measure. This is a floating point number used to represent the conversion factor from a unit of measure to another unit of measure.

    • KNUMF: The proportional relationship between a unit of measure and other units of measure. This is a floating point number used to represent the proportional relationship between units of measure.

  2. Data maintenance: the data in the T006 table is maintained by the SAP system. When you create a new unit of measure in the SAP system, the system automatically adds the relevant information to the T006 table. Likewise, when you update or delete an existing unit of measure, the system automatically updates the data in the T006 table. This ensures that the T006 table always has the latest unit of measure information.

  3. Associations with other tables: There are associations between the T006 table and other SAP database tables. For example, the base unit of measure field MEINS in the material master data table MARA references the unit of measure in the T006 table. This ensures that the unit of measure in the material master table is consistent with the unit of measure in the T006 table. In addition, in business processes such as purchasing, sales, manufacturing, etc., the unit of measure information is also associated with other key database tables (such as EKPO, VBAP, AFPO, etc.).

But in the SAP BTP ABAP programming environment , how to accomplish similar tasks?

Many business applications use units of measurement in their business processes.

To standardize these processes, units and related dimensions need to be maintained centrally.

In addition, there are business requirements for conversion between different units.

We provide a subset of common standardized units, dimensions and ISO codes as pre-deliverables. Also, the units and dimensions that the customer has will need to be defined in the customer application.

Use the API CL_UOM_MAINTENANCE to add, delete, modify and query units.

An example of creating a new unit:

CLASS zcl_uom_unit_create_test DEFINITION 
  PUBLIC 
  FINAL 
  CREATE PUBLIC . 
 
  PUBLIC SECTION. 
    INTERFACES if_oo_adt_classrun. 
  PROTECTED SECTION. 
  PRIVATE SECTION. 
ENDCLASS. 
 
CLASS zcl_uom_unit_create_test IMPLEMENTATION. 
  METHOD if_oo_adt_classrun~main. 
    DATA: lo_uom  TYPE REF TO cl_uom_maintenance, 
          ls_unit TYPE cl_uom_maintenance=>ty_uom_cre_ts. 
 
    cl_uom_maintenance=>get_instance( 
    RECEIVING 
      ro_uom = lo_uom ). 
 
    ls_unit-commercial = 'ZYX'. 
    ls_unit-technical  = 'ZYX'. 
    ls_unit-denominator = '1'. 
    ls_unit-numerator = '1'. 
    ls_unit-dec_disp = '3'. 
    ls_unit-long_text = 'Create Unit'. 
    TRY. 
        lo_uom->create( EXPORTING unit_dimid  = 'AAAADL' 
                                  unit_int    = 'ZYX' 
                                  unit_cre_ts = ls_unit 
                        IMPORTING error       = DATA(error) 
                         ). 
      CATCH cx_uom_error INTO DATA(lo_error). 
        out->write( | Exception raised | ). 
        out->write( lo_error->get_text( ) ). 
    ENDTRY. 
 
  ENDMETHOD. 
ENDCLASS.

Guess you like

Origin blog.csdn.net/i042416/article/details/131354275