Skip to end of metadata
Go to start of metadata

In this wiki, I am trying to explain you how we can enhance ELM functionality in SAP CRM 7.0

Lets look at first important thing in ELM i.e. mapping formats, creating a mapping format on CRM web UI is a very important and essential step while working on ELM. In mapping formats, we specify which field of input data file is mapped to which field of ELM, available in mapping formats. After creating the mapping format it generated a mapping format id and same would be used as a filter in the ELM BADI (CRM_MKTLIST_BADI discussed later in this blog). We can create as many mapping formats as we want but don't forget to add the corresponding mapping format ID in the filter list of CRM_MKTLIST_BADI implementation. Click here to learn more about mapping formats.

Let’s discuss about what all things you, as Technical Consultant, have, to meet the Customer's expectations / reuirements.

In general, the fields available in standard SAP CRM system, to create the mapping formats, are not sufficient to meet the customer requirements, hence, there is need to have custom fields in mapping formats to read Customer specific input data file (or List).

For this purpose following structures can be enhanced by creating append structures.

  • CRMT_MKTLIST_ORG_EXT - For Business Partners with category Organization
  • CRMT_MKTLIST_PER_EXT  - For Business Partners with category Person
  • CRMT_MKTLIST_LEA_EXT   - For Leads (Business Transaction)
  • CRMT_MKTLIST_ACT_EXT  - For Activities (Business Transaction)

Note: The enhancement category for above structures is character-type or numeric, so components in the append structures should be created accordingly. 

As soon as the append structures are created and activated, respective fields would start appearing as available fields for the mapping formats.

Now, the next step is how to handle these fields for our purpose, SAP has delivered one BADI for this purpose where a Technical Consultant can access these fields and write the logic as per Customer’s requirement. The BADI name is ‘CRM_MKTLIST_BADI’ and SAP has also delivered the default implementation class ‘CL_DEF_IM_CRM_MKTLIST_BADI’ for this BADI.

Let’s look at the methods of this BADI:




Clear Temporary Data


Create Target Group


Create Target Group using Marketing Contacts


Duplicate Check


Postal Check




Create Business Partners


Additional processing after Business Partner creation


Additional processing after Target Group creation


Additional processing after list deletion


Create Business Transactions


Check Business Partners to be deleted


Create Marketing Contacts

Before the implementation of this BADI, my suggestion is to create a copy of the default implementation class. Now, create an implementation of this BADI and use the newly copied class as the implementation class in your BADI implementation. 

In your implementation class now you will have following additional methods (From default implementation class) apart from above mentioned methods of BADI.





Create organization


Create person


Add International Address Version


Add International Address Version to relationship


Create Activities


Create Leads


Prepare Lead/Activity/Order Header


Update Organization - Trusted Source


Update Person - Trusted Source

Scenario: Create BP with BP Role:

Now, let’s discuss a scenario where the Customer wants all the Business Partners should be created in a specific BP Role for both categories (Organization and Person). For example Business Partners with Organization category should created in Account or Competitor BP Role where as Business Partners with Person category should be created in Employee or Contact BP Role. 

As BP Role field is not available in the standard fields list, delivered by SAP, to create mapping formats, so first enhance the following structures with BP Role field:

  • CRMT_MKTLIST_ORG_EXT - For Business Partners with category Organization
  • CRMT_MKTLIST_PER_EXT - For Business Partners with category Person

 Field Name: ZZRLTYP


Now you can access BP Role filed (ZZRLTYP) and write your logic in CREATE_ORGANIZATION, UPDATE_ORGANIZATION, CREATE_PERSON and UPDATE_PERSON methods. For this example you can use FM BAPI_BUPA_ROLE_ADD_2' to add a BP Role to a BP.

In the same way, we can enhance Leads or Activities structures, depending on the customer’s requirement. CREATE_LEADS or CREATE_ACTIVITIES method of the BADI implementation class can be used to write custom logic.

Debugging the implementation of CRM_MKTLIST_BADI

Debugging of CRM_MKTLIST_BADI implementation is not just put a break point in the implementation class and debug. Click here to learn how to debug ELM BADI. 

Campaign Element Issue and its resolution

As per standard  behaviour it is necessary to provide campaign or campaign element in the input file to create leads and activities, otherwise it displays an error message saying 'Initial campaign ID provided'. To overcome this issue, there is an option to use CHECK_RESPONSE method of CL_CRM_MKTLIST_MR_CHECK_TOOLS and write the logic to remove corresponding error message with message class CRM_MKTLIST_MR and message id 281, by doing an implicit enhancement at the end of the method implementation. We should also not use FM CRM_MKTLIST_FILL_DOCFLOW in CREATE_LEADS and CREATE_ACTIVITIES method otherwise it will add another error message related to campaign not determined.

Important Point 

In case you are using sy-uname some where in your logic to access current logged in user in ELM BADI implementation, it will work well in debug mode and you will see correct logged in user. But when you will use ELM in normal mode (Not in Debug mode) sy-uname wouldn't give you the current logged in user as workflow user (i.e. WF-BATCH) is configured to run ELM.

We can find the current user from table crmd_mktlist_h based current list guid.

Refer the following discussion for adding Long Text(Notes) to BP:


  1. Ajaya,

    This wiki is very helpful.  thank you for posting this.  I was wondering if you have had any experience changing or adding new messages to the log when errors are found within processing the BPs.  For example, a list is ran though and a duplicate is found, how do you handle that messages related to the record to be displayed to the user.  I am having issues where the message is being added to the ET_RETURN and back to the calling CREATE_BUSINESS_PARTNER method, but it somehow seems to get lost as when I go back to webUI, click on errors on step - Maintain Busines Partner, the warning message appears 'Cannot find error message for this list'

    Any thoughts on this?



  2. Hi ajaya,

    This is one of the best wiki about ELM i have found. Keep it up.

    Although 1 more point to add : Please Check out note : 708557 (ELM troubleshooting) which is very much helpfull to developers.

  3. Former Member

    Hello Ajaya,

    I've one question. I enhanced structure CRMT_MKTLIST_LEA_EXT using an append for a new field. This field uses a Z-data-element and a Z-domain. There is a value table maintained in the domain. But if I try to create a mapping rule for this new field, values from the value table are not provided. And it is not possible to maintain own values in this table without a template.
    Component ELMMAPOE, View VEditMappingRuleValues, Context node FORMATFIELDVALUE, attribute VALUE_TARGET does not have an implementation of V-Getter-method, so I suggested, possible values are provided from the value table of domain. Any hint, what is neccessary to get these values?

    Regards Martin