
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |