Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
8,678

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.

  1. CRM Data Source à 0CRM_SRV_CONTRACT_H
  2. Contract XIF Structure à CRMXIF_BT_SRV_CONTRACT

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 :

  • An opportunity represents possibility for sale of services or products.
  • A bid invitation, a sales deal or a trade fair can result into opportunity.
  • Also Opportunity can be created with the Hot Lead, which is a business transaction in the Marketing process.

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:

  • Synchronization Business Documents (sBDocs) &
  • Messaging Business Documents (mBDocs).

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”)

  • RSU5_SAPI_BADI and CRM_BWA_MFLOW both BADI definitions can be used for implementation but we are using transaction data we need delta also so “CRM_BWA_MFLOW” BADI is better to use.

  • CRM call’s “CRM_BWA_MFLOW” in mapping process but “RSU5_SAPI_BADI” is called later before the individual data packages are passed to BW just like EXIT_SAPLRSAP_001 functional exit.

  • SAP gives some performance optimization function modules to be called in CRM_BWA_MFLOW, like 'CRM_BADI_GET_XIF', this is used to avoid long
    run time of extractor. These are not applicable for “RSU5_SAPI_BADI”.

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:

  • Check if the required extractor is activated (Tcode : BWA5)
  • Once extractor is replicated to BW, make sure to activate DELTA for the extractor (Tcode BWA7).   
  • BW Adapter or BADI, any one option will work for a particular field at a time.
  • To transport BWA1 changes to next landscape, make sure to capture object type SMO4 and transport to target system.

Useful Transaction Codes:

T-Code Description
BWA1BW 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
SPROConfiguration Related Settings
ST22        Short Dump Analysis
BWA7   BW Adapter Data Sources status


Thanks for reading

5 Comments
Labels in this area