I'm posting late but I hope not to late to advertise the Cycle 3 of Customer Connection for SAP CRM. After the successful completion of already two rounds you have still until May 31st 2012 to submit your SAP CRM improvement ideas in the SAP Idea Place. If you like to know what was already improved check out the Website SAP Improvement Finder where you can search for all the improvements already shipped.

How to get access

Unfortunately SAP has restricted the access to Cycle 3 of Customer Connection for SAP CRM to members of the SAP User Groups around the world. So if you like to get access to this Idea Place area please reach out to your local Usergroup. For DSAG (German Speaking SAP Users) you find a guide at https://www.dsag.de/go/influencing.

How to vote

It is important that you Subscribe to an Idea. This is done by clicking on the "Subscribe" button on the right hand side of the Idea detailed screen:

idea-place-subscribe.png

Only when 5 or more Customers have subscribed to an idea it will be taken into account for the decision process by SAP. This decision process will start after the collect phase that is currently running. With the Subscription you state that you're interested to help to define the details of the Idea, would try the solution in your sandbox system and when it fits your needs to use it in production. This involvement with SAP is a great opportunity to get exactly what you need as a result.

 

So now do that:

  • get access
  • go through the existing ideas and subscribe to them
  • create your own ideas and advertise them in your community

We're happy to celebrate 200 members in the abap2xlsx project:

image

This blog provides the background story why I've created this code sample. If you just want the code then directly open the Wiki Page: WebClient UI Export to Spreadsheet with abap2xlsx.

Limitations of the standard Export to Spreadsheet functionality

According to the WebClient UI Framework documentation on Setting Up the System a XML export is only possible with Microsoft Internet Explorer with  ActiveX, and one a version of Microsoft Excel versions under Windows.  But I think today as Firefox (Version 2.0 and 3.0 according to the Product Availability Matrix ) is also a supported Browser for SAP CRM and other office products support the Open Office XML that limitation should be removed. Thanks to my new SAP Mentor colleague Ivan Femia who started the abap2xlsx last year this is now also possible.

Internationalization problems with the XML export

It started two month ago when I got a call from one of our SAP CRM users in Switzerland. He told me that he has a problem using the Export to Spreadsheet function. The problem occurred in value columns exported from the Opportunity search result list. I've connected to his machine and saw the problem.The columns containing the Opportunity value where not recognized as a number. Instead they where displayed as text. So i.e. no calculation of the total was possible.

That was caused by that fact that the machines "Regional and Language Options" where set to "German (Switzerland)". The main difference to "German (Germany)" is that Numbers are displayed as 123'456'789.00 instead of 123.456.789,00. As SAP doesn't support this decimal notation (Defaults in SU01 or SU3) the export as 123.456.789,00 was used.

Way to the solution

As I already thought about replacing the standard Export to Spreadsheet functionality with abap2xlsx. The call from Switzerland was the last kick I've needed to start it. As the Export to Spreadsheet is a generic functionality of the WebClient UI Framework I first searched for a way to provide the replacement without any modification. The trick is to create an external alias in transaction SICF which uses path of the standard functionality but replaces it with the custom one.

From that point it was straight forward. Inspired by the functionality of the standard handler class CL_CHTMLB_CONFIG_TAB_EXCEL_EXP I've created the class ZCL_CHTMLB_TAB_EXCEL_EXPORT using abap2xlsx to create the .XLSX file. It was a bit tricky to provide the fields to abap2xlsx in the right format. But with the code completion in NetWeaver 7.02 I found the needed method.

Sow now you can check out the solution at WebClient UI Export to Spreadsheet with abap2xlsx.

With the release of SAP Note 1602520 two new features that where developed by SAP in the Continuous Improvement (CI) Process are now available for CRM 2007, 7.0 and 7.0 EhP1 users. The new features are called "Central Edit" and "One Hit - Direct Display".

This features where requested in Wave 1 of the Continuous Improvement (CI) Process. The process was started as a pilot in the CRM Area. SAP reached out also to DSAG (German speaking SAP Users). In November 2011 the development requests where posted in the DSAG CRM forum. At least 5 companies had to provide their commitment that they would like to use the new functionality. After taking this hurdle SAP developed the functionality and presented it in January 2011. As many applications had to be adjusted to provide the new features it took until last week to get the note released.

