
SAP CRM DATA SOURCE ENHANCMENT
Summary:
This paper provides the overview of SAPCRM extractor’s enhancement using XIF.In particular, it highlights the major
topics such as challenges faces by any organization in present day and how to overcome and to improve the performance of extractor by using the optimal ways to enhance CRM extractors.
1. Present SAP CRM extractor enhancements:
In our daily consumer business, CRM(Customer Relationship Management) plays a vital role in all kind of business
aspects. Market should provide high range of customer service at right time and in the right approach. Keeping the business requirement SAP has provided CRM system which is really help full for a business in order to help and serve the customer.
As we all know customer data will be in high volume, so we should be ready to manage and handle the data in minimal amount of time which will be very useful for business decisions and reporting.
SAP has provided various extractors based on type of business requirement ,below are few example:
So to enhance the extractor based on our additional data requirement from different table we use traditional way like Customer Exist or BADI’s .As we are in advanced technology so we can avoid using Customer Exist because we have few bottle necks extractor implementation .When compared to USEREXIST we can go ahead using BADI which is much advanced and multiple developers can work on a single extractor at a time which is not flexible by using Customer Exist.
2. SAP CRM enhancement using XIF:
Below all are few example extractors in SAP CRM system which supports XIF:
Extractors |
---|
0CRM_SRV_PROCESS_H |
0CRM_SRV_PROCESS_I |
0CRM_SRV_CONFIRM_H |
0CRM_SRV_CONFIRM_I |
0CRM_SALES_CONTR_I |
0CRM_SRV_CONTRACT_H |
0CRM_UT_SRV_CONT_I |
0CRM_SALES_ACT_I |
0CRM_OPPT_H |
0CRM_OPPT_I |
0CRM_LEAD_H |
0CRM_LEAD_I |
0CRM_COMPLAINTS_I |
0CRM_SALES_ORDER_I |
0CRM_QUOTA_ORDER_I |
For all the above extractors we can use BADI, and we can fetch required data using XIF by using FM CRM_BADI_GET_XIF. The
output of the data is read from buffer (BDOC) via FM CRM_ORDER_READ.
Or
We can enhance this extractor using BADI & Maintaining required fields from Customer _H table in TCode : BWA1 ( BW Adapter) , check in the below document for this approach.
2.1 Business Scenario:
In our example, we are going to extract data for additional field enhanced field.
This standard DS does not have all the fields which are required by customer, so we need to enhance our extractor and then get the data to newly added enhanced fields from table “CRMD_CUSTOMER_H”
We can go ahead using BADI by reading table “CRMD_CUSTOMER_H” and getting the required fields data but by using read performance might be hampered in big time because of high volume of data present in table and reading it.
So to ignore that we can use Contract XIF Structure “CRMXIF_BT_SRV_CONTRACT”, this structure will be holding all the tables which supports XIF for this
extractor “0CRM_SRV_CONTRACT_H”.
In our scenario will be using XIF table “CRMXIF_CUSTOMER_H_X” and will be using field “OPTY_NUMBER” (Opportunity Number).
Opportunity Number :
Firstly we should enhance our extractor “0CRM_SRV_CONTRACT_H” and append structure with field "OPTY_NAME”.
To achieve, go to Tcode –RSA6 and search for the extractor and append filed “OPTY_NAME”.
Step 1 :
Once field is added in extract structure, activate it the extractor and unhide the field:
Step 2 :
Now, we can start BADI logic to populate data for this enhanced field using XIF:
Part 1:
2.2 SAP CRM enhancement using BADI:
Using BADI for enhancing the SAP CRM standard extractor is the best approach. And we can avoid using RSU5_SAPI_BADI for implementations, we can use BW Adapter to extract data from SAP CRM and send it to SAP Business Information Warehouse.
We use Adapter’s:
For sBDocs, BW Adapter extracts objects relevant to mobile clients.
For mBDocs, BW Adapter extracts objects for CRM business transactions and CRM billing.
Tcode – SE19 --> CREATE IMPLEMENATION and select CALSSIC BADI “CRM_BWA_MFLOW”.
After that click on Create Impl. (As we using CRM extract so it’s better to ignore using FM “RSU5_SAPI_BADI” and use “CRM_BWA_MFLOW”)
Step 1 :
Once clicking on create impl , give your BADI name as per your naming convention :
Next, fill the required fields
Step 2 :
Then click on INTERFACE tab:
Double click on Method “ENHANCE_DATA_SOUCRE” , which gives the CLASS BUILDER where we can write our logic.
Sample Logic to read CRMD_CUSTOMER_H table via XIF FM 'CRM_BADI_GET_XIF':
DATA: LT_TEST TYPE TABLE OF CRMT_BW_SERVICECONTRACT_H,
WA_TEST LIKE LINE OF LT_DATA.
DATA: LT_TEST_XIF TYPE CRMXIF_BT_SRV_CONTRACT_T,
LS1_TEST_XIF LIKE LINE OF LT_DOCUMENTS_XIF.
DATA: LS_CUSTOMER_TEST TYPE CRMXIF_CUSTOMER_H.
CASE I_DATASOURCE.
WHEN '0CRM_SRV_CONTRACT_H'.
LT_TEST [] = CT_DATA [].
REFRESH CT_DATA.
CALL FUNCTION 'CRM_BADI_GET_XIF'
EXPORTIN
I_DATASOURCE = '0CRM_SRV_CONTRACT_H'
IMPORTING
E_T_RESULT_XIF = LT_TEST_XIF.
** Get the data in the internal table.
LOOP AT LT_DATA INTO WA_DATA.
MOVE LT_TEST_XIF -CUSTOMER_H-DATA TO LS_CUSTOMER_H.
WA_TEST-ZZOPTY_NUMBER = LS_CUSTOMER_TEST-OPTY_NUMBER.
MODIFY LT_DATA FROM WA_DATA Transporting ZZOPTY_NUMBER.
Tcode – RSA3
Part 2:
2.3 Enhancing Data Source by maintaining fields in BW Adapter:
We can use BW Adapter in BADI place which is better option in performance perspective , so whenever extractor is triggered then it should check BADI logic and execute .This may consume time to extract , so to ignore this we can maintain required fields in BW Adapter .
Below all are few example extractors in SAP CRM system which supports BW Adapter:
Extractors |
---|
0CRM_SRV_PROCESS_H |
0CRM_SRV_PROCESS_I |
0CRM_SRV_CONFIRM_H |
0CRM_SRV_CONFIRM_I |
0CRM_SALES_CONTR_I |
0CRM_SRV_CONTRACT_H |
0CRM_UT_SRV_CONT_I |
0CRM_SALES_ACT_I |
0CRM_OPPT_H |
0CRM_OPPT_I |
0CRM_LEAD_H |
0CRM_LEAD_I |
0CRM_COMPLAINTS_I |
0CRM_SALES_ORDER_I |
0CRM_QUOTA_ORDER_I |
Maintaining fields in BW Adapter:
In our example we are using “0CRM_SRV_CONTRACT_H” extractor and we need data from table “CRMD_CUSTOMER_H” and field required “OPTY_NUMBER”.
Once the required field is appended in extract structure (after step 2 from the above document) , we should maintain the required fields in BW Adapter ( T-code : BWA1).
Click on change:
Click on mapping tab:
Maintain the required field in this tab by giving the segment name “CUSTOMER_H” and segment field “OPTY_NUMBER”.
Segment name is the tructure name as per XIF “CRMXIF_BT_SRV_CONTRACT” and segment field is the equired field in the table.
Once the mapping is done,save the adapter and check RSA3 for the output.
Tcode – RSA3
Note: If we maintained the required field in BW Adapter (Tcode – BWA1) then no need to write logic in BADI.After the required data is being populated and tested we can replicate the changes to BW and when you run the extractor (RSA3) for the first time it will give error , we can ignore it and re-run it.
Few steps which needs to be taken of while working with CRM extractors:
Useful Transaction Codes:
T-Code | Description |
---|---|
BWA1 | BW Adapter |
BWA5 | BW Adapter Data Sources |
SMQ1 | Queue RFC Monitor for Outbound queue |
SMQ2 | Queue RFC Monitor forInbound queue |
SMW01 | Transaction for Monitoring BDocs |
SMW02 | Display BDoc Message Summary |
SMOEA | Administration console – CRM Middleware |
SBDM | BDoc Modeler |
SPRO | Configuration Related Settings |
ST22 | Short Dump Analysis |
BWA7 | BW Adapter Data Sources status |
Thanks for reading
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
7 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |