Wednesday, December 28, 2011

New feature within SAP CRM 7.0 EhP1 – Object Tagging

As per EhP1 of SAP CRM 7.0 the “Object Tagging” has been made available. With Object Tagging or Tag Cloud, you can easily put all kinds of tags on most of the objects across Sales, Service and Marketing area. Object tagging is a great feature that allows you to tag an instance of an object (Eg. an order) and share the tags with the community.

Wednesday, December 21, 2011

Sybase Mobile Sales 2.0 requirements

Some of you might be teased by the blogpost of November 30, 2011...
The new CRM Mobile Sales 2.0 application looks really nice, and seems to be spot-on for the CRM functions you would like on a mobile device.

Wednesday, December 14, 2011

Territory Management – Enhancements

When using Territory Management (TM) some enhancements can make life a lot easier. 
In this blog we will describe some of these enhancements. 

New Customers
Standard all new business partners are added to table CRMD_TERRMAN_LOG so that the delta run of report CRM_TERRMAN_PROC can process new customers. This means that business partners in all roles (except employees). If you want to filter this on for example role (suspects) or type (contact person) you will have to change the standard implementation of the BADI BUPA_GENERAL_UPDATE.

Wednesday, December 7, 2011

Creating direct links to specific transaction types

When you create a direct link (visible via a direct link group) to create an activity, you can choose to either show a popup to select the activity type, or with some simple customizing specify the transaction type in the direct link.

Wednesday, November 30, 2011

New in SAP CRM Mobile Sales 2.0

Version 2.0 of Mobile Sales for SAP CRM has been released in the AppStore today, so a great time to look at the new features.

I will compare the functionality to the 1.x versions of the app. For more information on the 1.x version, check also this blog.

Wednesday, November 23, 2011

Territory Management – The Basics

There are several scenarios for which you can use Territory Management (TM).
Territory Management is used most for reporting and for the determination of the employee responsible within business transactions.

You start by creating a hierarchical territory structure that describes your sales areas. You can describe the territories using attributes like sales organization, country of the Business Partner (BP) and postal code of the BP.

After creating your territory structure you can assign positions of the organizational model to your territories. The system will determine Business Partner assigned to the positions and link them to the territory. This way you are able to link persons to their responsible territories.

Wednesday, November 16, 2011

The 'Switch' in 'Enhancement & Switch framework'

I had been wondering if the switch framework could be something I could use to structure enhancements I do to the system.

So, at TechEd in Madrid, I decided to learn more about the framework, and I would like to share that with you.

Wednesday, November 9, 2011

Enhancing the Account Search

Case
Let's start with a business example.
You are in a B2B environment, and some of your customers operate under several names. Sometimes, they identify themselves with a brand instead of the actual official registered name of the company. How should we properly deal with this scenario, without having to implement expensive 3rd party tooling or creating multiple business partners who actually represent the same partner in real life?

Wednesday, November 2, 2011

Central Sharing Tool in SAP CRM (EhP1)

As per EhP1 of SAP CRM 7.0, the 'Central Sharing Tool' has been made available.
This article describes how to customize and use the central sharing tool.

The central sharing tool enables users to share some objects they think are also of interest for other people in the organisation.

Wednesday, October 26, 2011

Missing fields in the UI Configuration Tool? Check the Design Layer Customizing

Sometimes, while customizing screens in the configuration workbench, you might run in to the fact that even though you can see a field in a context node in the workbench, it may not appear in the available fields in the configuration workbench...

Wednesday, October 19, 2011

How to extend the standard SAP IMG?

Scenario: Sometimes it can be useful to make your own customer-specific customizing tables. For instance, if you have a business rule that changes once in a while but does not exist in the SAP standard customizing tables. To group your own customizing tables together it is possible to extend the standard SAP IMG.

Wednesday, October 12, 2011

Deeplinking to SAP CRM Objects

Have you ever come across something in SAP CRM that calls an object using a deeplink?

A deeplink that looks something like the normal SAP CRM webclient URL, followed by some parameters like crm-object-type, crm-object-action and crm-object-value?




Have you ever wondered if this is something that could be useful?

Have you ever tried to find out how SAP knows that crm-object-type=BT126_CALL&crm-object-action=B should go to a certain screen?

Well, I have, and I will try to explain.

Wednesday, October 5, 2011

Using the do_config_determination to change a screen layout

Sometimes, you run in to a requirement where you would like to change the layout of the screen based on another field, for instance if a dropdownbox contains a certain value, you would like to show different input fields from when the dropdown box contains another value, or in some cases the existence of a value in one field might require input in another field.

Wednesday, September 28, 2011

Rapid Deployment Solution SAP CRM

Recently SAP introduced Rapid Deployment Solutions (RDS) to the market. RDS is a new way of implementing SAP software for new or existing customers based on predefined services and pre-configured content. This initial post describes the new SAP CRM RDS product. More details as well as 'hands on information' can be expected on this blog in a later stage.

Wednesday, September 21, 2011

Direct navigation to search result if only one item is found

An often heard requirement is that users would expect the system to immediately navigate to the details screen of a found item if exactly one is found.

This is particularly expected if the user has searched for an item with a unique key field such as a business partner number. These users are right. What is the use of a search result screen if exactly one item is found? Why not go directly to the details of business partner, activity, opportunity, sales order etc?

