Gain insight into how you can build lean offline scenarios with SAP CRM 7.0 and SAP Interactive Forms by Adobe. Learn how to use the new CRM via E-Mail tool set to extract and send business data from an Adobe Form to the SAP CRM system via email and see how the system processes this automatically.
Key Concept
SAP CRM 7.0 offers a new tool set — CRM via E- Mail — that allows you to create and request CRM data by communicating with your CRM system via standard email technology. Two scenarios are supported: the pure email scenario and the Adobe Form scenario that allows you to create business documents in SAP Interactive Forms by Adobe and send them to the SAP CRM system as email attachments as soon as you are online. The CRM via E-Mail application extracts the relevant data and creates the respective CRM business document automatically in the CRM.
Picture a scenario in which a sales rep who travels most of the time wants to create customer data — such as customer meeting reports, leads, or new opportunities — when he is offline or at the customer's site. This is certainly a standard scenario for CRM Mobile Sales users, but what if the sales rep does not have a mobile CRM application? One common and popular way — besides writing the data on a piece of paper — is to use SAP Interactive Forms by Adobe to store the data locally and manually upload it to the system when next online.
By using the CRM via E-Mail functionality, new with SAP CRM 7.0, you can replace this manual step completely. Instead of storing the SAP Interactive Forms reports locally on a laptop and updating them manually back at the office, the sales rep can now send a data extract from SAP Interactive Forms to the SAP CRM system by email. The email is stored on the sales rep's inbox until he is online again. When he goes online, the system sends the email to the SAP CRM back end automatically. After receiving the email, the CRM via E-Mail application extracts the data from the email and creates the necessary business document in the SAP CRM back end. Finally, the CRM via E-Mail application sends a reply message to confirm the creation or update.
Say that you need to create a customer visit report automatically. You take three steps to implement the CRM via E-mail functionality. (Note that a dedicated SAP Interactive Forms license is required.) These three steps are:
Step 1. Create the necessary Web service
Step 2. Create the CRM via E-Mail service and download the Web service schema
Step 3. Create the SAP Interactive Forms template based on the schema
First you need to create the Web service that is needed to bind the SAP Interactive Forms to the back- end functionality. Then you need to create the respective CRM via E-Mail service and SAP Interactive Forms based on the Web service.
Step 1. Create the necessary Web service. There are two ways to provide a Web service for CRM via E-Mail. I can create a standard function module, Remote Function Call (RFC), enable it, and create a Web service interface with the standard SAP Web Service Wizard. Alternatively, I can use the SAP CRM Web Service Tool to build my individual Web service. In my example, I chose the SAP CRM Web Service Too l to model a Web service and create a customer report (business activity).
To create the Web service, start the Web Service Tool from SAP CRM and click on the New button to start the creation wizard. In step one of the wizard, you give a name to your service object, choose the component and root object (business transaction), and select the flag for the read operation. I created a service with the name Z_ADOBE_ACTIVITY for this example.
Then you click on Next to go to the second step of the wizard and choose the necessary attributes for your service. In my example, I selected several attributes, such as the activity description, location, priority, and completion rate (Figure 1).

Figure 1
Select the necessary attributes for your Web service
Before you finish creating your Web service, you should provide default values to the selected attributes. This reduces your work later when you need to assign the SAP Interactive Forms fields to the Web service structure. You can then ignore the mandatory fields because the Web Service Tool assigns the respective defaults to them.
As shown in Figure 2, you can assign the standard Partner Function as 00000009 to indicate that the business partner is a customer contact. Then assign Text ID A002 to indicate that the text is a note. Finally, set the Language Key to En (English) for the text entry.

Figure 2
Set default values for the Web service attributes
Now, finalize your service and test it with the standard SAP NetWeaver testing tool. After you test your service successfully, store its WSDL file locally on your computer because you need it later to create the necessary schema file.
Step 2. Create the CRM via E-Mail service and download the Web service schema. Start the CRM via E-Mail tool with the transaction E2C in the SAPGUI. On the first screen, you get an overview of the available CRM via E-Mail services. You can also start a report to download the necessary schemas for the creation of the SAP Interactive Forms that you need later. To create a new CRM via E-Mail service, click on the new icon in the menu bar. This adds a new line to the list of services. Assign a service ID to the services, choose the service type, and provide the respective function module and Web service.
In my example, I named the CRM via E-Mail service ADOBE_ACTIVITY and assigned my new Web service Z_ADOBE_ACTIVITY and the respective function module /crmost/z_Adobe_Activity_Crt (Figure 3). The function module was created during the Web service creation process. You can find the name in step 4 of the Web Service Tool Wizard under Expert information. Finally, I chose service type 04 (Adobe Service) and provided the short description Create_Activity.

Figure 3
CRM via E-Mail Customizing overview
Now, save your CRM via E-Mail service and click on the Input Parameter Mapping tab in the menu on the left side of the screen. You do not need to do anything here for the Adobe scenario, but you get a good overview of all available attributes that are available in the chosen interface that you can use to build the form.
Next, go to the next menu step Output Parameter Mapping in which you define the attributes that the CRM system sends back to the user after executing the services in an email (Figure 4). For my example, I chose the OBJECT_ID and selected the Add E-Mail Subject option to add the ID of the newly created business object to the subject line of the reply email.

