無法新增某個relationship給SAP CRM Product category的一個可能原因
For example, I would like to test relationship type STRSET and then I plan to add it to product category 00001.
However, in available drop down list, I could not see relationship type STRSET. Why?
When debugging the backend logic to render relationship type drop down list entries, I found there is a check implemented by the function module below, to avoid a relationship is assigned more than once.
According to SAP help, a set type / relationship may be assigned to more than one category within a hierarchy, but to only one hierarchy for each product type. Therefore even if two categories are in different hierarchies but have the same product type, it is not possible to assign the set type / relationship to both categories. In my example, the check against my category 00001 belonging to hierarchy R3PRODHIER fails ( assign_not_allowed ).
The question is, how to find other categories in different hierarchy other than R3PRODHIER, which are already assigned with STRSET? In order to make life easier, I write the following utility method to detect such collision: Method input: relationship type name, here it is STRSET:
Output is a table with line type category id, hierarchy id and product type the category is assigned to.
By using this method, I know in current system, in another product hierarchy R3PRODSTYP, there are already three categories with relationship type STRSET assigned:
As a result I have several approaches: I can remove the relationship STRSET from category ZALTID, after that it will be possible again for me to add STRSET to category 00001. If there is already product created based on category ZALTID, it will not be possible to remove relationship from ZALTID, then I have to consider to directly add category ZALTID or its children category to my product. The utility method signature:
type TT_USAGE used:
types:
BEGIN OF ty_usage,
cat_id TYPE comm_category-category_id,
hier_id TYPE comm_hierarchy-hierarchy_id,
prod_type TYPE comm_product-product_type,
END OF ty_usage .
types:
tt_usage TYPE STANDARD TABLE OF ty_usage WITH key cat_id hier_id .Method source code:
METHOD rel_type_usage_check.
DATA: lt_prcat_il_rel TYPE comt_prcat_il_rel_tab,
ls_prcat LIKE LINE OF lt_prcat_il_rel,
ls_category TYPE comt_category,
ls_prcattype TYPE comt_prcat,
lv_hie_id TYPE comm_hierarchy-hierarchy_id.
CALL FUNCTION 'COM_PRCAT_IL_REL_READ_WITH_IL'
EXPORTING
iv_il_reltype = iv_rel
iv_il_direction = 'S'
IMPORTING
et_prcat_il_rel = lt_prcat_il_rel
EXCEPTIONS
not_found = 1
wrong_call = 2
OTHERS = 3.
CHECK sy-subrc = 0.
LOOP AT lt_prcat_il_rel INTO ls_prcat.
CALL FUNCTION 'COM_CATEGORY_READ'
EXPORTING
iv_category_guid = ls_prcat-category_guid
IMPORTING
es_category = ls_category
EXCEPTIONS
wrong_call = 1
not_found = 2
error = 3.
CHECK sy-subrc = 0.
SELECT SINGLE hierarchy_id INTO lv_hie_id FROM comm_hierarchy
WHERE hierarchy_guid = ls_category-hierarchy_guid.
CHECK sy-subrc = 0.
CALL FUNCTION 'COM_PRCAT_READ'
EXPORTING
iv_category_guid = ls_category-category_guid
IMPORTING
es_prcat = ls_prcattype
EXCEPTIONS
wrong_call = 1
not_found = 2
OTHERS = 3.
APPEND INITIAL LINE TO rt_usage ASSIGNING FIELD-SYMBOL(<result>).
<result> = value #( cat_id = ls_category-category_id hier_id = lv_hie_id
prod_type = ls_prcattype-product_type ).
ENDLOOP.
ENDMETHOD.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2723181/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP CRM Product hierarchy,Category和Application三個問題GoAPP
- SAP CRM Product category的決定邏輯Go
- 無法在SAP Fiori UI上新增擴充套件欄位?原因可能就在這裡UI套件
- 如何使用ABAP程式碼建立SAP Product CategoryGo
- SAP Fiori應用發生超時錯誤的一個可能原因
- 兩種使用程式碼獲得SAP CRM product sales status的辦法
- SAP 電商雲 Spartacus UI 的 Product Category Navigation UI 實現UIGoNavigation
- 某個Eclipse無法啟動的問題Eclipse
- 如何把SAP CRM WebClient UI上某個欄位高亮加粗顯示WebclientUI
- CRM和C4C product category hierarchy的可編輯性控制邏輯Go
- SAP CRM Fiori 應用裡無法根據當前文件建立 Followup Opportunity 的原因分析Unity
- iOS中按鈕無法互動的5個原因iOS
- SAP Commerce Cloud Product Review 的新增邏輯CloudView
- SAP Fiori應用沒能從Fiori Launchpad啟動的一個可能原因及分析過程
- SAP Table Relationship of Material Classification
- 手動給docusaurus新增一個搜尋
- 自己開發的一個SAP CRM訂單統計工具
- Runtime 系列 3-- 給 category 新增屬性Go
- 如果報錯資訊說是無法刪除某個資料夾裡面的某個檔案
- JS判定一個給定的時間在某個時間範圍內JS
- 使用 yo 命令列嚮導給 SAP UI5 應用新增一個新的檢視命令列UI
- SAP CRM Product Sales status在中介軟體中的處理邏輯
- HTML img 元素無法顯示 base64 圖片的可能原因HTML
- oracle之 監聽器無法啟動的幾個原因總結Oracle
- SAP CRM note建立按鈕被禁用的原因分析
- SAP CRM WebClient UI cross component跳轉的一個具體例子WebclientUIROS
- SAP CRM中介軟體下載equipment時遇到的一個錯誤UI
- 給一個塊元素新增多張背景圖片
- 【SAP技術】SAP不能修改一個已經分配給交貨單的HU
- 可能導致遊戲下載量降低的7個原因遊戲
- product.get( 獲取一個產品的資訊 )
- SAP CRM Fiori應用冗餘round trip的原因分析
- mysqdump 忽略某個資料庫的寫法資料庫
- Greenplum訪問某個模式的某個表模式
- 如何使用 API 的方式給 SAP service cloud Registered product 上傳圖片APICloud
- 網路卡無法獲取IP地址自己給他找個
- 給 rm 命令新增個「垃圾桶」
- Java地位無可動搖的12個原因Java