Professional Documents
Culture Documents
Table of contents
1.0 Intended Audience 3
2.0 Executive Summary 3
3.0 CO Integration Settings 3
3.1 Setting up Controlling Integration 3
3.2 Replicating Characteristics for CO Integration 7
3.3 Assign Billing units to Sales & Service Organizations 8
4.0 ECC – Internal Order Settings 9
4.1 Configure Internal Order 9
4.2 Settlement Profile 10
5.0 Profit Center Determination 12
5.1 How Profit Center is determined in CRM Integration 12
5.2 Create a CRM function module ZSRV_PRFCNTR_DET 13
5.3 Activate ECC User Exit PCACRM01 – Tx code SMOD 18
5.4 ECC Profit Center Determination Substitution Rules 25
6.0 Monitoring Internal Order Replication in ECC 25
6.1 Transaction code IAOMG 25
Controlling Type
Reference Usage:
For subsequent business transactions, you decide whether the costs and revenue should
be posted to the account assignment object of the reference transaction, or to a new
account assignment object:
To enable you to analyze all planned costs, actual costs, and revenues for all of the
business transactions that belong together logically, choose the setting Copy.
L&T Infotech - Confidential Page 5 of 29
White Paper – CO Integration
Feb 2010
Author: Kaushik Sarkar
Example
CRM Service business scenario; Single-Object Controlling:
The costs and revenue for a CRM service confirmation should be posted to the internal
order of the service order for which the confirmation is made. To do this, you must
select the Copy setting.
If a new internal order should be created for a CRM return, choose the Ignore setting.
You then have separate cost and revenue controlling for the referenced CRM transaction
and for the return.
Controlling Level
Controlling Level
This determines the Controlling level.
For the Controlling type Mass Controlling, the Controlling level is not relevant.
If you choose Item as Controlling level, this can lead to performance problems with large
volumes of data. We therefore recommend you use Transaction as the Controlling level.
Example
For service contracts, Controlling on item level makes sense.
In the sales process and in service processing, the profit center is determined during the
replication into the R/3 System and is stored in the translator. The profit center is
determined according to the following sequence:
2. Alternative default profit center: If the profit center from step 1 remains initial,
the dummy profit center from PCA Customizing is set.
This note 396391 contains example source code of how to use the user exit to call
the substitution that is usually defined via 'substitution for the sales order'. Prior
to that, you can use add your own additional information to table CH_PCASUB to
ensure that all required data is available to your substitution correctly. For this
purpose, implement the advance corrections and activate the user exit in
Transaction CMOD (SAP enhancement PCACRM01)
PCASUB as it is known from the 'substitution for the sales order' in the standard
R/3 System. The reason why a separate substitution has to be created here and
why the rule defined via Transaction 0KEL cannot used is that in the case of calls
from the CRM Server, characteristic values in table PCASUB that are filled by
default within the R/3 System are not filled. If your substitution refers to such
fields, the simple use of your old substitution routine would return incorrect
results. You must therefore create a new substitution routine which can manage
with the small amount of data provided by the CRM Server.
A profit center determined via the substitution overwrites a profit center found in
the user exit.
In intercompany processing, the substitution rules are necessary to find the selling
profit center. The selling profit center is used for posting the revenues of the
customer billing document. By default, the derivation of the supplying profit
center during the replication of the sales order in the R/3 System occurs from the
material/supplying plant combination. If you want to use another profit center,
you must define and assign the substitution rules in Customizing of Profit Center
Accounting under 'Enterprise Controlling -> Profit Center Accounting ->
Assignments to Profit Centers -> Sales Orders -> Sales Order Substitutions'.
5. `If the profit center is initial after these steps, it is filled via the derivation in CO-
PA. If a found profit center is not valid, the system sets the dummy profit center.
FUNCTION zsrv_prfcntr_det.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(LV_OBJECT_ID) TYPE CRMT_OBJECT_ID_DB
*" VALUE(LV_PROC_TYPE) TYPE CRMT_PROCESS_TYPE_DB
*" VALUE(LV_SERVICE_ORG) TYPE CRMT_SERVICE_ORG
*" EXPORTING
*" VALUE(DIS_CHANNEL) TYPE VTWEG
*" VALUE(DIVISION) TYPE SPART
*" VALUE(SALES_ORG) TYPE VKORG
*" VALUE(SERVICE_ORG) TYPE VKORG
*********************Determine the order Guid based on the transaction number and the
transaction type*********************
SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid WHERE object_id =
lv_object_id AND
process_type = lv_proc_type.
et_orgman = lt_orgman
et_partner = lt_partner
et_customer_h = lt_customer_h
et_ac_assign = lt_ac_assign
EXCEPTIONS
document_not_found = 1
error_occurred =2
document_locked =3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
lv_partner_guid = ls_partner-bp_partner_guid.
iv_partner_guid = lv_partner_guid
is_sales_area = ls_sales_area
IMPORTING
es_data = ls_data
EXCEPTIONS
no_valid_record_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
sales_district = ls_data-district.
EXPORTING
iv_sales_org = lv_service_org
CHANGING
cv_vkorg = service_org
EXCEPTIONS
value_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF lv_ac_assignment IS INITIAL.
READ TABLE lt_customer_h INTO ls_customer_h INDEX 1.
lv_ac_assignment = ls_customer_h-zzcustomer_h0401.
ENDIF.
ENDFUNCTION.
*********************************************************************************************
*Determine the Profit Center using Substitution rule
*********************************************************************************************
DATA: lv_prctr TYPE cobl-prctr,
ls_chartab TYPE iaom_object_attribute,
lv_vkorg TYPE vkorg,
lv_vtweg TYPE vtweg,
lv_spart TYPE spart,
lv_bzirk TYPE bzirk,
L&T Infotech - Confidential Page 20 of 29
White Paper – CO Integration
Feb 2010
Author: Kaushik Sarkar
*4. Get the Sales Organization, Distribution channel, Division, Service Organization &
* the account assignment of the CRM service transaction from CRM
sales_district = lv_bzirk_crm.
ch_pcasub-vkorg = lv_vkorg.
ENDIF.
ENDIF.
IF ch_call_substitution = 'X'.
SELECT SINGLE bzirk FROM knvv INTO lv_bzirk WHERE kunnr = ch_pcasub-kunnr AND
vkorg = lv_vkorg AND
vtweg = lv_vtweg AND
spart = lv_spart.
IF lv_bzirk IS NOT INITIAL.
ch_pcasub-bzirk = lv_bzirk.
ELSE.
ch_pcasub-bzirk = lv_bzirk_crm.
ENDIF.
************************** Get the Item
Division****************************************************************
*
* ch_pcasub-spart = '10'.
IF im_bukrs NE '4000'.
ch_pcasub-spart = '22'.
ENDIF.
************************** Get the Material Group 1,2,3,4 & 5 of the Product master*****
SELECT SINGLE * INTO ls_mvke FROM mvke WHERE matnr = lv_product AND
vkorg = lv_vkorg AND
vtweg = lv_vtweg.
ch_pcasub-mvgr1 = ls_mvke-mvgr1.
ch_pcasub-mvgr2 = ls_mvke-mvgr2.
ch_pcasub-mvgr3 = ls_mvke-mvgr3.
ch_pcasub-mvgr4 = ls_mvke-mvgr4.
ch_pcasub-mvgr5 = ls_mvke-mvgr5.
endif.
Summary
Symptom
Other terms
CRM_SERVICEORDER_MAP_BDOC2BAPI if_ex_crm_upload_co
You want to modify data being transferred from CRM Service documents and R3.
Solution
Parameter CS_SERVCHAR
Type Changing
Tick the boxes 'Pass Value' and 'Optional'.
Reference type BAPISDCOSV.
Save and activate the changes. Make sure that you also regenerate the BAdi. (SE18 -
Utilities(M) - Regeneration)
2. To enter a plant
cs_servchar-plant = '0001'.
3. TO check if the structure cs_servchar contains header or item data
if cs_servchar-item_type is initial.
* header data
else.
*item data
endif.