Figure 4
Output parameters
Finally, provide the authorization settings for the CRM via E-Mail service. You can do this by user or role. In my example, I assigned my own user ID Thilo1 by adding it to the user list in the User Authorization menu.
Note
To assign users to CRM via E-Mail services, you must ensure that the user ID is assigned to either an employee or a channel partner role and that the user ID and email address are maintained properly. For users with the business partner role employee, you must maintain the user ID under the user name. For channel partners, you maintain the user ID under the internet user name.
Step 3. Create the SAP Interactive Forms Template based on the schema. After you have finalized your services, you need to download the Web service schema to your hard disk. The Web service schema specifies the Web service structure and the data types for each attribute. It binds the attributes used in the SAP Interactive Forms with the Web service attributes.
To download the schema of the service, execute the respective report from the CRM via E-Mail overview page shown in Figure 3. Two reports are available — the one for Web services that were created with the SAP CRM Web Service Tool and the one for Web services that were created with the SAP NetWeaver Web Service Creation Wizard. In my example, I chose the one for schemas of services created with the CRM Web Service Tool.
To execute the report, first select your CRM via E-Mail service object and then click on the respective report icon. In the report, provide the URL of the WSDL file of your Web service and the respective target file. The easiest way is to just copy the WSDL URL and change the file type from WSDL to XSD (Figure 5).

Figure 5
Schema download report
After you have downloaded the schema to your hard disk, start Adobe LiveCycle Designer. In LiveCycle Designer, you create a new form that later becomes your template with one data connection that connects the form to the schema.
To create a new data connection, go to File>New Data Connection. Choose XML Schema, give a name to the connection, and click on Next. Then provide the path of the schema you just downloaded from the CRM system and click on Finish.
The new data connection appears in the left window (Data View) of LiveCycle Designer. Now you can start to create your form by dragging and dropping the necessary attributes from the data connection structure to the Adobe Form body page (Figure 6). To give the right look-and-feel to your form you can use the standard LiveCycle Designer layout features, such as different background colors, additional text, pictures, font style, font size and color, and separators.

Figure 6
Create a new template in LiveCycle Designer
Furthermore, LiveCycle Designer allows you to implement drop-down lists or check boxes that you can combine with your service. Figure 7 shows a drop-down configuration menu with values provided by the CRM back-end/Web service. In my example, the technical value from the CRM back-end system for a Very High priority is 1 and for High it is 3.

Figure 7
Create a drop-down menu that contains priority descriptions for the SAP CRM back-end technical values
To include features such as a drop-down menu in the form, first define the respective feature and then bind it to your Web service. To do this, drag and drop the attribute from the service structure (Data View) on the feature in the body page. LiveCycle Designer automatically binds the feature and the Web service attributes. You can view the binding in the Import/Export Bindings field shown in Figure 7.
In some cases the SAP CRM back-end system might need additional input data to create the respective business documents — for example, a transaction type. In some cases you can avoid this by assigning the values in the Web Service Tool as a default value.
However, sometimes you need the data from the Adobe Form. An easy workaround is to drag and drop the attribute field of the create data connection to the form and then to assign the requested value as a default to it and set it to Invisible in the form. To provide a default value you have to go to the Value tab under the Object settings. To hide a field you need to go to the Field tab and change the Presence setting to Invisible.
Now, after your form is designed, you can perform the final steps that are needed to send it later to the CRM back end. First, you need to add a button to trigger the send process. To do so, in the LiveCycle Designer menu go to Insert>My favorites>Email Submit Button. Place the button on your form and add the CRM via E-Mail email address of your SAP CRM system as default email address. Add the CRM via E-Mail service ID as subject in the configuration menu (Figure 8).

Figure 8
Submit button settings
In my example, I assigned the CRM via E-Mail service ID ADOBE_ACTIVITY as the email subject and save your work as a PDF form. Your form is ready to be used now — the only prerequisite is that you have an Adobe Professional license and that the CRM via E-Mail has been set up properly.
Testing SAP Interactive Forms
After you have created the Adobe Form you can test it by adding data to it and clicking on the Submit by Email button. SAP Interactive Forms then extracts an XML file that contains the relevant data and attaches it to an email (Figure 9).

Figure 9
Email that SAP Interactive Forms generated automatically
The XML contains the service structure and the data of the Adobe Form (Figure 10).The last step for the user is to send the email to the CRM system. The email address and subject line are defaulted automatically. When the email reaches the CRM system, the CRM via E-Mail application checks the user authorization, extracts the data, and triggers the respective steps to create the CRM system. Finally, it sends back an email with the ID of the created object.

Figure 10
XML extract containing the relevant data from the SAP Interactive Forms
Email Security
The CRM via E-Mail tool is based on SAPconnect (SAP NetWeaver). You need a secure email proxy implemented to run the scenario securely, according to legal regulations. SAP strongly recommends that you implement such a proxy to guarantee maximal security by providing digital signature and encryption features. This secure proxy is not part of the standard SAP CRM shipment since it has to comply with applicable regulations.
Thilo Berndt
Thilo Berndt is a solution manager for SAP CRM Solution Management in Bangalore. He is a graduate of the business school at the University of Mannheim, Germany. Thilo has worked at SAP since 2002. Currently, he is responsible for the SAP CRM enterprise service-oriented architecture strategy and the Web service tool.
You may contact the author at thilo.berndt@sap.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.