cancel
Showing results for 
Search instead for 
Did you mean: 

Updating value of for taxonomy attributes via ABAP API

Former Member
0 Kudos

Hi ,

We have table Product hierarchy repository in that we have Products table and ProductHierarchy table which is of type taxonomy .

The product hierarchy is assigned to each product as lookup taxonomy field.

Can anyone please let me know how we can update the values assgined to the attribute throght ABAP API.

Example we have the attribute called color which assigned to Product Hierarchy 'A' and this product hierarchy 'A' is attached to Material '111' and the attribute color will have value 'Blue' for material '111' now I want to update the value of color to 'Red' . How we can achieve this via the MDM ABAP API.

Regards,

Amar Kamat

Accepted Solutions (1)

Accepted Solutions (1)

brian_dennett
Explorer
0 Kudos

If your question is how to change the value of an attribute for a specific product this is the solution:

Use IF_MDM_CORE_SERVICES->RETRIEVE( ) to retrieve the product record so that you have a populated structure of type MDM_PARAMETER. In this structure you will find the entry relating to the taxonomy field. The VALUE attribute of this line entry will be a reference to type MDM_TAXONOMY_ENTRY.

At this point you will want to take the TAXONOMY_ENTRY_ID and TAXONOMY_TABLE_CODE of this structure to retrieve the attributes. Using IF_MDM_CORE_SERVICE->RETRIEVE_ATTRIBUTES( ) and the attributes mentioned before you will get the results into a table of line type MDM_ATTRIBUTE_INFORMATION_SL.

Select the appropriate line from the result table based on the attribute name (ATTR_NAME). In the record of type MDM_ATTRIBUTE_INFORMATION_SL you will now want to select the appropriate line from the table found in field ATTR_FEATURE_DOMAIN. Find the appropriate attribute (in this case color) by VALUE_NAME and copy the VALUE_ID (type MDM_UNIQUE_ID).

Now back to where we left off in the original record (MDM_PARAMETER), loop through the table found at field TAXONOMY_ATTRIBUTES of the MDM_TAXONOMY_ENTRY looking in ATTR_INFO for the correct ATTR_NAME. When the correct entry is found, update the ATTR_FEATURE_DOMAIN with the new VALUE_ID and viola, you've got a mdm record ready to be updated.

Simply call IF_MDM_CORE_SERVICE-UPDATE( ) with the modified record and you've updated your attribute assignment.

In short:

Navigate to the MDM_TAXONOMY_ENTRY of the product record

Retrieve the attributes from the corresponding taxonomy table and navigate to the unique ID of the desired attribute

Navigate to the attribute within the record's MDM_TAXONOMY_ENTRY and update the VALUE_ID with the new unique ID

Update the product record

Regards,

Brian Dennett

Former Member
0 Kudos

Thanks Brian.

Answers (1)

Answers (1)

former_member198313
Contributor
0 Kudos

Hi Amar,

How to Guide for ABAP API - Create/Retrieve (Taxonomy Lookup) will help you.

+ An