How to Update SAP Product Hierarchy Category on SAP CRM with full ABAP Code

How to Update Product Hierarchy & Category on SAP CRM will guide through updating (Creation, Updating and Deletion) of SAP CRM Product Category using ABAP Code.

SAP CRM Product Hierarchy and Category

In this section, the technical information of the SAP CRM Hierarchy and SAP CRM Category is explained.

For SAP CRM Hierarchy, the main SAP CRM Table is : COMM_HIERARCHY for Hierarchy and the main fields are:

  • HIERARCHY_GUID: Category Hierarchy GUID
  • HIERARCHY_ID : Category Hierarchy ID

For SAP CRM Category, the main Table is COMM_CATEGORY for Category and the main fields are:

  • CATEGORY_GUID : Category GUID
  • CATEGORY_ID : Category ID
  • HIERARCHY_GUID : Category Hierarchy GUID
  • PARENT_GUID : Parent Category GUID.

The First step is retrieve the corresponding GUIDs for CATEGORY_ID and HIERARCHY_ID.

SAP CRM Product Category and Hierarchy BAPI

The Two main BAPI to use when dealing with Update Product Category are:

  • COM_PROD_CAT_REL_MAINTAIN_READ
    • Read All the Product Categories for a SAP CRM Product
  • COM_PROD_CAT_REL_MAINTAIN_UPD
    • Update the Product Categories of CRM Product.

Update SAP CRM Product Category ABAP Snippet

This ABAP Code will handle the job to assign SAP CRM Product Categories to a SAP CRM Product.
You can handle the deletion and update with the flag of ls_set_maintainupdate_type (D for Deletion and U for Update).

Check more detail. Hierarchy about Assign Product Categories to Products.