Let me now introduce this new features to you:

Central Edit

You can now enable a central button in the Work Area Toolbar which enables you to switch into change mode for all Assignment Blocks. So when you have to add products and partners to an Opportunity you don't have to click the Edit List button in the products and again in the Partners Assignment Block. A single click on the central Edit button and all Assignment Blocks are ready for data entry.

image

One Hit - Direct Display

You're using the advanced or central search in the CRM applications. When a search query finds a   unique hit, then this object is directly displayed. You don't have to click on the object in the search result list. So if you search for a specific Opportunity ID or Customer ID you enter the number, press enter and the details are directly displayed. You don't have to click the details link in the search result list.

Implementation

Check the linked Notes in the Central SAP Note 1602520. You can implement all the notes using SNOTE starting from SAP CRM 2007 (6.0) SP 06, 7.0 and 7.0 EhP1.

End of November 2010 a load of improvement requests was posted in the DSAG Sales and Marketing Working Group Forum (Only for DSAG Members). Based on that Input SAP started to work on 14 requests. For two of them "One hit direct display" and "Central edit switch for all assignment blocks" the companies supporting the request got contacted by Silvia Backes from SAP to specify the solution in detail. As the "One hit direct display" functionality has to be included into every single application it will still take some time to be available. But one of the downport suggestions is already available as a Note: 1554307 - GoTo Menu on overview pages.

You see - SAP is listening. Now it's time to raise your voice in an next round of the Customer Connection program. The platform for this is now SAP Idea Place. SAP worked hard to get it to acceptable performance. Now you can browse fluently through the suggestions. The suggestions are posted in a private area called Customer Connection. You have to be a member of one of this user groups:

It seems that ASUG is not part of the game yet. If you're an ASUG member please contact them to request your demand to influence SAP's current solutions. If your company isn't a member of any SAP User Group then you can use SAP Idea Place too. Vote and comment on the Idea: Open Customer Conneciton for all SAP Customers.

How to get access

If you not already have the SAP Passport to use the Single Sign On on the SAP Service Marketplace then you should finally get it at http://service.sap.com/tcs. After you've done so please check if you're asked for the SAP Passport when accessing SAP Idea Place. You should be greeted with the name that you've maintained in your SAP Service Marketplace user settings. To get access to the Customer Connection area you then must contact your SAP User Group and provide your UserID (C-, S- or P-User), First Name, Last Name, Company and E-Mail address via this contacts:

How to vote

When you managed to get access to Customer Connection then start voting and commenting. Improvement suggestions that will be taken into consideration to be realized need at least 5 companies that give this commitment:

  • Help to specify the solution in detail
  • Implement the solution as soon as provided for the used release
  • Use the solution in production when it fits the companies needs

I think the best way to show this commitment is not only to hit the "Vote this idea up" button. You should also leave a comment providing the name of the company. Also you can use this comment to provide perhaps further details how the solution could look like.

Why to vote

Think about all the great solutions you've realized in custom reports or applications. Arn't there always a big issue when doing upgrades? Reduce the TCO (Total Cost of Ownership) and improve the productivity of your user by enhancing the user experience.

As we now have a CRM 7.0 EhP 1 development system my first try was to  test if there are measurable performance improvements. And the good new  is: They are really big improvements.

Test tools

