cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Decimal values in MDM throgh ABAP API

Former Member
0 Kudos

Hi Sdners,

In my Material Repository I have a field called Gross Weight whose data type is Measurement. We are not using the dimension property of the data type Measurement (Dimension is set to None) . So the field is behaving like a Real field with Decimal value set to 3 places. We are using ABAP API to create material records in MDM. The DDIC component which corresponds to Gross Weight in MDM is defined with data type MDM_GDT_QUANTITY. This Component type is a structure with two components 1. Content -data type FLTP 16 and 2. Unit Code with data type Unit.

We are not passing any value for Unit Code as we are not using the Dimension property of the measurement field . While passing value to the structure component CONTENT I am getting an error Unit Of Measurement not supported. The code reads like this

DATA lt_record_data type standard table of ysmm_mat_struc_1<ddic structure>

DATA ls_record_data LIKE LINE OF lt_record_data

ls_record_data-gross_weight-content = ysmm_mat_header-gross_weight. ( ysmm_mat_header holds the user entry of gross weight values and passes it to ls_record_data)

CALL METHOD lr_api->mo_core_service->create_simple

EXPORTING

iv_object_type_code = 'Products'

is_ddic_structure = ls_record_data

IMPORTING

ev_new_internal_id = lv_key.

The issue is MDM Real Data type is not supported in ABAP I believe because when I tried to push data to a Real field in MDM I came across an error of Forbidden Data type .

Gross Weight field will contain decimal values.

Can anyone suggest any workaround about how to create decimal values in MDM through ABAP API.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi prabhuddha,

You need to assign value to the unit code parameter as well even if it is none.

Assign the below value and ur code should work fine:

ls_record_data-gross_weight-content = ysmm_mat_header-gross_weight.

ls_record_data-gross_weight-unit_code = mdmif_unit_of_measure_none .

Regards,

Neethu Joy

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Hello Prabuddha Roy

We have the same problem with ABAP API, but with measurement ABAP API work correctly.

SAP MDM do automatic conversion measurement type one to another

Set Gross weight in kg by default, and set 3 decimal place after dot.

All values will be store by default format (kg)

Regards

Kanstantsin