on 09-16-2009 1:21 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.