To get reproducible and exact test results I've utilized my {code:html}SAP Code Exchange{code} project SeleniumABAP  (https://cw.sdn.sap.com/cw/groups/seleniumabap). First I've recorded the test steps using Selenium IDE  (http://seleniumhq.org/projects/ide/).  The saved test is then converted into a ABAP Unit test. To measure the  traffic in bytes and the execution time in seconds I've extended this  test with calls of the SeleniumABAP Client method capturenetworktraffic  and the ABAP call GET RUN TIME FIELD.

The test was executed on a  computer with a Core i5 650 CPU, 3.2 GHz,  2 GB RAM, Windows XP, 32 bit  running Firefox 3.6.13 and using  Selenium Server Standalone version 2.0b1  (http://code.google.com/p/selenium/downloads/list).  The computer has a 1 GBit/s LAN connection to the CRM Servers.The 7.0 and 7.0 EhP 1 system contains around 160,000 Business Partners in table BUT000. The 2007 (6.0) system is the IDES System containing 11,500 Business Partners.

Test results

Traffic

The most impressive improvement is the reduction of the initial size to start the CRM WebUI Framework. In CRM 7.0 that was 1,486,533 bytes. Now with the EhP 1 it was reduced to 563,992. Thats a reduction of 62 %. Well done CRM WebUI team! Unfortunately with a filled browser cache EhP 1 increased it's traffic footprint by 22 % against 7.0 and by 48 % compared to 2007 (6.0). Please note that the scale for the empty browser cache measurement starts at 500,000 Bytes to show also the little impact the which the other pages have. Also the graph for the filled browser cache does not start at zero.

CRM WebUI Traffic

Execution time 

The  improvements on the execution time are not so big as for the traffic but also noticeable. Against CRM 7.0 32 % with an empty browser cache and  27 % with a filled cache. Please note that the graph starts at 2 seconds to show more details.  CRM WebUI Execution Time

Last week I've Taking part in the Enhancement Pack 1 for SAP CRM 7.0 Ramp-Up - a journey begins. This week you read about the first glitches in our project.

Ramp Up experience

My first Ramp Up experience so far was good. The download was delivered at the promised date and the access to the Ramp-Up Knowledge transfer worked without any hassles. But during the last two weeks we faced some glitches during the installation on our development system.

Project Team Changes

The week started with at hit. The basis admin that should do the upgrade of our development system is going to move on to another company. For his last month at Siteco he needs now to hand over his work and could not work on the upgrade. But lucky enough our basis team suggested a basis consultant from Siemens IT Solutions and Services GmbH to me. He did already worked for us in the ERP 6.0 EhP 4 and in the just finished BW 7.0 upgrade. So I gave him a call and he was able to step in.

SMSY adjustments

On Friday we ran into a problem with the Solution Manager Maintenance Optimizer (MOPZ). It reported the error "Software Component Vector is empty for WEB". I've found that the Technical System WebDispatcher which we use as a filtering reverse proxy forCreate, run and analyze an E-Mail Campaign with a Survey (Part 1) was not correctly maintained. I had to enter the Software Component and then we where able to continue with the MOPZ.

But not far. In step 2.4 - Select OS/DB-Dependent Files of MOPZ we where presented with the error messages:

The Installation/Upgrade Package for Add-on FI-CA rel. 600 is not available
Message no.TN260

and

ABAP queue check failed
Message no.PPMS_STACK_CALC024

We where not able to solve this issue and raised an SAP Support Ticket (OSS Message). As I've raised it with high priority I got a reply already on Saturday from a support employee also contributing to the SAP Solution Manager. He pointed me into the right direction and I found why also our ERP Systems where included in the MOPZ calculation. The same instance of the WebDispatcher causing the first problem was assigned to our CRM and ERP Production system. I can't blame anyone for that as I did the maintenance some month ago.

With that fixed I was able to download all the needed packages from the SAP Service Marketplace.

Ramp-Up Coach Introduction

On Monday we had our first meeting with our Ramp-Up Coach Christian Rau. He is the Co-Author of the SAP Press book Web Programming in ABAP with the SAP Web Application Server. First he explained his role as the interface between us and the Ramp-Up back-office and SAP Development. We agreed to send prepared support messages to him to be checked and perhaps improved to allow a quick solution.

Special tagging of support messages

Support messages have to be flagged with "Ramp-Up Project" and they get a special Prefix. But to be able to see the "Ramp-Up Project" flag, the maintained release of the system has to be maintained in the Service Marketplace (SMP) with the target release. In the days of SAP Solution Manager automatically updating the SMP System data I think that is a to hard restriction. When you start with the upgrade of the first system SolMan still reports the old version. I think binding it to the installation number should be enough.

Walking through our old CRM 5.0 PC-UI

After the general guidelines we got into our CRM 5.0 system and walked through our main processes of Opportunity- and Account Management. To get an impression of our needs check out the CRM WebClient UI wish list and my My SAP CRM improvement ideas on SAP Idea Place. Also not to forget our Marketing Management where we hopefully No support for letters in SAP CRM Campaign Management - SAP bring it back!.

Another glitch during the technical upgrade

Monday night I've got a mail from our basis consultant doing the technical upgrade. He told me that he had to raise a support message. The upgrade tool stopped in the PREPARE phase 'configuration'. The message was "WARNING: Your source system is secured by the SAPCryptolib". As suggested by the tool, we've provided the SAPcrypotlib file in the download directory. But it was not to be recognized.

It was already late at night when I've tweeted our problem. The next morning http://twitter.com/CBasisChristian Braukmüller already found a solution in a /thread/1867130 [original link is broken]. With the help of the SAP Notes 1302772 - Central Note - SAP Enhancement Package Installer 7.00 and 1375378 - Select the right version of an SAP security toolkit we where then able to continue with the upgrade. I've set the support message to request a close.

Last glitch - release restrictions for server side groupware integration

On Tuesday Christian Rau made me aware of Note 1455223 - Release Restriction Note CRM 7.0 EHP1. The bad news of this note is that the Groupware Connector for server based Groupware  Integration with Microsoft Exchange is not available with CRM 7.0 EHP1. It is planned to resolve this limitation until end of Q1/2011. As we use the server side Groupware integration to synchronize Accounts to the contact folders of our sales reps that could be a show stopper. Let's hope that SAP can solve it faster.

Update - other Blogs from this series:

Ramp Up
Picture by A. Blight

On December, 20th 2010 SAP started the shipment of Business Suite 7 Innovations 2010 to ramp-up customers. Siteco takes part in the ramp-up and use it to upgrade it's CRM 5.0 to 7.0 EhP 1. I will try to keep you updated about the progress of our project on a regular basis.

Background

Siteco did the first CRM implementation with SAP CRM 4.0 in September 2004 using the PC-UI Technology. We went live in April 2005. In 2007 we did an upgrade to CRM 5.0 still using the PC-UI. The used functionalities are Account-, Opportunity-, Marketing- and Activity-Management. The CRM System is connected to our SAP ERP 6.0 EhP 4 System and the Accounts- and Contact Persons are synchronized using the CRM Middleware. For the Marketing Management we currently use the SAP GUI for Windows.

Preparation

End of 2009 we've decided to upgrade to CRM 7.0 but waiting for the Enhancement Pack 1. At this time the Ramp-Up for the Business Suite 7 Innovations 2010 was planned to start in July 2010 and should perhaps ended December 2010. That was right to fit into our planned Go-Live with CRM 7.0 EhP 1 in April 2011. That Go-Live date is needed because of the ending standard support for CRM 5.0 and to be prepared for the upcoming SAP Roll-Outs to our subsidiaries worldwide.

To be well prepared me and my colleague attended the SAP CRM Deep Dive Training offered by SAP Consulting in Walldorf. We attended the CRM7.0 Web Client UI Development training. We have to move our PC-UI customizing and development into the new CRM WebUI. In addition to that we setup a CRM 7.0 sandbox system. It was a copy of our productive system running CRM 5.0 and then upgraded to CRM 7.0. There we got our hands dirty and worked on the functional and technical requirements.

During my work on the CRM 6.0 IDES and CRM 7.0 sandbox I've filed 60 OSS Messages where 22 resulted into new SAP Notes or will be implemented in EhP1.

Ramp Up start

Right before the Ramp-Up start we received an E-Mail with a link to the so called "Customer Approval Letter" which had to be signed electronically using the SAP Service Marketplace account of a person with the necessary signature authorisation. The letter included also information how to get access to the Ramp-Up Knowledge Transfer. It is provided for 10 persons in our company.

On December 20th I've received an E-Mail providing the Links to the SAP Service Marketplace Software Distribution Center where we can download the installation and upgrade package for SAP CRM 7.0 EhP 1. I've forwarded them to my basis colleague who took care on getting all the required files.

I've started to work through the extensive Ramp-Up Knowledge transfer documentation and also try to read through the SAP CRM 7.0 EhP 1 Release notes. A 390 pages document.

Check back soon to read about our progress to upgrade the development system.

Yesterday afternoon The specified item was not found. send a Tweet that Josh Weinberger is live Twittering from the Press Conference announcing "SAP and RIM Usher In a New Era for Enterprise Mobility". I joined his Twitter Feed and also watched the Live Video Broadcast. From the Video Replay I've taken the following screenshots illustrating the native integration of SAP CRM in a BlackBerry Device.

Update: https://weblogs.sdn.sap.com/pub/u/3996 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] posted a SAPPHIRE Black Berry Demo. He stated that it is based on the NetWeaver Mobile 7.1 Platform which he has describ in the Blog: Using Native Clients with NetWeaver Mobile.

Screenshots of the live demo 

Mike de la Cruz told the story of a sales representative who got awake by the Alarm of his BlackBerry Device. After he switched off the alarm he opens up the calendar and sees an Appointment at 12.30:

image

The appointment details are still BlackBerry standard: 

image

But in the Context Menu it is possible to jump to SAP CRM by choosing "View Account": 

image

Now we see the Account Details of the Customer "Vision Computers Networks". Note also the "MAP IT" button which allows you to display a Map of the Accounts location:

image

By scrolling down the "Planed Activities" and "Interaction History" can be viewed: 

image

It's also possible to open the "Service Interaction History":

image

and the Opportunities: 

image

By choosing one of the opportunities details can be opened: 

image

The Account Details View also contains the contact list:

image

From here it is possible to initiate a call via the context menu:

image

After finishing the call: 

image

The call can be logged in CRM directly via the context menu: 

image

It's also possible to open BI analytic reports: 

image

And also the new leads created in the marketing department. They are also indicated by a red star in the upper right corner beside the new mail icon:

image

Conclusion

 

I think that this new product which is a co-innovation development of SAP and RIM is a great step forward regarding acceptance of CRM in sales force. As announced at the press conference SAP and RIM have plans to extend this kind of solution also in the ERP and SCM area. If you attend the upcoming SAPPHIRE 08 in Orlando or Berlinyou should check out the booth where this Product is presented.

Kick off

Before the meeting was kicked off byJens Beierfrom NEO, I had the chance to familiarise with the other attendees. I've talked to employees of K+S Aktiengesellschaft, Sharp Electronics Europe GmbH and Hettich Furntech GmbH & Co. KGaA. We recognized that we all using the People Centric UI.

Migration from Siebel CRM to SAP CRM

Anett Hondl-Meyer who works for Sharp Electronics Europe GmbH gave us a presentation about their migration from Siebel CRM to SAP CRM. Since 2001 Sharp has used Siebel Sales Version 6.0.1 was used. SAP R/3 was implemented in 1997. SAP CRM was chosen in 2005. Three factors where crucial: New requirements from the sales and marketing department including a portal for the business partners; Upgrade costs for the Siebel solution are as high as the SAP CRM implementation and Corporate SAP strategy.

A interesting topic was the training concept. Everyone had to learn everything about the solution. The management was trained first. Everyone was trained by a professional trainer due to a two day training in groups with up to 14 people.

Sharp shares the same experience as I that the PC-UI performance relates directly to the Client PC's performance.

Campaign Automation with SAP CRM 5.0

You can already download my Presentation Kampagnenautomatisierung im SAP CRM 5.0. It is in German as the meeting was held in Germany.

SAP CRM 2007 Upgrade

The last formal presentation was given by Arvin Arora from NEO. He gave an introduction in the new SAP CRM 2007 product which is in general availability since March 4th 2008 for Germany and the US. It is a web-based UI Architecture with the goal to consolidate the different SAP CRM UI's like IC Winclient, IC Webclient, PC-UI and SAP-GUI for the end-user. It includes also a internal reporting i. e. Pipeline Performance Management. The standard maintenance is planed due to March 31st 2013 and the extended maintenance until March 31st 2016.

Conclusion

Jens Beierclosed the meeting by asking the audience what topics should be covered in the next meeting. The biggest interest occurred for the SAP CRM to Groupware integration.

I think the exchange of experiences and knowledge was very useful. I'm eagerly looking forward for the next meeting.

Downloads

All Presentations will be made available for download at the work group homepage.

Gregor Wolf

Use Data from Wikipedia

Posted by Gregor Wolf Jun 29, 2006
Today I got the request from our sales department to get a list of all Mayors in Germany for a Marketing Campaign. Unfortunately there is no attribute maintained to retrieve this information using the CRM Segment Builder. So I thought where to get this information from and found the Wikipedia (http://www.wikipedia.org/) “[Export pages | http://en.wikipedia.org/wiki/Special:Export]” feature. From my Blog: “[Geocode Business Partner with Google Maps | Geocode Business Partner with Google Maps]” I had already everything in place to use Wikipedia. I had to do just these steps: h3. Preparation h4. Create Database Table for Towns and their Mayors I’ve put all development objects together in the Package ZWIKIPEDIALOAD. Here I’ve created also the DB Table ZCITYMAYORS which will contain City and Mayor. The following picture shows you the table definition: h4. Transform Mediawiki to ABAP Like I did in: “[Geocode Business Partner with Google Maps | Geocode Business Partner with Google Maps]” the XML returned is transferred to an ABAP variable using Simple Transformations (Fifth ABAP Online Meet-up: Simple Transformations). To test the Transformation I first downloaded the result of this request to my local drive: h4. Implement ABAP Program to fill Table ZCITYMAYORS with Cities My list of Cities is available in an Excel file. So I had to find a way to import it to my Database table. In the ABAP Forum I’ve found a link to Upload Excel document into internal table (http://www.sapdevelopment.co.uk/file/file_upexcel.htm). With a few modifications this was a perfect solution.

h3. Implement ABAP Program to fill Table ZCITYMAYORS with Mayors Finally we can now fill the Table ZCITYMAYORS also with Mayors. Together with the Transformation this little piece of ABAP does all the work: REPORT zget_mayors_for_cities. DATA: it_citymayors TYPE TABLE OF zcitymayors, wa_citymayors LIKE LINE OF it_citymayors, mayor TYPE full_name, trash TYPE string.   PARAMETERS: s_city TYPE s_city LOWER CASE.   SELECT * FROM zcitymayors INTO TABLE it_citymayors WHERE city LIKE s_city.   * HTTP Client according to * BSP: Create a weather magnet using xml feed from weather.com   DATA: client TYPE REF TO if_http_client, url TYPE string, xml TYPE xstring, c_xml TYPE string, city TYPE string.   * Converter DATA: l_convin TYPE REF TO cl_abap_conv_in_ce.   LOOP AT it_citymayors INTO wa_citymayors. * Use the Progress Indicator to show the user which City is processed CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING percentage = sy-index text = wa_citymayors-city.   city = wa_citymayors-city. * Spaces have to be replaced by _ in the URL REPLACE FIRST OCCURRENCE OF space IN city WITH '_'.   CONCATENATE 'http://de.wikipedia.org/wiki/Spezial:Export/' city INTO url.   ****Create the HTTP client
TRY.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = url
IMPORTING
client = client
EXCEPTIONS
OTHERS = 1.
 
client->send( ).
client->receive( ).
 
xml = client->response->get_data( ).
client->close( ).
CATCH cx_root.
WRITE: / 'HTTP Connection error: ', city.
ENDTRY.
* Wikipedia does not provide a encoding with the returned XML * so we have to do the conversion manually TRY. CALL METHOD cl_abap_conv_in_ce=>create EXPORTING encoding = 'UTF-8' input = xml endian = 'L' RECEIVING conv = l_convin.   CALL METHOD l_convin->read IMPORTING data = c_xml. CATCH cx_root. WRITE: / 'Problem during Character conversion: ', city. ENDTRY. ****Transform XML to ABAP Values
TRY.
CALL TRANSFORMATION zwikipedia_mayor_to_abap
SOURCE XML c_xml
RESULT mayor = mayor.
CATCH cx_root.
WRITE: / 'Data loss during transformation: ', city.
ENDTRY.
* Some Mayors already have pecial Pages REPLACE FIRST OCCURRENCE OF '[[' IN mayor WITH ''. REPLACE FIRST OCCURRENCE OF ']]' IN mayor WITH ''. * Some Mayors are members of a Party SPLIT mayor AT '(' INTO mayor trash. wa_citymayors-mayor = mayor.   WRITE: / wa_citymayors-city. * Update Database IF NOT wa_citymayors-mayor IS INITIAL. UPDATE zcitymayors FROM wa_citymayors. WRITE: wa_citymayors-mayor. ENDIF. ENDLOOP. The result running this Program with the Parameter 'Tr%' the result in table zcitymayors is:

References

With this great SDN content it was easy to develop this functionality:

Business Case

With our new copiers our users can also use a scan to E-Mail functionality. Because there often get long specification faxes for projects we had the need to allow an easy way to attach these documents to CRM Opportunities. These are the steps:

  • Scan specification fax to E-Mail
  • Forward E-Mail to a special E-Mail Account on the CRM Server
  • Change the Subject to the Opportunity Number
  • CRM Server attaches the Documents to the Opportunity

Implementation

I suggest that you fist follow the Weblog from Thomas Jung on Receiving E-Mail and processing it with ABAP - Version 610 and Higher. You can really copy & paste this solution except from the line:

* set sender
lo_sender = cl_sapuser_bcs=>create( 'KEGSAPSUP' ).

in the Method SEND_REPLY. Change KEGSAPSUP to a Username existing in your client.

For the processing of the Attachments I’ve only adopted the PROCESS_INBOUND method. Here is the source:

METHOD if_inbound_exit_bcs~process_inbound .

DATA: sender TYPE REF TO if_sender_bcs.
DATA: sender_addr TYPE string.
DATA: lo_reply TYPE REF TO cl_send_request_bcs .
DATA: li_document TYPE REF TO if_document_bcs,
l_subject TYPE so_obj_des,
ls_text TYPE soli,
lt_text TYPE soli_tab.

TRY.
**** init
CLEAR e_retcode.
CLEAR es_t100msg.

**** Get a pointer to the reply email object
lo_reply = io_sreq->reply( ).

**** Check to make sure this is from an approved Sender
sender = io_sreq->get_sender( ).
sender_addr = sender->address_string( ).
TRANSLATE sender_addr TO UPPER CASE.

**** Only reply if this message came from within out mail system
IF sender_addr CS '@SITECO.DE' OR
sender_addr CS '@SITECO.NET'.

**** Process Attachment
DATA: l_parts TYPE int4,
anhang_nr TYPE string,
attribute TYPE bcss_dbpa,
lt_attachments TYPE TABLE OF int4,
ls_attachments LIKE LINE OF lt_attachments,
ls_content TYPE bcss_dbpc,
lv_request_guid_c TYPE crmt_object_guid32,
ls_file_info TYPE crmt_icss_file_info,
lt_file_content_binary TYPE TABLE OF sdokcntbin,
l_sender_subject TYPE char50,
lt_cont_hex TYPE solix_tab,
ls_cont_hex LIKE LINE OF lt_cont_hex,
lv_objkey TYPE swo_typeid,
size TYPE string.

**** Data Types for Binary Conversion
DATA: v_struct TYPE sdokcntbin,
v_cur_pos TYPE i,
v_line TYPE sdok_sdatx,
v_temp TYPE xstring,
v_length TYPE i.
**** get document
li_document = io_sreq->get_document( ).

**** get subject
l_sender_subject = li_document->get_subject( ).
**** Get Opportunity GUID from Subject
DATA: iv_opportunity_id TYPE crmt_object_id,
lt_opportunity TYPE TABLE OF crmt_icm_opportunity_descrpt,
ls_opportunity LIKE LINE OF lt_opportunity,
opp_guid TYPE string.

iv_opportunity_id = l_sender_subject.

CALL FUNCTION 'CRM_ICM_OPPORTUNITY_SEARCH'
EXPORTING
iv_opportunity_id = iv_opportunity_id
* IV_OPPORTUNITY_DESCRIPTION =
* IV_OPPORTUNITY_GUID =
TABLES
et_opportunity = lt_opportunity
EXCEPTIONS
no_authorization = 1
error_occured = 2
OTHERS = 3.
**** Only if we get a valid GUID we process the Attachments
READ TABLE lt_opportunity INDEX 1 INTO ls_opportunity.
IF sy-subrc <> 0
OR ls_opportunity-guid = '00000000000000000000000000000000'.
CONCATENATE
'No Opportunity with number:'
iv_opportunity_id 'was found'
INTO ls_text SEPARATED BY space.
APPEND ls_text TO lt_text.
l_subject = ls_text.
ELSE.
**** Assign Opportunity GUID for display and FM input
opp_guid = ls_opportunity-guid.
lv_request_guid_c = ls_opportunity-guid.
**** Insert Opportunity GUID and Description into the reply text
CONCATENATE 'Opportunity GUID:' opp_guid
'Description:' ls_opportunity-description
INTO ls_text
SEPARATED BY space.
APPEND ls_text TO lt_text.

**** get no. of body parts
l_parts = li_document->get_body_part_count( ).

**** Read which body part contains the file we are looking for (PDF or TIF)
DO l_parts TIMES.
attribute = li_document->get_body_part_attributes( sy-index ).
TRANSLATE attribute-subject TO UPPER CASE.
IF attribute-subject CS '.PDF'
OR attribute-subject CS '.TIF'.
MOVE sy-index TO ls_attachments.
APPEND ls_attachments TO lt_attachments.
ENDIF.
ENDDO.

LOOP AT lt_attachments INTO ls_attachments.
**** Read the actual content
ls_content = li_document->get_body_part_content( ls_attachments ).
attribute = li_document->get_body_part_attributes( ls_attachments ).
anhang_nr = ls_attachments.

ls_file_info-filename = attribute-filename.
v_cur_pos = 0.
**** Fill v_temp
CLEAR v_temp.
LOOP AT ls_content-cont_hex INTO ls_cont_hex.
CONCATENATE v_temp ls_cont_hex-line INTO v_temp IN BYTE MODE.
ENDLOOP.
**** Detect Lenth of File
ls_file_info-length = XSTRLEN( v_temp ).
**** Fill Table for Attachment
CLEAR lt_file_content_binary.
WHILE NOT v_temp IS INITIAL.
v_line = v_temp.
v_struct-line = v_line.
INSERT v_struct INTO TABLE lt_file_content_binary.
SHIFT v_temp LEFT BY 1022 PLACES IN BYTE MODE.
ENDWHILE.

**** Attach Document to Opportunity
CALL FUNCTION 'CRM_ICSS_UPLOAD_SR_ATTACHMENT'
EXPORTING
iv_request_guid_c = lv_request_guid_c
icss_file_info = ls_file_info
IMPORTING
ev_objkey = lv_objkey
TABLES
file_content_binary = lt_file_content_binary.
**** Return Objectkey and other File information
size = ls_file_info-length.
CONCATENATE 'Attachment No.' anhang_nr
'Filename:' attribute-filename
'Size:' size
INTO ls_text
SEPARATED BY space.
APPEND ls_text TO lt_text.

ENDLOOP.

**** send reply
CONCATENATE
'Attachment was added to Opportunity' iv_opportunity_id
INTO l_subject
SEPARATED BY space.

ENDIF.

me->send_reply( io_reply = lo_reply
ip_subject = l_subject
it_content = lt_text ).
ENDIF.

* ----------------------------------------------------------------------------
* error handling
* ----------------------------------------------------------------------------
* system error
CATCH cx_os_object_not_found cx_alert_recipient_unknown
cx_document_bcs cx_send_req_bcs cx_address_bcs.
TRY.
**** send reply
l_subject = 'Message could not be processed'.
**** build content for reply
ls_text = 'An internal system error occured!! Please send the message again.'.
APPEND ls_text TO lt_text.
ls_text = 'If this error occurs again please call your system administrator.'.
APPEND ls_text TO lt_text.

me->send_reply( io_reply = lo_reply
ip_subject = l_subject
it_content = lt_text ).

* e_retcode = 4.
CATCH cx_document_bcs cx_address_bcs cx_send_req_bcs.
* e_retcode = 4.
ENDTRY.
ENDTRY.

**** exit has done its work
e_retcode = if_inbound_exit_bcs=>gc_terminate.

ENDMETHOD.

Actions

Filter Blog

By author:
By date:
By tag: