SAP CRM数据库表COMM_PR_FRG_ROD的内容分析

Created by Jerry Wang on Oct 06, 2016

You can use the below source code to perform a mass analysis of table COMM_PR_FRG_ROD:

METHOD sales_area_tab_analyze.
DATA: lt_tab TYPE STANDARD TABLE OF comm_pr_frg_rod,
lt_status TYPE STANDARD TABLE OF crm_jest,
lt_prod TYPE STANDARD TABLE OF comm_product,
lt_settype TYPE STANDARD TABLE OF comc_settype.
SELECT * INTO TABLE lt_tab FROM comm_pr_frg_rod WHERE status_object <> space.
DATA(lv_total) = lines( lt_tab ).
SELECT * INTO TABLE lt_status FROM crm_jest FOR ALL ENTRIES IN lt_tab
WHERE objnr = lt_tab-status_object.
SELECT frgtype_guid frgtype_id INTO CORRESPONDING FIELDS OF TABLE lt_settype
FROM comc_settype.
SELECT product_guid product_id INTO CORRESPONDING FIELDS OF TABLE lt_prod
FROM comm_product FOR ALL ENTRIES IN lt_tab WHERE product_guid = lt_tab-product_guid.
LOOP AT lt_tab ASSIGNING FIELD-SYMBOL().
APPEND INITIAL LINE TO rt_sales_data ASSIGNING FIELD-SYMBOL().
READ TABLE lt_prod ASSIGNING FIELD-SYMBOL() WITH KEY product_guid = -product_guid.
IF sy-subrc = 0.
-prod_id = -product_id.
ENDIF.
READ TABLE lt_settype ASSIGNING FIELD-SYMBOL() WITH KEY frgtype_guid = -fragment_type.
IF sy-subrc = 0.
-settype_id = -frgtype_id.
ENDIF.
READ TABLE lt_status ASSIGNING FIELD-SYMBOL() WITH KEY objnr = -status_object.
IF sy-subrc = 0.
-status_value = -stat.
ENDIF.
ENDLOOP.
ENDMETHOD.
types:
BEGIN OF ty_sales_Data,
prod_id TYPE comm_product-product_id,
settype_id TYPE comc_settype-frgtype_id,
status_value TYPE crm_jest-stat,
END OF ty_sales_data .

types:
tt_Sales_Data TYPE STANDARD TABLE OF ty_sales_Data WITH KEY prod_id status_value .
An example of test output:


SAP CRM数据库表COMM_PR_FRG_ROD的内容分析_第1张图片

The text table for status value is:

SAP CRM数据库表COMM_PR_FRG_ROD的内容分析_第2张图片

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

你可能感兴趣的:(Jerry,Wang的原创SAP技术文章,ABAP,CRM)