Wednesday, September 14, 2011

Adding a calculated field to the screen using the AET

A couple of weeks ago the new features of the Application Enhancement Tool (AET) in SAP CRM 7.0 EhP1 have been listed in this blog. One of these new features is the possibility to add a calculated field to the screen using the AET.

Wednesday, September 7, 2011

Interfering in a running workflow using parallel paths


When implementing workflow, you might run in to the fact that a change in the document that triggered the workflow should influence the running workflow.

For instance, a change of the status of the original document should stop the running workflow, or maybe restart the workflow, or maybe change the processor of a workflow task. When you design the workflow, you can ‘subscribe’ to events on the original document by adding a ‘wait’ step in your workflow. This in fact will pause the workflow until the event is raised.

 



Wednesday, August 31, 2011

Triggering a workflow from abap

Last week’s post was about creating a workflow on a custom object.

In a normal situation, when using standard objects in workflow, you subscribe your workflow on existing events on existing standard objects.

These events are raised in standard coding, at the right time.

When using custom objects, you should also raise the event in custom coding, so for instance after saving an instance of your custom object to the database, you should raise the CREATED event.

Wednesday, August 24, 2011

Using custom objects in SAP Workflow

When implementing workflow, you have the possibility to trigger workflow from an event in a BOR object (transaction SWO1) and passing the object to the workflow and use it in tasks and activities in the workflow.

Now imagine you want to create a workflow on a custom object, an object not supported with a standard object in SWO1 or even an object in another system. You would not be able to do this unless you create a custom object in SWO1. Let’s see what needs to be done.

Wednesday, August 17, 2011

Adding a mash-up to the screen using the AET

Last week’s blog introduced the Application Enhancement Tool (AET). Adding new fields to the web UI screens is reduced to a relatively easy job using the AET. In SAP CRM 7.0 EhP1 the AET has been extended significantly.

It is not only possible to add fields in this new version, but the same concept can now also be used to add mash-ups, transparent tables, database views and the results of webservice calls to the web UI screens.

Adding web content to the account overview screen can now be implemented in less than 5 minutes. The following example demonstrates adding Google Maps content to the account overview screen.

Wednesday, August 10, 2011

Adding custom fields to the screen using the AET

AET stands for Application Enhancement Tool, and as the name suggests, the AET helps you enhance the application.
In many previous posts, tools were explained on how to influence and enhance the application by implementing logic. The AET enables you to enhance the application by implementing new fields.

