How are fields in table CRMD_SHIPPING populated
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.
Hi Jerry,
could you please provide a business case where we need to print data from CRMD_PRICING? I am just curious.
Thanks,
Krish
Hello Krish,
Sorry for making you confused. Currently I am doing some continuous development on CRM one order and I use the report mentioned in this blog to finish my unit test which ensures that what end user has maintained in WebUI regarding pricing set are exactly persisted to table CRMD_PRICING.
There might be not any valid business use case to print data from this table, however sometimes for trouble shooting case it is at least useful for me. For example, I maintain the corresponding customizing and specify the data in WebUI, however finally I cannot see any pricing data in Service Order overview page. This in theory could be caused by two possible issues:
Using this report, I can quickly eliminate the possibility of first issue: if I can really see correct data printed out, it means this is a pure display issue, then I can make further debugging on code which is related to display logic accordingly.
Best regards,
Jerry
Best regards,
Jerry