can you provide some how to documents on creating custom rules? I think I have to enhance an existing BAdi? This can be done in spro->...->BAdI: Enhancement for Rule Processing in Campaign Automation?? Or is there any other possibility? Can I call just a simple fm from decision node?? I'm new in SAP and don't know how to do that.
Example: I want to check in a decision node, if a status of a business partner has a certain entry, like 'interested'. For this example I think I need a custom rule which gets partners id as input and give the status (or boolean) as output back.
best regards, Anna
I think that BAdI: Enhancement for Rule Processing in Campaign Automation is used for some other requirements then you need.
In your scenario you can get all needed information in documentation of SPRO node following this path: SPRO -> CRM -> Marketing -> Marketing Planning and Campaign Management -> Campaign Automation -> Create User-Defined Condition Templates.
I will try to describe the same but perhaps in easier way.
So let's start:
1. You have to go through a wizard in mentioned entry "Create User-Defined Condition Templates to create custom rule.
1.1. On Basic Data step you should enter a description for new rule and choose a category (Hint: if you'd like to use a new category, your own one, please take a look at the end of this reply). Note a Template Number because you'll need it in future steps.
1.2. On Text step you should enter a text of your rule as you'll see it defining a decision node. Variables should be enclosed in & symbols. For instance in your scenario with business partner it should be: Business partner has status &v1&
1.3. On Parameters step you should enter:
- Type of parameter for each of your parameter (which in & on previous step). Here you can choose simple types (for instance, decimals, free text and so on) or more complex types as Listbox or F4 help (how to enable it see below).
- Size of parameter.
- Input prompt. This is how it will appear when you choose the rule in campaign automation. If we continue with your BP example it should be for instance Choose status. Then in popup when choosing a rule you'll get: "Business partner has status Choose status".
1.4. Then you finish the wizard. Provide transport request if you're asked. You can check the OTR entry for your rule in tx. SOTR_EDIT. The alias for your rule will look like CRM_MKTCA_RULES/OTR_TEMPLATE_XXXX where XXXX is the Template Number from step 1.1. Here you can translate it to different languages. Below the entry "Create User-Defined Condition Templates" in spro there is the entry "Administration of User-Defined Condition Templates" where you can see already defined user rules.
2. You need to implement BAdI CRM_MKTCA_UDCT (the entry BAdI: Implementation of User-Defined Condition Templates in spro) to define actual logic for your rule and provide input help for variables with F4 help or with Listbox (as you defined in step 1.3).
2.1. Create a new implementation of BAdI CRM_MKTCA_UDCT and enter Template Number as a filter.
2.2. In method INPUT_HELP you need to provide values for F4 help or listbox. In FLT_VAL you'll get a Template Number (because it is a filter actually). In PARAMETER_NAME you'll get your each variable. In scenario above it will be v1. And you need to provide tables VALUES with pairs key-value. For instance you can create v1 variable as listbox in step 1.3. and provide here all available business partner's statuses with their texts.
2.3. In method EVALUATE you need to implement your actual rule logic. You can use RESPONSE to get some information about object which is being checked know. For instance you can use cl_crm_mktru_response=>business_partner attribute (get it through get_attribute method of RESPONSE) to get partner GUID and get his current status with it. Then you need to check your rule. In your case compare current BP status which you've found with one which is set in decision node. You can get it from PARAMETERS using method getproperty with the name of your variable (v1) as iv_attribute. After comparison you should set RESULT flag as X if the rule is passed. And clear it if the rule is not passed.
3. And that is it. Your rule is set up and ready to use.
Hope this will help you.
Ooops. I forgot the hint. Sorry. Here it is.
If you'd like to use a new category, your own one, then you should open tx. SE11 and open domain CRM_MKTRU_RULE_COND_TEMPL_CAT. Go to Value Range tab, then through menu Goto -> Fixed Value Append. Create append there and define desired values for new categories.
thank you for your help!!!!
I´ve implemented all steps you mentioned above. Then I´ve created a new process with 3 campaign elements, see screeshot:
The problem is, that only the first ca element get triggered. at the point of decision node I have the following condition(just to test it): "The BP have the Status 'AAA'".
In the BAdi Implementation I´ve created (in methode evaluate) the following(just for testing):
DATA: lv_tmp TYPE STRING.
WHEN '1001'. "template number
lv_tmp = parameters->getproperty( iv_attribute = 'STAT1' ).
IF lv_tmp EQ 'AAA'.
result = 'X'.
The problem is, that the debugger doesn´t gets triggered. Do I miss something? In tcode swia I can see, that the first element is triggered and I´ve got the email. At the point of the decision node, nothing happens.
Workflow customizing is ok, I have checked this with an other campaign automation without decision node. Please help..
Thanks in advance!
Just to let you know how it works. Decision nodes are triggered from the action of business transaction which corresponds to a campaign element preceding to these decision nodes.
I'll explain. There is a standard action CAMPAIGN_AUTOMATION_ACTIVITY which actually run decision node evaluation.
So what should be done. You should use activities for communication channel in your first campaign element. Then for business transaction type of this activity an action profile should be assigned. This action profile should contain an action with method MKTCA_PROC_INB. I'd suggest to refer to standard action CAMPAIGN_AUTOMATION_ACTIVITY in action profile CAMPAIGN_AUTOMATION_ACTIVITY for action configuration. Then you should decide in what point of time you'd like to trigger the decision evaluation. And depending on this configure schedule condition for the action (for scenario when the action should not be triggered upon document creation but when the status of a document is changed to certain one for instance).
Hope it will help you.
I think we are shortly before the target ;-)
I have an email activity in my first ca-element. the action profile CAMPAIGN_AUTOMATION_ACTIVITY is assigned to transaction type "Incoming E-Mail". The action profile contains the method MKTCA_PROC_INB.
I have a question regarding: "Then you should decide in what point of time you'd like to trigger the decision evaluation" -->I want to trigger the decision evaluation for example when the email recipient answers to the email, which he gets in preceding element. But how to do that? Why do I have to manipulate the method? I thought this will work automatically?
I would be very thankful if you provide me step by step process. As you know, I´m new in SAP and especially in CRM Marketing
P.S. I have tested it again, the first ca-element gets triggert and i get the email (do I have to config something in ERMS to get the answer?). after the email get sent, nothing happens...
Thanks in advance, Andrei!
Here we come to the interesting land of Campaign Automation.
You should answer yourself the following question before continuing.
How are you going to "receive" that answer from a recipient in SAP CRM?
For instance, if you ask how it is in standard, you should use next scenario:
You send out emails from campaign element (use communication channel without activity).
These emails contain the link to survey form which has been created in SAP CRM.
And when a recipient follow the link and arrives at the survey form we can say that he "answers" our email.
So the activity with survey result is created when the recipient fills in the form.
This activity is inbound (btw, because of this there is a Schedule Condition for CAMPAIGN_AUTOMATION_ACTIVITY activity as "Activity direction = Inbound"), connected to the campaign element and so the action for decision nodes is triggered here.
For more information please refer to next sources:
help topic Example of a Multi-Wave Campaign
Hope this will help you.
I also believe you can use ERMS to handle answers.
You do not need activities when sending emails out.
You'll need to set the scenario in such a way that answers should somehow contain the reference to a campaign element. And on the arriving of such email answer to the system ERMS should create an inbound activity which in turn will trigger the action.
I will not use surveys. I want to use URL tracking in my scnario. When I send an email with URL (tracking is acivated) and the BP select this URL, the field sum_access at the table CRMD_IM_ML_ITEM gets incremented. Now the decision node have to be triggered, but how to do that? Do I have to implement a custom workflow?
as I stated above. The only place where decision node is triggered is an action with method MKTCA_PROC_INB. So to trigger a decision node you need to trigger the action. To trigger the action you need an activity be created or changed (set new status for instance).
Unfortunately I have no idea with tracking scenario.
I have a question regarding what you wrote: "And on the arriving of such email answer to the system ERMS should create an inbound activity".
Question: Where are inbound stored? how can I create an inbound activity to start respective action? Is there any way to create an inbound activity wihtout using surveys? Can I "fake" a table entry or something similar to get the respective action started?
I'm a little bit confused with your question.
You should create an inbound activity from technical point. I mean that inbound activity is just a document. And you should create it to trigger an action. To create an activity you should use an appropriate BAPI for instance. Or if you just want to simulate the proccess then create an activity in general way (in WebUI or in GUI in tx. CRMD_ORDER). It should be inbound, it should have reference to your campaign. And certainly the type needs to be which you've assigned action profile to.
thank you very much for your effort!
Could you please describe in detail how to create an inbound activity from technical point? Just use FM crm_order_maintain to create for example an incomming email (i´ve assigned the action profile CAMPAIGN_AUTOMATION_ACTIVITY to this business transaction type)?
What I did not understand: If I call this FM (from ERMS), how to get the reference to the campaign?
An other question:What exactly happens when a business partner answer to a survey? how is the technical process from arriving of the answer till triggering the inbound activity? I don´t use surveys, but I think I have to do something similar (I want to use ERMS).
Thank you very much!
Yes, Anna, you can use CRM_ORDER_MAINTAIN.
When customer fills in a survey he followed the link to reach the survey. And this link actually connects survey to a campaign as I understand. So here the system knows which campaign refers to.
If you choose ERMS you should probably do the same. I mean as I understood you send the e-mail to the customer and he answers it. Then you handle it by ERMS. So you should include some reference to the campaign (for instance, put its ID in email body or something else) in your mail.
I think I can get the ID of the BP from his email - that is easy to implement.
But how to create a reference to the campaign??
I think it make no sense that every incoming email should start decision node evaluation??? (because of assigning action profile (CAMPAIGN_AUTOMATION_ACTIVITY) to business transaction type "incomming email". You know what I mean?
The other question is: You wrote "... he followed the link to reach the survey. And this link actually connects survey to a campaign...". How this link is connected to the campaign in technical point? Is there any table which gets refreshed or get a new entry? I think I could refresh this table entry by ERMS.
Sorry for all that confusion, I`m an absolute beginner and very thankful for your time, Andrei!
it´s not really a business problem. I´m currently trying out campaign automation (with all customizing you have to do to get the ca automation work). My problem is that I will not use surveys and nearly every thread with how to on ca automation is about surveys...I have the problem that the decision node do not gets triggered and I don´t know why.
If you have any advice, I would be very thankful.