Adding fields might not look like rocket science (and it isn't of course), but is technically more complex than you might imagine. SAP CRM is designed according to a layered model, like the OSI model. Which is good from a software engineering perspective. Decoupling the functions in each layer enables you to change stuff in one layer without disturbing the others.

The biggest downside of the layered design would be that adding a field at database level, will not automatically also add the field in the Generic Interaction Layer, nor in the Business Object Layer, nor in the Presentation Layer. 

The AET takes care of this for you. Beside adding the field to all the layers, the field is also added to the applicable BW Datasource, so the information that is entered will also be available in BW.

Wednesday, August 3, 2011

Adding functions to events using CRMV_EVENT

Another great tool to influence the system is adding Callback Functions in CRMV_EVENT. This is a totally different mechanism from last weeks' IC Event mechanism.
The similarity between the two is that both enable you to add custom coding to standard. The difference is that IC events occur because they are raised in specific coding (can be anytime), while the events available in CRMV_EVENT are always triggered from an operation on a oneorder object (where a oneorder object can be a salesorder, activity, service order, etc etc.).

Wednesday, July 27, 2011

Influencing the Interaction Center with IC Events

In recent posts, I described how you can influence the working of the interaction center. For instance, using IDI, you can influence the screenflow and raise alerts.

IDI actually uses a function in the interaction center called IC events (Interaction Center Events).

The events are raised when certain situations occur, for instance ‘Businesspartner confirmed’ or Contact Ended’.

There are two ways you can influence the working of the IC webclient using IC Events with ABAP coding.
  • Raise an event.
  • Subscribe to an event.
Of course, it is not recommended to raise a standard SAP event in coding unless you are perfectly positive this is what you need, as you are bound to run into unwanted side effects (imagine raising the contact ended event while this is not the case).

You can of course very well combine the two. Raise a custom event which you have subscribed your custom event handler to.

If you want to determine which events are raised in which order at which time, you can put a breakpoint in CL_CRM_IC_EVENT_SRV->IF_CRM_IC_EVENT_SRV~RAISE.

This is actually a good starting point to explain how this works.

Wednesday, July 20, 2011

Call lists: Archiving calls to improve performance

If you have implemented an interface or an action that feeds calls to call lists, you will run in to the fact that call lists will keep growing, as there is no possibility to archive calls from the call list. Eventually, the size of the call list will decrease the performance of the call dispatcher, as it technically it has to evaluate all closed calls as well.

Wednesday, July 13, 2011

Call lists: Next call determination using the call dispatcher

When implementing call lists, you can decide whether users have to select the next call themselves, or if the system determines which call is to be processed next.

Especially in B2C environments (but possibly also in B2B), having the system determine the next call automatically is logical, why would you allow the agent to manually choose the next call?

Another very good reason to use the call dispatcher is if you have multiple agents working on the same list at the same time. If you would have the agents select the next call themselves, chances are pretty big, the selected call has just also been selected by another agent, and is thus already locked. Using the call dispatcher will solve this problem as well, as the system will not determine a call that has already been assigned to another agent.

Wednesday, July 6, 2011

Call lists: Creating a new call in a call list

There are several ways to add calls to a call list, for instance the following:

1. Manually in transaction CRMD_TM_CLDIST
2. Generated using transaction CRMD_CALL_LIST
3. In ABAP using classes cl_tm_clm_interaction and cl_clm_call_list.

Wednesday, June 29, 2011

Call lists: Call list synchronization

When implementing call lists, you have the choice to either work with or without activities linked to the calls. Whether you link an activity to the call or not depends on what role the call has in the customer process.

Probably the biggest benefit of working with activities linked to the call is that calls by themselves are not visible on the customer overview, while activities are. If you choose not to implement activities linked to calls, users will not be able to see that a customer has been selected to be called from the call list. They will see the standard interaction record though if this was created by the user during the call.

Other benefits of the use of activities in call lists would be for instance that the status and the reason of the call can be maintained in the activity, as well as a long text on the call. Furthermore, a campaign can be attached to the activity, if the activity is linked to a marketing campaign.

Wednesday, June 22, 2011

Call lists: Call list maintenance

Call lists are maintained in the IC Manager role, or a derivative of the IC Manager businessrole.
When planning your call lists, there are a few things to consider:
  • What is the purpose of the call list?
  • Who should be in the call list?
  • Who will be working on the call list?
  • When should the call list be active
  • Is there an automatic script involved?
  • Will the agents be working with CTI (Computer Telephony Integration)?
  • How many attempts do you want to do before giving up?
  • How many attempts should occur per day?
  • Do you want the call list to consider the customer’s calling hours?
  • Do you want to call the customer, or a contact person?
  • What should happen when the call is rescheduled?
  • What are the various reasons for rescheduling?
  • In what order would you like customers to be called?
  • Is this call list a one-time call list, or a recurring call list?
  • Where do you want to ‘feed’ the call list from?
  • How do you prevent duplicates in the call list?
  • If multiple agents will be working on the same list, how do you prevent another agent calling the same customer minutes after the previous attempt?

Wednesday, June 15, 2011

Call Lists: Customizing

When implementing call lists, there is some customization to be done.

SAP Customizing Implementation Guide -> Customer Relationship Management -> Interaction Center WebClient -> Additional Functions -> Call Lists
  1. Define call list types
  2. Define a call list dispatcher
  3. Define actions
  4. Define Call list Synchronisation
  5. Add call list maintenance to the IC Manager Role
  6. Add call list execution to the IC Agent Role
Call list types
A call list type is the group of settings like call list dispatcher, rescheduling component etc. Every call list will be assigned to a call list type.

Define the call list dispatcher
The call list dispatcher allows you to automatically assign the next call from a call list to an available agent. When using a call list dispatcher, agents will not have to choose themselves which customer from the list is first to be selected.
The call list dispatcher also decides which customer is to be called first based on the ordering rules you have maintained.
In the call list dispatcher you are also able to for instance decide that a customer should only get one attempt per day.

Wednesday, June 8, 2011

Marketing using call lists

When thinking of customer service, we automatically think of a callcenter that processes inbound phonecalls, emails, letters and in some cases even chat. This is a logical thought, because throughout history, service was always initiated from the customer asking for service. Also, from a cost perspective, inbound calls are cheaper than outbound calls. Last but not least, the probability of the customer wanting service is bigger when he asks for it.

When thinking of sales, we are more likely to think of a salesperson visiting the customer, or calling the customer to inform him on the new product. This is a logical thought, because a sales process is more often initiated by the selling party.

If we combine these two worlds we can think of cross selling during service, so first servicing the customer making him happy and then doing him a good offer. If we take this a little further, we could consider triggering service (like for instance offering the customer a check-up of his product, or evaluating his satisfaction of the product) in order to maybe generate a new sale. A service offering is most likely to be done via a multichannel marketing campaign.

Wednesday, June 1, 2011

Usage of custom businessrole parameters

In the customizing of the UI Framework, there is an option to ‘Define Parameters’.
 
SAP Customizing Implementation Guide - Customer Relationship Management - UI Framework - Technical Role Definition - Define Parameters.

Here, in the top node, you can maintain custom parameters. As an example, I will show you how this can be used to default a value in the IC webclient search screen.
Let’s say you want to default the country in the search screen to help users find the correct businesspartner more quickly.
Create a new parameter, in our case ZCOUNTRY.

Wednesday, May 25, 2011

ACE Technical details

If you apply ACE to business partners, a few tables are generally relevant:

CRM_ACE2_BP_ACL
This is the actual Access Control List. Here, all relevant business partners are linked to an ACE-group.
One business partner can be assigned to several ace-groups.
This table will generally contain many entries (at least one for every BP).

CRM_ACE2_BP_GRP
Here, rights are mapped to actor_id’s and ACE-groups.
This table will generally not contain many entries.

CRM_ACE2_BP_UCT
The CRM_ACE2_BP_UCT contains the mapping between actual USERID’s and the ACEGROUP.

Wednesday, May 18, 2011

How ACE (Access Control Engine) works

ACE (Access Control Engine) is a generic authorization mechanism in SAP CRM. In contrast to the conventional authorization in SAP CRM, ACE uses Access Control Lists instead of authorization based on object’s attributes. Whenever an object shows up in the screen (either in a search result or in an assignment block), the system checks if the object is available in the access control list (ACL) for this user, and if the display-action has been applied to the list. The same logic is applied if the user wants to change the object, but then with the change-action. Determination of the access control list can be user specific, role based or group based.

If for instance you want to grant edit-access to a group of customers only to a specific group of users, this would be possible with conventional authorization, but if you also want this group to be able to edit the contact persons of this group of customers or see the activities of this customer, this was not possible with conventional authorization. With ACE, it is.

Wednesday, May 11, 2011

Sybase Unwired Platform: As a Service or On Premise?


As shown in this image, if you want to mobilize your SAP CRM system using Sybase, quite some extra servers are involved. Depending on your requirements, you can consider implementing the SUP inside your own SAP Landscape, or you can apply for a SAAS solution through a certified SAP Hosting Partner. 

Wednesday, May 4, 2011

Influencing Recent Edits using customizing

Since CRM2007, users are able to see the recently shown objects in the lower left corner of the screen. This is known as the ‘recent edits’. The recent edits functionality is greatly appreciated by end-users.

In some cases though, the description of the object might not be what you would expect, for instance, phonecall activities (object BTOrder, type BT126_CALL) will not show a description in the recent edits, but shows the activitynumber (which seems less interesting from a user perspective).

Wednesday, April 27, 2011

Approval process using status authorization

Depending on your process, sometimes an approval is needed, or sometimes, not all users are for instance allowed to close a service ticket.

Approval can be implemented using workflow, but if your process is fairly simple and the approver is a regular SAP CRM user, you can also choose to implement a simple approval process using user statuses and user status authorization.

Wednesday, April 20, 2011

Sybase Mobile Sales for SAP CRM requirements

In order to implement Sybase Mobile Sales for SAP CRM, you will need the following components in your landscape:
  • SAP CRM 2007 SP6+
  • SAP Netweaver Mobile 7.1 SP9+
    • Gateway 1.1 SP1+
  • Sybase Unwired Platform
  • Sybase Relay Server



Sybase Mobile Sales for SAP CRM is currently (20-04-2011) available for iPhone, iPad, BlackBerry and Windows Mobile.
After first setup, data is extracted from SAP CRM to the staging area in SAP Netweaver Mobile. This staging area is called the Data Orchestration Engine (DOE). Basically, the DOE data structures are optimized for communication with application on the mobile devices.

Information request from the device
When the device asks for information (i.e. when a new device is subscribed), a call is done to the DOE. The DOE then retrieves the data from the staging area (so no calls to SAP CRM). The retrieval is done based on the distribution rules as set up in the DOE. In case of Sybase Mobile Sales for SAP CRM, the logon-user determines the accountmanager, the relations of the accountmanager determine the accounts that will go to the device. The activities from these accounts will also flow to the device.
All information from SAP NW Mobile is sent to the Sybase Unwired Platform (SUP), and is queued there for further processing if the device is not online.

Wednesday, April 13, 2011

Account overview show only X contacts in the contact history

Recently, I ran into a note, 1226594. This note describes that in the account overview, the most recent activities are not shown. This is something we have noticed already from the start of the CRM Webclient. The logic to select the activities of a customer is basically selecting a set number of entries where the customer is mentioned. 

On database level, this is done by selecting from CRMD_ORDER_INDEX up to X rows. The number of rows to be selected can be influenced in BADI CRM_BP_UIU_BT. In this BADI, you can also influence the selection as described here.

The biggest problem with the selection of the activities is that when the total number of the activities becomes bigger than the X (of the up to X rows), the system selects the first X (the oldest). This is due to the sorting of the CRMD_ORDER_INDEX table.

Note 1226594 implements a fix so that the latest activities are shown.

I strongly recommend you implement this note. The need for the implementation of BADI CRM_BP_UIU_BT as described here is now less relevant.

Of course, implementing for instance cv_max_hits = '10' in BADI method CHANGE_SELECTION of CRM_BP_UIU_BT will still improve performance.

Wednesday, April 6, 2011

Sybase Mobile Sales for SAP CRM functional specifications

With mobility being more and more embedded in everyday life, people expect more every day concerning functionality on the mobile phone. Users expect business software to be made available on the mobile phone.

We all know that business users expect their business software to be as user-friendly as any other software. This of course will not surprise you. This also means though that business users will also expect to have business information on their mobile phone, just the way they get it with other business software.

With currently over 300.000 apps in the Apple Appstore, lots of which combine data from the internet with local iPhone functionality, you KNOW business users will expect this from their business software as well.
With the speed of evolution of mobile devices and the current and expected diversity of mobile standards, it has been proven difficult to create cost-efficient software which supports multiple devices.

Sybase Mobile Sales for SAP CRM is one of the answers from SAP to live up to these expectations.

Wednesday, March 30, 2011

SAP CRM on your iPhone


As of CRM 7.0, it is possible to connect mobile devices to SAP CRM using Sybase Unwired Platform technology. Basically, you will need a SAP NW Mobile instance, a SUP server and a Sybase Relayserver. SAP delivers standard out-of-the-box mobile applications that connect to the SAP CRM system via the Sybase Uwired Platform. Currently, two standard applications are available, Sybase Mobile Sales for SAP CRM and Sybase Mobile Workflow.

More applications are already being developed by SAP.

Wednesday, March 23, 2011

Changing the Work Area Title of an overview page

In the CRM Webclient, every overview page you call has a caption in the header. This caption gives you information of the data below. For instance, in the BP_HEAD/BPHEADOVERVIEW, the account number and the address is shown. In the BT126H_CALL/SALESCALLOVVIEWSET for instance, the information is the transaction type and transaction description.


In some cases you might want to add information to this Work Area Title. This would be particularly useful if you are dealing with information that is important to the agent, but is not available in any assignment block. For instance, you might consider:

Wednesday, March 16, 2011

Webclient UI enhancements: Testing with the standard coding

What if you are facing issues in an enhanced component, but you are not sure if this is a problem in the standard or in the enhancement?

To make this analysis, you could of course delete the enhancement, and put it back in place once you have found the problem, but this is quite extensive, as you would have to re-insert all the coding you had done before.

An easier way is to change the entries in the view BSPWDV_EHSET_DEF.
This view contains all the redefinitions. The view can be called from the BSP Workbench (BSP_WD_CMPWB) in Environment --> Enhancement definitions.

Here, you can change whether the system looks at the redefined BSP, or at the standard. You can also choose to change whether the system looks at the redefined views or the standard view by changing the view controller.

If you change the entries here and restart the browser, you will notice the system runs the standard code. Don’t  forget to put the original settings back though.

Wednesday, March 9, 2011

Save objects in the memory using the BDC (Business Data Context)

In the Interaction Center Webclient, a mechanism called Business Data Context (a.k.a. BDC) is used.
Don’t let them confuse you… BDC is sometimes also referred to as GDC (Global Data Context). It is actually the same.

The BDC is a set of objects stored in the Global Memory of your session. For instance, the CURRENTCUSTOMER is occupied when the business partner in the IC Webclient is confirmed.

Objects from the BDC can be used in the transaction launcher, but of course also in coding.

Standard, the Webclient UI (so for instance the SALESPRO role), does not use the BDC. However, it can be very interesting to know for instance what the last shown customer is, or what the last shown product was, or you can implement a button that calls a launch transaction, and just before calling the launch transaction, you fill the BDC with your current context (i.e., a button on the BP_HEAD).

The objects in the BDC are defined in the IMG:
Customer Relationship Management --> UI Framework --> Technical Role Definition --> Define Global Data Context Parameters

Here, you can add a parameter like ZACCOUNT of type BuilHeader or ZPRODUCT of type Product.

Now in the BSP Workbench, for instance in the BP_HEAD, you can add the following code:

-----------------------------------------
data: __gdc type ref to if_crm_ui_data_context,
        lr_BuilHeader type ref to CL_CRM_BOL_ENTITY.

__gdc ?= cl_crm_ui_data_context_srv=>get_instance( ).

TRY.
       lr_BuilHeader ?= <BuilHeader from the context>.
CATCH CX_SY_MOVE_CAST_ERROR.
ENDTRY.
 
__gdc->set_entity( name = 'ZACCOUNT' value = lr_BuilHeader ).
-----------------------------------------

If you implement this for instance in the BP_HEAD/BPHEADOverview --> DO_PREPARE_OUTPUT, the ZACCOUNT in the BDC will be overwritten every time a different customer is shown. This way, the parameter will always hold the last shown customer. This you might for instance use to call a transaction in the ERP system with a parameter.

Wednesday, March 2, 2011

Performance of the Agent Inbox: Change the Evaluation Path of AI_ORGUS

In the agent inbox, when searching for items of a “my groups”, SAP CRM automatically decides to not only search for items in “your” group, but also for items for all members of the group.

When you do a sql trace, you will notice that when working with big groups (for instance a call center), this can consume quite some time.

To avoid long runtimes in the agent inbox, you can decide to adjust the evaluation path AI_ORGUS in SPRO.

IMG --> SAP Customizing Implementation Guide --> SAP NetWeaver --> Application Server --> Business Management --> Basic Settings --> Maintain Evaluation Paths.

AI_ORGUS is used to decide which partners should be considered in the search.

Find AI_ORGUS and mark all checkboxes in the skip column (on the right).
Now when searching for inbox items, the system will only retrieve inbox items which have been assigned directly to the group (i.e., the group is the responsible department in the partner schema), and not also to members of the group.

Of course, you will have to make sure that the responsible department is part of the partner procedure and is always determined correctly in your process... Otherwise, open items might not be picked up.

NOTE: SAP has decided to reuse the AI_ORGUS (while AI stands for Agent Inbox) in the Pipeline Perfomance functionality. If you adjust the evaluation path for a faster inbox, you should be aware that without any adjustments, the PPM will not work as designed anymore.

Adjust (or enhance) method CL_CRM_PPM_UM_TOOLKIT-->GET_TEAM_OF_ORGUNIT

What you want to do is to replace AI_ORGUS with for instance ZPPM_ORGUS. ZPPM_ORGUS should be a copy of the original AI_ORGUS. Or you can convince OSS of the design error (reusing AI_ORGUS in a different context), and get a note.

Wednesday, February 23, 2011

Making changes in the transaction launcher customizing

If you want to change the system or the BOR object to be called using the transaction launcher customizing, you will notice that this is standard not allowed by the system. These fields are greyed out by the system once the launch transaction is saved once.

If you do need to change these settings, there are two ways to go:
  1. Change the name of the class in the second screen of the wizard. This will give you the possibility to change the data. The old class will also remain in the system, but will not be used anymore as there is no customizing referring to it anymore.
  2. Check the name of the class of the launch transaction in the second page of the wizard, and just delete the class in SE80 (or SE24). If you run the wizard again, the fields will be open for input again as the class will be newly created.
If you apply the second method, you will need to trick the QAS and PRD system, because after transporting the new customizing, the class will not automatically be updated. What you need to do is simply walk through the wizard after the transport has gone in, and the class will be generated based on the new settings. Even though the system will tell you the client is not modifyable, you do not need to open QAS or PRD for customizing.


The wizard will tell you that it has been cancelled, but the class has been generated anyway.

 
No worries.

Wednesday, February 16, 2011

Enhanced IC Webclient Alerts

In some of the previous blogs, I explained how you can implement IDI to add for instance automatic navigation, context-based alerts etcetera to the IC Webclient, to improve the effectiveness of the system for the user.

Standard SAP CRM is shipped with some fairly general alerts. For instance, you can have an alert that tells you the customer number, or you can have an alert that tells you the customer has open items.

Beside the standard alerts, in the IC Manager role, you can create new alerts. In these alerts, you can maintain your own text, and use the parameters that have been supplied by the system.

If these standard shipped parameters do not satisfy your needs, you can also add new parameters. For instance, if your users need to have an alert containing all of the customer’s telephone numbers, and not just the first one. Or if you want to notify the user there is an open serviceticket.

Adding a new parameter be done in several steps.
IMG: SAP Customizing Implementation Guide --> Customer Relationship Management --> Interaction Center WebClient --> Additional Functions --> Intent-Driven Interactions

1. Add the technical name of the new parameter ( Define Repository)
2. Add a ‘Fact Gathering’ service (Define Services)
3. Add the fact gathering service to the service manager profile (Define Service Manager Profiles)
4. Apply the service manager profile to the Intent-Driven Interaction Profile (Define Intent-Driven Interacton Profiles)
5. Add coding to the class of the fact gathering service (SE80)

In the following example, I will illustrate with the attribute 'Number of Servicetickets'. This is comparable to the existing FICA_NO_OF_CALLS.

1. Add the technical name of the new parameter ( Define Repository)
  • In the Define Repository in the IMG, select the ICRULE, and click on attributes. Here, add a new attribute, for instance ZNO_OF_SERV.
  • In the Desription, add a description.
  • Tick the Show Attribute checkbox if you want this attribute to be available as a condition in the Rule Policy maintenance.
  • Enter the name of the Fact Gathering Service we will be creating in step 2 (i.e. ZFG_SVT)
  • In Attrib Ext Class, choose the right class from the search help. This determines which operands will be available in the rule policy builder.
2. Add a ‘Fact Gathering’ service (Define Services)
In the Define Services, add the service. In our case, ZFG_SVT. Choose Fact Gathering as the service type. Enter a Service Class. (i.e. ZL_CRM_FACTS_SVT).

3. Add the fact gathering service to the service manager profile (Define Service Manager Profiles)
Add the new Service to the Directly Called Services of your Service Manager Profile. If you have not yet created a Service Manager Profile, create a copy of the IDI_DEFAULT, and add your new service. Make sure all fact gathering services are before the SVC_RULE_EXEC, because you want the fact gathering to take place before rule execution.

4. Apply the service manager profile to the Intent-Driven Interaction Profile (Define Intent-Driven Interacton Profiles)
Make sure the Service Manager Profile is mapped to the Intent-Driven Interaction Profile. If you do not yet have an own Intent-Driven Interaction Profile, create one.

Also, don't forget to apply the IDI profile in the Business Role (Function Profile 'INTENT_DRIVEN_INTERACIONS')

5. Add coding to the class of the fact gathering service (SE80)
In SE80, go to class/interface and create a subclass for CL_CRM_FICA_FACTS_FOR_RULES*.

Redefine the method IF_CRM_SMF_SERVICE~EXECUTE and add the following coding:

METHOD if_crm_smf_service~execute.

DATA: lv_gpart TYPE string,
         lv_cor_available TYPE string,
         lv_dun_available TYPE string,
         lv_no_of_calls TYPE string,
         lv_no_of_svt TYPE string,
         lr_query TYPE REF TO cl_crm_bol_dquery_service,
         lr_col   TYPE REF TO if_bol_bo_col.

  CALL METHOD me->get_bp_confirmed
    RECEIVING
      rv_gpart = lv_gpart.

  CHECK NOT lv_gpart IS INITIAL.

* -- number of calls

  lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQSrvReq' ).
  CHECK lr_query IS BOUND.

  CALL METHOD lr_query->add_selection_param
  EXPORTING
    IV_ATTR_NAME = 'BU_PARTNER'
    IV_SIGN = 'I'
    IV_OPTION = 'EQ'
    IV_LOW = lv_gpart
  .

  lr_col = lr_query->get_query_result( ).
  CHECK lr_col IS BOUND.

  rv_no_of_calls = lr_col->size( ).

  CALL METHOD me->set_fb_attr_by_id
    EXPORTING
      id    = 'ZNO_OF_SERV'
      value = lv_no_of_svt.

ENDMETHOD.


* Depending on your requirements, you might require a subclass for CL_CRM_SMF_ABSTRACT_SERVICE

Wednesday, February 9, 2011

Testing SWO1 objects and conditions

When working with actions, you may need complex schedule- and startconditions. When customizing these conditions, it can be very handy to use the different test / simulate options. Both the SWO1 as well as the conditions maintenance transaction have the possibility to test with an existing business object. This way, you can test (and analyze and even debug) with different situations quickly directly while maintaining.




Testing an object in SWO1
In SWO1, when you have created a new attribute or a new method, you can test this with an existing object by clicking the test button. In the popup, you should enter the key of an existing object (for instance the GUID of a transaction, or a partnernumber). The system will now show the data in the structure of the BUSObject. You will also be able to test (and debug) the methods.


Testing conditions

In the conditions maintenance, you can also use the test button, and use an existing instance to simulate the condition.

When in the action condition editor (CRMC_ACTION_CONF), you can choose between Full screen and Popup mode. In both modes, you will be able to test the condition, but the test buttons will be in a different place...

Find the 'Enter Test Data' button.





In the popup, select the line of the business object, and below, enter or select an object.

When occupied properly, you will be able to see the details of the object if you expand the tree.














Now close the popup and click on the 'Evaluate condition with test data' button. The condition test will now tell you whether the condition returns true or false. This is a good place to debug as well if you really can't figure it out :-).


Wednesday, February 2, 2011

Creating your own Action Methods

As mentioned in one of the previous posts, you can customize actions to be triggered in transactions, based on the context of the transaction. For instance starting a workflow, or triggering a letter to a customer when the status of the transaction changes or when a certain date is reached.

Standard SAP offers some very usefull options, such as:
• Starting campaign automation
• COPY_DOCUMENT: Creating a followup document (for instance a planned phonecall after a visit, or when a contract is about to expire)
• Creating a printout using a smartform
• Creating a reminder mail
• Creating a confirmation mail to the customer

Beside these standard possibilities, you might be interested in creating your own action logic which you want to assign to the business transaction.

Some examples of custom created actions are:
• Change Status: Changing the status of the current document (Nice if you want to auto close a document, or if you want to automatically change a status based on a date)
• Current Date: Enter the current date in a date type (Nice if you want to enter the date of for instance a status change)
• Copy Document and Change Status: A copy of the copy_document & changing the status (The copy_document creates a follow_up document). If you want the current document to get the status “followup created” for instance, you can use this method. This enables you to have different follow-up actions based on the context and still be sure there will be only exactly one followup (so for instance either an email to the customer OR a letter to the customer)
• Write file: This enable you to feed a file with data for for instance an interface or an extract. Particularly usefull for for instance lead interfaces and automated marketing campaigns.

How is this done?
As an example, I will show you how to create the change status action and add it to an action profile.
The coding in the example enables you to both use the action on header as well as on item level.
Create the action definition as defined here.
When defining the action, choose “Method Call”.

In the field “Method”, do not choose one of the existing, but click on the new button below.

In the popup, again do not choose an existing class, but create a new one (like ZSET_STATUS).

Now create the class. Note that the class will be created in definition EXEC_METHODCALL_PPF, and that it has an interface to IF_EX_EXEC_METHODCALL_PPF.

Implement the method EXECUTE.

Note that there are a few parameters you can use in the method:

IO_PARTNER is the partner that has been determined. Which partner from the transaction this is is determined in the action customizing.

IP_PREVIEW is occupied with an X in case the user pressed the Preview button.

The II_CONTAINTER contains the name-value pairs that have been added in the action customizing.

The RP_STATUS returns a code, which can be either of the following:
0 = Not Processed
1 = Successfully Processed
2 = Incorrectly Processed.

During the coding of the class it is important that you check the IP_PREVIEW, and it is important that you correctly set the RP_STATUS to make sure actions are not reprocessed while they shouldn’t.

And never put a commit in an action, but call the method register_for_save in class cl_action_execute.

As an example for the ZSET_STATUS. Note that in the example, 2 parameters are read from the ii_container: 'STAT_PROC'  and 'STATUS'.

Good luck!

Method IF_EX_EXEC_METHODCALL_PPF~EXECUTE.

  
DATA: lcl_action_execute   TYPE REF TO cl_action_execute,
        lv_guid_ref          
TYPE crmt_object_guid,
        lv_kind_ref          
TYPE crmt_object_kind,
        lt_input_fields      TYPE crmt_input_field_tab,
        ls_input_fields      
TYPE crmt_input_field,
        lt_field_names       
TYPE CRMT_INPUT_FIELD_NAMES_TAB,
        ls_field_names       
TYPE CRMT_INPUT_FIELD_NAMES,
        lv_message(255)      type c.

  
INCLUDE crm_direct.

  
CREATE OBJECT lcl_action_execute.* get parameter from reference object
  
CALL METHOD lcl_action_execute->get_ref_object
    
EXPORTING
      io_appl_object = io_appl_object
      ip_action      = ip_action
      ii_container   = ii_container
    
IMPORTING
      ev_guid_ref    = lv_guid_ref
      ev_kind_ref    = lv_kind_ref.

  rp_status = 
'2'.                  "Set Action ends in error as default
*---------------------------------
* Get new status.
DATA: lv_subrc type sysubrc,
      lv_status 
type char5,
      lv_stat_proc 
type char8,
      lv_problemclass        
TYPE bal_s_msg-probclass.

  
IF ii_container IS INITIAL.
    lv_subrc = 
1.
  
ELSE.* Get user status proc.
    
CALL METHOD ii_container->get_value
      
EXPORTING
        element_name = 
'STAT_PROC'
      
IMPORTING
        
data         = lv_stat_proc
        retcode      = lv_subrc.

    
IF lv_subrc <> 0.
      
MESSAGE ID 'CRM_SUR' TYPE 'E' NUMBER '005'
              
WITH 'STAT_PROC'
              
INTO lv_message.
      lv_problemclass = 
'2'.  "important
      
CALL METHOD cl_log_ppf=>add_message
        
EXPORTING
          ip_problemclass = lv_problemclass
          ip_handle       = ip_application_log.
      rp_status = 
'2'.  "Incorrectly processed
      
EXIT.
    
ENDIF.*Get user status.
    
CALL METHOD ii_container->get_value
      
EXPORTING
        element_name = 
'STATUS'
      
IMPORTING
        
data         = lv_status
        retcode      = lv_subrc.

    
IF lv_subrc <> 0.
      
MESSAGE ID 'CRM_SUR' TYPE 'E' NUMBER '005'
              
WITH 'STATUS'
              
INTO lv_message.
      lv_problemclass = 
'2'.  "important
      
CALL METHOD cl_log_ppf=>add_message
        
EXPORTING
          ip_problemclass = lv_problemclass
          ip_handle       = ip_application_log.
      rp_status = 
'2'.  "Incorrectly processed
      
EXIT.
    
ENDIF.

  
ENDIF.

  
DATA: LT_STATUS TYPE CRMT_STATUS_COMT,
        LS_STATUS 
TYPE CRMT_STATUS_COM.

  LS_STATUS-REF_GUID        = lv_guid_ref.
  LS_STATUS-REF_KIND        = lv_kind_ref.
  LS_STATUS-STATUS          = lv_status.
  LS_STATUS-USER_STAT_PROC  = lv_stat_proc.
  LS_STATUS-ACTIVATE        = 
'X'.

  LS_INPUT_FIELDS-REF_GUID    = lv_guid_ref.
  LS_INPUT_FIELDS-REF_KIND    = lv_kind_ref.
  LS_INPUT_FIELDS-OBJECTNAME  = 
'STATUS'.
  
CONCATENATE lv_status lv_stat_proc into LS_INPUT_FIELDS-LOGICAL_KEY.
  ls_field_names-fieldname = 
'ACTIVATE'.
  
APPEND LS_FIELD_NAMES TO LT_FIELD_NAMES.
  LS_INPUT_FIELDS-FIELD_NAMES = LT_FIELD_NAMES.
  
APPEND LS_INPUT_FIELDS TO LT_INPUT_FIELDS.

  
APPEND ls_status to lt_status.

  
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    
EXPORTING
      IT_STATUS                     = LT_STATUS
    
CHANGING
      CT_INPUT_FIELDS               = LT_INPUT_FIELDS
    
EXCEPTIONS
      ERROR_OCCURRED                = 
1
      DOCUMENT_LOCKED               = 
2
      NO_CHANGE_ALLOWED             = 
3
      NO_AUTHORITY                  = 
4
      
OTHERS                        = 5
           .
  
IF SY-SUBRC <> 0.*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  
ELSE.
    RP_STATUS = 
1.
  
ENDIF.DATA LV_GUID_TO_SAVE TYPE CRMT_OBJECT_GUID.IF lv_kind_ref = 'A'.
  LV_GUID_TO_SAVE = LV_GUID_REF.
ELSEIF lv_kind_ref = 'B'.

  
CALL FUNCTION 'CRM_ORDERADM_I_READ_OW'
    
EXPORTING
     IV_GUID                       = LV_GUID_REF
   
IMPORTING
     EV_HEADER_GUID                = LV_GUID_TO_SAVE
   
EXCEPTIONS
     ITEM_NOT_FOUND                = 
1
     
OTHERS                        = 2
            .
  
IF SY-SUBRC <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  
ENDIF.ENDIF.* Save the document
  
CALL METHOD lcl_action_execute->register_for_save
    
EXPORTING
      iv_source_header_guid = LV_GUID_TO_SAVE
      ip_application_log    = ip_application_log
    
IMPORTING
      rp_status             = rp_status.


endmethod.