Professional Documents
Culture Documents
Applies to:
SAP BW 3.5 / SAP 7.0 Consultants have knowledge in SAP CRM 5.0 / SAP CRM 7.0. For more information, visit the EDW Homepage .
Summary
Enhance the SAP CRM Business Activity Transaction using transaction EEWB and extract the enhanced data (Custom Data) to BW using Generic Extraction (Function Module Extraction). Author: Suraj Tigga
Author Bio
Suraj Tigga is a Senior SAP BI / ABAP consultant at Capgemini Consulting, India. Suraj joined Capgemini Consulting in 2008 and has worked on multiple SAP BI implementation and support projects.
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Table of Contents
Scenario .............................................................................................................................................................. 3 Step-by-Step Procedure.................................................................................................................................. 3 Enhancement (EEWB) - Business Activity...................................................................................................... 3
Easy Enhancement Workbench (EEWB) ..................................................................................................................... 7
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Scenario
In this document, we would be focusing on the special features involved in enhancement of Business Activity using Easy Enhancement Workbench (EEBW) and extracting the enhanced fields data to SAP BI using Function Module Generic Extraction. In the following, we will pay particular attention to sub areas that make up the special features of SAP CRM Business Activity, enhancement of Business Activity and Extraction. The document does not cover general customizing, for example, the definition of an Infocube or the Creation of a Datasource for storing SAP CRM data in BI.A basic knowledge of CRM is required. Step-by-Step Procedure Above mentioned scenario would consist of primarily two important steps: a) Enhancement (EEWB) Business Activity: Creation of Project and required Extension for EEWB for Bus Object (BUSINESS_ACTIVITY) and Extension Type (ACTIVITY_H).
b) Generic Extraction (Business Activity) Function Module: Creation of Generic Datasource and its concerned Function Module to extract data from the required Database tables relevant to Business Activity. Enhancement (EEWB) - Business Activity Easy Enhancement Workbench is a development tool with which SAP applications can be extended in a simple manner. This tool provides a wizard, allowing the definition of an extension. The Customizing Include is generated according to that definition. Using Easy Enhancement Workbench has the following advantages: No actions in the Data Dictionary are necessary, a wizard guides you through the extension process Tool contains information on all existing Customizing Includes Currently Easy Enhancement Workbench only generates the Customizing Include and its data elements and domains. All UI specific properties are either generated automatically at the application runtime or defined manually.
CI_EEW_ORDERADM_H
Transaction Item - Price Business Transaction Item -Schedule Line Transaction Item Service Transaction - Additional Extension
CI_EEW_PRICING_I
CI_EEW_ORDERADM_I
CI_EEW_SCHEDLIN
CI_EEW_ACTIVITY_H
CI_EEW_SERVICE_I
Activity Item
CI_EEW_ACTIVITY_I
CI_EEW_CUSTOMER_H
Opportunity
CI_EEW_OPPORT_H
CI_EEW_CUSTOMER_I
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Extension
Lead Transaction Item Product Transaction Item Financing Product Business Transaction Sales Set Business Transaction Shipping Set Business Transaction Billing Set Organizational Unit Set
CI_EEW_LEAD_H CI_EEW_PRODUCT_I
CI_EEW_ISMP CI_EEW_ISOL
CI_EEW_FINPROD_I
CI_EEW_MKTPL_BDINC
CI_EEW_SALES
CI_EEW_MKTPL_CHINC
CI_EEW_SHIPPING
CI_EEW_IBIB
CI_EEW_BILLING
CI_EEW_IBSP
CI_EEW_ORGMAN
CRM Case
CI_EEW_CRMT_CMG
System Landscape must be set up in order to be able to use system-wide generation. The system landscape must be set up in order to be able to use system-wide generation. Cross-application components General application functions Easy Enhancement Workbench Maintain system landscape
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Subobjects for the business transaction can be enhanced, they offer a customer include structure for new fields:
EEWB Bus Object ACCOUNT_PLAN Extension Type BASIC_DATA (Basic Data) EEWB Bus Object COMPLAINTS Extension Type BILLING(Extend Billing Set) CUSTOMER_H(Extend Transactional Extn) CUSTOMER_I(Extend Item Additional Extn) ORGMAN(Extend Organizational Unit Set) PRICING(Extend Pricing parameter Set) PRICING_I(Extend Item Price) PRODUCT_I(Extend Item Product) SALES(Extend Sales Set) SCHEDLIN(Extend Item Schedule Line)
ADS
COMPLAINTS
BUPA
ADD_NEW_ATTRIBUTES_TAB LE (Add New Attributes) ADD_NEW_FIELDS (Add New Fields) ADD_NEW_ATTRIBUTES_TAB LE (Add New Attributes) ACTIVITY_H(Extend Activity)
COMPLAINTS
BUPA
COMPLAINTS
BUPR
COMPLAINTS
BUSINESS_ACTIVITY
COMPLAINTS
BUSINESS_ACTIVITY
ORGMAN(Extend Organizational Unit Set) ADD_NEW_FIELDS(Add New Fields) ADD_NEW_ITEM_COMPONEN T(New Business Transaction Comps) CUSTOMER_H(Extend Transaction Additional Extension) CUSTOMER_I(Extend Item Additional Extension) ORDERADM_H(Extend Transaction Header) ORDERADM_I(Extend Transaction Item) ADD_ATTRIBUTES(Add Category Attributes)
COMPLAINTS
BUSINESS_TRANSACTION
COMPLAINTS
BUSINESS_TRANSACTION
COMPLAINTS
BUSINESS_TRANSACTION
COMPLAINTS
BUSINESS_TRANSACTION
INDIVIDUAL_OBJECT
ADS(Created Analytical Data Storage) ADDITION(Extend Supplement) INSTALLED_BASE(Exte nd Installed Base) CUSTOMER_H(Extend Transactional Add. Extension) LEAD_H(Extend Lead)
BUSINESS_TRANSACTION
INSTALLED_BASE
BUSINESS_TRANSACTION
INSTALLED_BASE
CATEGORY_ENHANCEMENT
LEAD
CATEGORY_ENHANCEMENT
LEAD
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
OPPORTUNITY
CUSTOMER_H(Extend Transaction Add Extn) CUSTOMER_I(Extend Item Add Extension) OPPORT_H(Extend Opportunity
LEAD
ORGMAN(Extend Organizational Unit Set) PRODUCT_I(Extend Item Product) SCHEDLIN(Extend Item Schedule Line) BILLING(Extend Billing Set) CUSTOMER_H(Extend Transac. Add. Extn) CUSTOMER_I(Extend Item Add. Extn) ORGMAN(Extend Organizational unit Set) PRICING(Extend Pricing parameter set)
OPPORTUNITY
LEAD
OPPORTUNITY
LEAD
OPPORTUNITY
ORGMAN(Extend Organizational Unit Set PRICING(Extend Pricing Parameter Set) PRICING_I(Extend Item Price)
OPPORTUNITY
OPPORTUNITY
OPPORTUNITY
OPPORTUNITY
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Easy Enhancement Workbench (EEWB) Below are the steps mentioned to create a Project and the required Extension meant for Business Activity. Listed below are the fields which are to be enhanced for the Business Activity Transaction:
Batch / Lot #(CHAR-15) , Date of Interaction(DATS-8), Time(TIMS-6), Product ID(CHAR-40), Product Description(CHAR-40), Sales Order Ref(CHAR-40),Delivery Doc Ref(CHAR-40), Customer PO(CHAR-40), Contact Method(CHAR-40), Product Group(CHAR-40), Contact Method(CHAR-20), Product Group9CHAR20), Product Group(CHAR-30), Product Group(CHAR-50), Product Group(CHAR-10), Contact Method39CHAR-30),Contact Method(CHAR-20), and Product Group3(CHAR-10) Step1: Go to transaction EEWB and create Project ZIRFIELDS as below:
Step2: Right-Click and create Extension ZIINTFIELDS1 for the above mentioned fields using the Wizard: Define Title:
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Define Fields:
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Assign Fields
Complete the execution after all the above steps are done successfully
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Step3: Check the Business Activity transaction for the added custom fields:
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Generic Extraction (Business Activity) Function Module To fetch the above custom fields values we would perform the following steps: a) Function Module to extract the Business Activity Custom field Values b) Generic Datasource which would be linked with Function Module Extraction Function Module Step1: Create the Structure ZCRM_ACTIVITY_H which would contain the custom fields values along with the Activity Header GUID
Step2: Create a function module ZBI_CRM_ACTIVITY_H to extract the relevant data Data Flow: CRMD_ORDERADM_H (Business Transaction)
GUID = GUID GUID = GUID
CRMD_ACTIVITY_H (Activity)
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Pseudo-Code: Fetch all the newly created CRM Business Activity transactions from table CRMD_ORDERADM_H. For all the entries fetched above, fetch the Contact Method3 and Product Group from table CRMD_ACTIVITY_H header table. For the entries fetched from table CRMD_ORDERADM_H, get the Product Group3 from table CRMD_CUSTOMER_H. Based on the above values brought in above three steps, combine the data and populate the extractor output records.
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Function Module: ZBI_CRM_ACTIVITY_H Extract Structure: ZCRM_ACTIVITY_H Next Steps (Required in SAP BI): a) Map the standard datasource (0CRM_SALES_ACT_1 Activities) and Generic Datasource (ZCRM_ACTIVITY_H) to DSO 0SAL_DS01 (ODS for Activities).
0SAL_DS01
(ODS for Activities)
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
* Initialization mode (first call by SAPI) or data transfer mode * (following calls) ? IF i_initflag = sbiwa_c_flag_on. ************************************************************************ * Initialization: check input parameters * buffer input parameters * prepare data selection ************************************************************************ * Check DataSource validity CASE i_dsource. WHEN 'ZCRM_ACTIVITY_H'. WHEN OTHERS. IF 1 = 2. MESSAGE e009(r3). ENDIF. * this is a typical log call. Please write every error message like this log_write 'E' "message type 'R3' "message class '009' "message number i_dsource "message variable 1 ' '. "message variable 2 RAISE error_passed_to_mess_handler. ENDCASE. APPEND LINES OF i_t_select TO s_s_if-t_select. * Fill parameter buffer for data extraction calls s_s_if-requnr = i_requnr. s_s_if-dsource = i_dsource. s_s_if-maxsize = i_maxsize. * Fill field list table for an optimized select statement * (in case that there is no 1:1 relation between InfoSource fields * and database table fields this may be far from beeing trivial) APPEND LINES OF i_t_fields TO s_s_if-t_fields. ELSE. "Initialization mode or data extraction ?
************************************************************************ * Data transfer: First Call OPEN CURSOR + FETCH * Following Calls FETCH only ************************************************************************ * First data package -> OPEN CURSOR IF s_counter_datapakid = 0. * Fill range tables BW will only pass down simple selection criteria * of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'. LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'OBJECT_ID'. MOVE-CORRESPONDING l_s_select TO l_r_objid. APPEND l_r_objid. ENDLOOP.
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'PROCESS_TYPE'. MOVE-CORRESPONDING l_s_select TO l_r_ptype. APPEND l_r_ptype. ENDLOOP. * * * * * Determine number of database records to be read per FETCH statement from input parameter I_MAXSIZE. If there is a one to one relation between DataSource table lines and database entries, this is trivial. In other cases, it may be impossible and some estimated value has to be determined. OPEN CURSOR WITH HOLD s_cursor FOR SELECT * FROM crmd_orderadm_h WHERE object_id IN l_r_objid AND process_type IN l_r_ptype. ENDIF. "First data package ? Fetch records into interface table. named E_T_'Name of extract structure'. FETCH NEXT CURSOR s_cursor APPENDING CORRESPONDING FIELDS OF TABLE e_t_data PACKAGE SIZE s_s_if-maxsize . IF sy-subrc EQ 0 . SORT e_t_data BY guid ASCENDING. Retrieve the values from table CRMD_ACTIVITY_H SELECT guid zzprogrp3 zzcontactmethod4 zz_ir_cm FROM crmd_activity_h INTO TABLE t_crmd_activity_h FOR ALL ENTRIES IN e_t_data WHERE guid EQ e_t_data-guid. IF sy-subrc EQ 0. SORT t_crmd_activity_h BY guid ASCENDING. ENDIF. retreive data from table CRMD_CUSTOMER_H SELECT guid zzprogrp4 FROM crmd_customer_h INTO TABLE t_crmd_customer_h FOR ALL ENTRIES IN e_t_data WHERE guid EQ e_t_data-guid. IF sy-subrc EQ 0. SORT t_crmd_customer_h BY guid ASCENDING. ENDIF. LOOP AT e_t_data INTO wa_e_t_data. Read records from table CRMD_ACTIVITY_H READ TABLE t_crmd_activity_h INTO wa_crmd_activity_h WITH KEY guid = wa_e_t_data-guid BINARY SEARCH. IF sy-subrc EQ 0. MOVE-CORRESPONDING wa_crmd_activity_h TO wa_e_t_data. ENDIF. Read records from table CRMD_CUSTOMER_H READ TABLE t_crmd_customer_h INTO wa_crmd_customer_h WITH KEY guid = wa_e_t_data-guid BINARY SEARCH.
* * *
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
IF sy-subrc EQ 0. wa_e_t_data-zzprogrp4 = wa_crmd_customer_h-zzprogrp4. ENDIF. MODIFY e_t_data FROM wa_e_t_data. CLEAR wa_e_t_data. ENDLOOP. ENDIF . IF sy-subrc <> 0. CLOSE CURSOR s_cursor. RAISE no_more_data. ENDIF. s_counter_datapakid = s_counter_datapakid + 1. ENDIF. ENDFUNCTION. "Initialization mode or data extraction ?
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW
Related Content
For more information visit EDW Homepage. Help.sap.com
SAP BW - Enhance SAP CRM Business Activity Transaction and Extract Data to BW