Skip to Content

Advance Sending email from Solution Manager (or CRM)

A solution for sending mail from Service Desk with attachments provided from the Solution Database or from the Activity

Preface

One of the most usefull areas of solution manager is the Service Desk. Unfortunately, even if it’s possible to attach a solution from the solution database to a Service request, in the outbound mail there is no possibility to send any kind of attachments to the “reported by” address.

This issue has two kind of impacts

  • If the service team find a solution in the solution database with an attachment that explains how to fix the request, the operator has to send the solution in a different way (for example sending a mail from outlook).
  • If the service team attach a document to an certain service request and want to send it to the “reported by” address, the only way to do so is download the file and send it then manually.
Solution

Creating a extended action “send mail with attachment” instead of the standard “send email”. This solution is also working on CRM systems for outboud email from CIC.

Technical implementation

Starting from note 935670 (PPF: Sending an SF output with a main document), we extend with the following logic:

  • Prepare a PDF from smart from (as in the standard).
  • Determine all kind of attachments available (eg: check if the solution is correlate, check if there are attachments in the activity, etc).
  • Show a popup to the end user, where to decide which kind of attachment need to be send.
  • Send the mail.
More in detail

Determine witch action is need to be defined

In customizing, under Define Action Profile and Action (TCODE= CRMC_ACTION_DEF) we identify our Action profile (SLFN0001_ADVANCED), choosing Action Definition (SLFN0001_ADVANCED_MAIL) –> Processing type we found which class process the specific action: for this is the class CL_DOC_PROCESSING_CRM_ORDER- CRM_SRVORDER_EXEC_SMART_FORM.

So we can make new class ZSMCL_DOC_PROCESSING_CRM_ORDER based on CL_DOC_PROCESSING_CRM_ORDER and extend the method CRM_SRVORDER_EXEC_SMART_FORM.

After the statement

* determine the tables of the application CALL FUNCTION 'CRM_OUTPUT_SINGLE_READ' EXPORTING

iv_object = io_appl_object .... et_output_service_i_assi = lt_service_i_assi.

we can put our specific code for the get attachments:

Show Popup

At this point we have all the information needed in the table t_attach (id, name, source (Attach/SolutionDB), selected). We send all this information to the custom function module that shows the table t_attach and permit to the user to change the subject, write body mail and select the attachment.

prepare the mail

The rest of the code is as describe in oss note 935670, with an exception after the code

CALL METHOD document->add_attachment EXPORTING i_attachment_type = 'OTF' i_attachment_subject = ls_output_options-tdtitle i_attachment_size = l_otflen i_att_content_text = text.

we put

Add Attach

Finally, the method ZSM_ATTACH_PHIO_DOCU (that physically attach the file to the mail) will be:

Last step

Now the only activity left is to copy and modify the original action definition SLFN0001_ADVANCED_MAIL with the new one SLFN0001_ADVANCED_MAIL_ATT; that uses the custom class ZSMCL_DOC_PROCESSING_CRM_ORDER

The result

Now you are ready to choice the new action as follow:

image

and then the customer popup is displayed

image

Afterwards, in the mail client we will detect the mail sent by the system:

image

That’s all folks!

What will be developed in the future
  • Starting from the business partner in the service request, the user can select one or more accounts to send the email with attachments.
  • … suggestions will be appreciated…
To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. Kamran Ellahi
    Hi Emmanuele
    This article is great and had really assisted me in getting this activity done.
    I want to know if the following is possible iam running Solution Manager 3.2 with SP 9 .
    1. My support team need to recieve an email when ever there is a new support message created.
    2. Is there a manager’s view of support desk or is there some report that graphically display the problem raised in a certain component and resolved in a certain component.
    (0) 
    1. Emmanuele Prudenzano Post author
      Hi Kamran,

      There are two ways to send activity when the are receive in the solution manager.
      The first one is to use the workflow, the second is to use a customer exit (or badi) during incoming message process. Next week I can give you the correct name of exit becouse now i’m not in office. In this badi you an submit a mail with the same tecnique that is describe in this blog.

      For the second question I’m not sure to undersand well. Why did you not use dno_notif transaction? Ypu can choice “my team” and see all service desk of your team. From this point is easy to get all information.

      Redgards
      Emmanuele

      (0) 
      1. Emmanuele Prudenzano Post author
        Hi Kamran,

        The badi that you can use after inbound service request, is the DNO_SAP_CHECK_SAVE. This badi is fired after the commit for service desk.
        So you can use this, for example, for sending email.

        Bye
        Emmanuele Prudenzano

        (0) 
  2. Issac Nolis Ohasi
    Hi Emmanuelle,

    I read your source but I didn’t found some required objects.. Could you give the source of theses Z objects?

    FM: ‘Z_SM_MANAGE_ATTACH_FOR_SD’
    METHOD: zsm_attach_phio_docu

    Thks in advance

    Kind Regards

    Issac Nolis Ohasi
    SAP NW’04 Solution Manager Certified
    Complex Consultancy – Brazil

    (0) 
    1. Emmanuele Prudenzano Post author
      Hi Issac,
      The method is describe in weblog as last step. For the fm, you have right, next week i’m in office and i can post also the FM.

      Thanks
      Emmanuele Prudenzano

      (0) 
  3. Andy Körber
    Hi Emmanuele,

    It´s a great article!
    We use Solution Manager 4.0. The customizing for sending emails via action works great. But I need the attachment in the mail and so I found your article.

    I tried to implement your solution in our SAP system.  I´m new to ABAP and so it´s a little bit try and error for me.

    I´ve got some errors:

    In method EXEC_SMART_FORM_WITH_TEXT (from note 935670) :
    – method string_to_soli does not exist. There is a method xstring_to_solix.

    When I change to method xstring_to_solix
    – “L_STRING” is not type-compatibly to “IP_XSTRING”.

    In method ZSM_ATTACH_PHIO_DOCU:
    – field DOCUMENT is unknown

    Do you have any idea?
    Thanks in advance

    Best Regards
    Andy

    (0) 
    1. Wouter Heuvelmans
      Andy,

      You’re right, we’ve found the same problems.
      The method STRING_TO_SOLI does not exist in our system as well.
      So Emmanuele, could you please help us out here?
      I know the note mentioned is from SAP but how do I post a message to them that there note is not complete?

      Regards

      Wouter Heuvelmans
      Pyramid Applied Solutions
      The Netherlands

      (0) 
  4. Emmanuele Prudenzano Post author
    hi all,
    Sorry for mistakes.

    First at all, the note talk about a method that does not exist in some release: soli_to_string.

    I take the note as guideline, and change the statement:

    text = cl_document_bcs=>string_to_soli( l_string ).

    with the following:

      DATA: t_body TYPE STANDARD TABLE OF soli.
      PERFORM string_to_text IN PROGRAM saplscms_conv
              TABLES   t_body
              USING    l_string
                       ‘X’
              CHANGING sy-tleng.

    Second mistake is that i forgot to give the signature for method ZSM_ATTACH_PHIO_DOCU. It is:
    PHIO        TYPE SKWF_IO
    DOCUMENT    TYPE REF TO CL_DOCUMENT_BCS

    And finaly the fm is the one the show the popup, and has no critical activiy. Anyway in a couple of days I will update this blog with saplink code for all object.

    Thanks to all.
    Emmanuele Prudenzano

    (0) 

Leave a Reply