SAP CRM訂單資料庫表CRMD_SHIPPING的填充原理
In my recent project I need to figure out the logic how fields in table CRMD_PRICING are populated.
Take several of them highlighted below for example:
Here is the test data I used to demonstrate the scenario.
I have created a corporate account which is assigned to Sales Organization O 50000732, Distribution Channel 01, Division 02.
And in Pricing->Pricing in the Business Transaction->Determine Pricing Procedures, I maintain a corresponding determination procedure:
The document pricing procedure for my own transaction type ZSRV is maintained as S:
For customer pricing procedure flag, it is maintained in the sales data in my corporate account:
So far all customizing are done. Now create a new Service order, enter that corporate account as Sold-to Party:
function module CRM_PRICING_PARTNER_CHANGE_EC will be called.
Inside it CRM_PRICING_MERGE_FROM_BUPA_OW will be called to get the pricing data from that corporate account.
Those data are read from account and stored in variable ls_data:
Later they are copied to pricing workarea field by field:
This is how pricing set is created. Once you saved the service order successfully,
Execute the report below to directly print out the data in CRMD_SHIPPING which belongs to this service order:
REPORT tool_display_order_price_head.PARAMETERS: objid TYPE crmd_orderadm_h-object_id OBLIGATORY DEFAULT '5700000507',
obtype TYPE crmd_orderadm_h-process_type OBLIGATORY DEFAULT 'SRVO'.SELECT SINGLE guid INTO @DATA(lv_guid) FROM crmd_orderadm_h
WHERE object_id = @objid AND process_type = @obtype.IF sy-subrc <> 0.
WRITE:/ ' Service Order does not exist'.
RETURN.ENDIF.SELECT SINGLE * INTO @DATA(ls_link) FROM crmd_link
WHERE guid_hi = @lv_guid AND objtype_hi = '05' AND objtype_set = '09'.IF sy-subrc <> 0.
WRITE:/ 'no price data exists for this order'.
RETURN.ENDIF.SELECT SINGLE * INTO @DATA(ls_price) FROM crmd_pricing
WHERE guid = @ls_link-guid_set.IF sy-subrc <> 0.
WRITE:/ 'no price data exists for this order'.
RETURN.ENDIF.cl_crm_1order_set_print_tool=>print_structure( ls_price ).
Source code of CL_CRM_1ORDER_SET_PRINT_TOOL:
CLASS cl_crm_1order_set_print_tool DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS print_structure
IMPORTING
!is_data TYPE any .
PROTECTED SECTION.
PRIVATE SECTION.ENDCLASS.CLASS CL_CRM_1ORDER_SET_PRINT_TOOL IMPLEMENTATION.
METHOD print_structure.
DATA(lo_struct_descr) = CAST cl_abap_structdescr( cl_abap_datadescr=>describe_by_data( is_data ) ).
DATA(lt_comp) = lo_struct_descr->components.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE is_data TO FIELD-SYMBOL(<data>).
IF sy-subrc <> 0.
RETURN.
ENDIF.
READ TABLE lt_comp ASSIGNING FIELD-SYMBOL(<comp>) INDEX sy-index.
IF <data> IS NOT INITIAL.
DATA(lv_color) = sy-index MOD 4.
DATA(lv_print) = |Field: { <comp>-name }, value: { <data> } |.
CASE lv_color.
WHEN 0.
WRITE: / lv_print COLOR COL_NEGATIVE.
WHEN 1.
WRITE: / lv_print COLOR COL_POSITIVE.
WHEN 2.
WRITE: / lv_print COLOR COL_GROUP.
WHEN 3.
WRITE: / lv_print COLOR COL_KEY.
ENDCASE.
ENDIF.
ENDDO.
ENDMETHOD.ENDCLASS.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2723716/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP CRM訂單模型CRMD_SHIPPING的單元測試方法模型
- SAP CRM資料庫表CRMD_CUMULAT_H的設計原理資料庫
- 如何使用程式碼的方式刪除 SAP CRM 訂單 Text 資料
- 如何使用程式碼建立和讀取 SAP CRM 訂單的 Text 資料
- SAP CRM銷售訂單UI上的欄位對應的資料庫表儲存欄位:requested start date和end dateUI資料庫
- 使用SAP CRM External Interface進行訂單同步
- SAP CRM系統訂單模型的設計與實現模型
- 自己開發的一個SAP CRM訂單統計工具
- SAP CRM資料庫表CRMD_SRV_REFOBJ和CRMD_SRV_OSSET資料庫OBJ
- 資料庫訂單狀態資料庫
- SAP中的資料庫表索引資料庫索引
- SAP Commerce(原Hybris)的訂單處理框架和SAP CRM One Order框架框架
- SAP CRM中介軟體下載時資料庫表CRMATAB為空的處理方法資料庫
- SAP MM 採購訂單抬頭資料裡的Condition
- SAP S4CRM 1811 服務訂單API介紹API
- SAP CRM訂單抬頭級別的組織架構資料是如何自動拷貝到行專案的架構
- SAP CRM One Order header資料庫表幾個和時間戳相關的欄位Header資料庫時間戳
- SAP Hybris Commerce裡的資料庫表資料庫
- CRM, C4C和SAP Hybris的資料庫層設計資料庫
- CRM資料庫表COM_TA_R3_ID的資料來源資料庫
- Oracle用隨機資料填充表Oracle隨機
- MySQL用隨機資料填充表MySql隨機
- pgsql資料庫的表儲存策略原理SQL資料庫
- 使用 ABAP 程式碼刪除指定 SAP CRM 系統裡 Opportunity 訂單的文字Unity
- 資料庫 表單運用資料庫
- SAP CRM產品主資料頁面的縮圖顯示設計原理
- SAP CRM附件模型的Authorization scope原理介紹模型
- SAP CRM和Cloud for Customer訂單中的業務夥伴的自動決定機制Cloud
- SAP資料庫的分析資料庫
- 10億級別訂單的分庫分表方案
- SAP ABAP資料表的操作
- 資料庫簡單的一些原理概念資料庫
- Javaweb的例項--訂單管理系統--設計資料庫JavaWeb資料庫
- ThinkPHP5.1 中的資料庫遷移和資料填充PHP資料庫
- 資料庫中單表查詢資料庫
- 在SAP HANA Express Edition裡建立資料庫表Express資料庫
- SAP 訂單模型的編排方式概述模型
- SAP建立採購訂單流程