Open Outlook email editor from SAP

Hi,
I need to open the outlook email editor from ABAP program so that the user can manually input the To, CC, subject, body and attachment.
Can anybody help ?
Thanks and regards
Arijit Ghose

check out this sample code (using VB script) , you can do similar stuff using activex control as well.
FUNCTION Z_OUTLOOK_MAIL_CREATE.
*"*"Local interface:
*"       IMPORTING
*"             VALUE(I_SUBJECT) TYPE  C OPTIONAL
*"       TABLES
*"              EMAIL_BODY STRUCTURE  SOLI OPTIONAL
*"              ADDRESS_LIST STRUCTURE  SOLI OPTIONAL
*"              ATTACHMENTS STRUCTURE  SOLI OPTIONAL
*"       EXCEPTIONS
*"              INVALID_PATH
*"              DOWNLOAD_FAILED
*"              EXECUTION_FAILED
  DATA:
    V_TRANSLATE(2),
    IT_VBS          LIKE SOLI
       OCCURS 50 WITH HEADER LINE,
    V_LAST,
    V_VBS_FILENAME  LIKE RLGRAP-FILENAME,
    COMMANDLINE(1000).
*- Prepare a code to translate a quote into a hex-tab
*- so it can then be translated back to 2 double quotes.
  CONCATENATE '"' CON_HEX-TAB INTO V_TRANSLATE.
  APPEND:
    'Dim myolapp                                        ' TO IT_VBS,
    'Dim olNamespace                                    ' TO IT_VBS,
    'Dim myItem                                         ' TO IT_VBS,
    'Dim myRecipient                                    ' TO IT_VBS,
    'Dim myAttachments                                  ' TO IT_VBS,
    '                                                   ' TO IT_VBS,
    'Set myolapp = CreateObject("Outlook.Application")  ' TO IT_VBS,
    'Set olNamespace = myolapp.GetNamespace("MAPI")     ' TO IT_VBS,
    'Set myItem = myolapp.CreateItem(olMailItem)        ' TO IT_VBS,
    '                                                   ' TO IT_VBS.
*- Translate the body into a single line.
  LOOP AT ADDRESS_LIST.
    CONCATENATE
      'Set myRecipient = myItem.Recipients.Add("'
      ADDRESS_LIST
      INTO IT_VBS.
    APPEND IT_VBS.
  ENDLOOP.
  APPEND:
    'myItem.VotingOptions = "Approve;Reject"' TO IT_VBS.
*- Build the subject line.
  CONCATENATE
    'myItem.Subject = "'
    I_SUBJECT
    INTO IT_VBS.
  APPEND IT_VBS.
*- Prepare attachments
  APPEND:
    'Set myAttachments = myItem.Attachments' TO IT_VBS.
*- Check if the attachment exists
  LOOP AT ATTACHMENTS.
    CALL FUNCTION 'WS_QUERY'
         EXPORTING
              FILENAME       = ATTACHMENTS
              QUERY          = 'FE'
         EXCEPTIONS
              INV_QUERY      = 1
              NO_BATCH       = 2
              FRONTEND_ERROR = 3
              OTHERS         = 4.
    IF SY-SUBRC EQ 0.
      CONCATENATE 'myAttachments.Add("'
                  ATTACHMENTS
        INTO IT_VBS.
      APPEND IT_VBS.
* '    olByValue, 1, "4th Quarter 1996 Results Chart"'
*      append '    olByReference, 1' to it_vbs.
    ELSE.
      MESSAGE I017(ZZ) WITH
         'Could not attach' ATTACHMENTS.
    ENDIF.
  ENDLOOP.
*- Prepare the email body.
  CLEAR: V_LAST, IT_VBS.
  APPEND IT_VBS.
  LOOP AT EMAIL_BODY.
    AT FIRST.
      APPEND 'myitem.body = _' TO IT_VBS.
    ENDAT.
    AT LAST.
      V_LAST = 'X'.
    ENDAT.
    TRANSLATE EMAIL_BODY USING V_TRANSLATE.
    WHILE SY-SUBRC EQ 0.
      REPLACE CON_HEX-TAB WITH '""' INTO EMAIL_BODY.
    ENDWHILE.
    IF V_LAST = 'X'.
      CONCATENATE '"' EMAIL_BODY '" &vbCrLf '
        INTO IT_VBS.
    ELSE.
      CONCATENATE '"' EMAIL_BODY '" &vbCrLf  &_'
        INTO IT_VBS.
    ENDIF.
    APPEND IT_VBS.
  ENDLOOP.
  APPEND 'myItem.Display' TO IT_VBS.
*- Prepare the vbscript filename for download and execution
  CLEAR V_VBS_FILENAME.
  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            ENVIRONMENT    = 'TEMP'
            QUERY          = 'EN'
       IMPORTING
            RETURN         = V_VBS_FILENAME
       EXCEPTIONS
            INV_QUERY      = 1
            NO_BATCH       = 2
            FRONTEND_ERROR = 3
            OTHERS         = 4.
  IF SY-SUBRC <> 0.
    RAISE INVALID_PATHNAME.
  ENDIF.
  CONCATENATE V_VBS_FILENAME 'mail.vbs'
    INTO V_VBS_FILENAME.
  COMMANDLINE = V_VBS_FILENAME.
*- Download the file
  CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
            FILENAME            = V_VBS_FILENAME
            FILETYPE            = 'DAT'
            MODE                = 'S'
       TABLES
            DATA_TAB            = IT_VBS
       EXCEPTIONS
            FILE_OPEN_ERROR     = 1
            FILE_WRITE_ERROR    = 2
            INVALID_FILESIZE    = 3
            INVALID_TABLE_WIDTH = 4
            INVALID_TYPE        = 5
            NO_BATCH            = 6
            UNKNOWN_ERROR       = 7
            OTHERS              = 8.
  IF SY-SUBRC <> 0.
    RAISE DOWNLOAD_FAILED.
  ENDIF.
  CALL FUNCTION 'WS_EXECUTE'
       EXPORTING
            COMMANDLINE    = COMMANDLINE
            PROGRAM        = 'WSCRIPT.EXE'
       EXCEPTIONS
            FRONTEND_ERROR = 1
            NO_BATCH       = 2
            PROG_NOT_FOUND = 3
            ILLEGAL_OPTION = 4
            OTHERS         = 5.
  IF SY-SUBRC <> 0.
    RAISE EXECUTION_FAILED.
  ENDIF.
ENDFUNCTION.
Regards
Raja

Similar Messages

  • Open Outlook email editor from SAP  and attach email into SAP

    I have a requirment that in SAP we have the option to add from Micrsoft Outlook, and when that is slected, you are taken to your email so that you can see your inbox and select the email that need to attach in SAP.
    I need to implement this scenario in the tcode SCASE and in the Dispute management->Case->Dispute Case->search and enter the CaseID and click on Search button and you can see down and click on Edit button and you can see the Attached object and from there i need to have one new button when user click on that button and its Micrsoft Outlook should open and you should taken to your email so that you can see your inbox and select the email that need to attach to the CASEID.

    I have a requirment that in SAP we have the option to add from Micrsoft Outlook, and when that is slected, you are taken to your email so that you can see your inbox and select the email that need to attach in SAP.
    I need to implement this scenario in the tcode SCASE and in the Dispute management->Case->Dispute Case->search and enter the CaseID and click on Search button and you can see down and click on Edit button and you can see the Attached object and from there i need to have one new button when user click on that button and its Micrsoft Outlook should open and you should taken to your email so that you can see your inbox and select the email that need to attach to the CASEID.

  • How to call outlook email editor from PCUI ?

    Hi all,
    Can anybody tell me how do I can invoke the outlook email editor with To, CC, BCC, body, format, signature, etc filled up from PCUI ?
    Thanks and regards
    Arijit Ghose

    i have not worked with PCUI, but i assume its a HTML page.
    if so you can use the following code.
    <script>
    function popupMessage() {
    // SET MESSAGE VALUES
      var to = "[email protected]";
    var cc = "[email protected]";
    var bcc = "[email protected]";
    var subject = "A Preformatted Email Message";
    var body =       "Chandler,nntI'm sorry, I can't make it tonight. " +
          "I have to rearrange my sock drawer. " +
         "nnSincerely,nnMonica" 
    // BUILD MAIL MESSAGE COMPONENTS
      var doc = "mailto:" +
    to +
          "?cc=" +
    cc +  
        "&bcc=" +
    bcc +
          "&subject=" +
    escape(subject) +
           "&body=" +
    escape(body);
      // POP UP EMAIL MESSAGE WINDOW
    window.location = doc;}
    </script>
    <FORM>
    <INPUT TYPE=BUTTON NAME=Test Value="Mail Window Test" onClick="popupMessage()">
    </FORM>
    if not if its from SAPGUI do let me know, i will present another solution.
    Regards
    Raja

  • Can't open PDF email attachments from mail app. (iOS7, iPad2)

    Since upgrading to iOS7 I cannot open PDF email attachments from the "Mail" app. The attachment appears as a "tap to download" icon, after downloading it appears as an image of the first page of the PDF. An extended press of the PDF image results in "save image" and "copy" options, but no "open in" option.
    I have tried closing and re-opening mail, restarting the iPad, several different attachments. Still no "Open in" option.
    Any help with this?

    I work in a support organization and we've seen variations of this issue develop on various iphones and ipads with ios7.  Oddly, not everyone is experiencing this, just some people.
    In my own case, I simply downloaded Acrobat Reader for free and can read the things fine.
    We use an exchange activesync email server and when each email comes in it indicates at the very bottom that it has been downloaded as plain text and to click to download the entire message.  I've tried clicking to download and not clicking and I can read the PDF either way.
    In my own case I can view PDF files and/or also save them by pressing and holding the icon of the PDF in the email.
    The other thing one of our end users noticed: if she emailed the PDF directly to her iPhone5 and iPad it would not be readable but if she forwarded it to her offsite Yahoo account and then forward to her corporate email it would open.
    I think there's definetely something going on with the formatting of the PDF (was it created by a true Adobe PDF distiller or one of the many clones?), what email application attached it? (Outlook, Eudora, IOS Mail, etc) and how many PDF reading apps are on your IOS devices?
    For instance I have the default PDF reader, iBooks, Kindle, Adobe Acrobat Reader, and there may be others that I don't even know has PDF capability.   Only Apple probably has a good idea of how many apps utilize this.
    Message was edited by: aliensporebomb - clarification

  • Open Default Email Editor with attachment

    How I open default email editor with attachment. Now I can just open the email editor with mailto,subject,body BUT i cant open it with a attachment, which is in a server.

    es5f2000 wrote:Please don't resurrect zombie threads for "me too" style posts.Hmm, I didnt know this was wrong..
    es5f2000 wrote:If you can use 1.6, Desktop.mail() will at least open the mail application, though it won't let you auto-attach. If you must use 1.5, you may have to hand-roll a solution for each environment you support. I'm not personally aware of any 1.5-compliant library that provides this functionality.Since youve replied, the 1.6 solution of opening an email but without an attachment is not good much use to me, and the creation of various support files and putting them into an attachment is the part of the process that the user has most problems with. So either I could either just create the attachment somewhere and let the customer handle the whole email side of things OR I could make use of the fact that my customers email address is embedded in their license and that an smtp server can be used to send an email from anyone, to open a form for the user to write a problem description and then send it from within my application, but the trouble with this approach is they can't have full control over the email they send.

  • Tab Delimited Text File to be Emailed (External Email ID) from SAP

    Hi,
    I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
    Appreciate your help in advance.
    Thanks,
    Kannan

    Hi,
    I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
    Appreciate your help in advance.
    Thanks,
    Kannan

  • Track Emails Sent from SAP

    Is there any way to track emails sent from SAP to Internet Address ? Can we know whether the delivery was successful, how many mails sent to whom on a specific date ?
    PS: I am in 4.0B Version which doesnt have SOST Transaction. Also it doesnt have Utilities->Overview of Send Orders option in SCOT.
    Thanks in advance.

    Hi,
    I've had this problem before and the best way to find out if emails were sent or not is just to follow up with the actual people getting the emails...
    SAP will only tell limited info about external emails anyway ... once the email passes through the internet gateway it's no longer SAP's problem.
    If you are the one controlling the email sending, can you just create a log table and write to it each time?

  • Opening MS Word Editor from ABAP Program

    Hi all,
    My requirement is to give two options. User can open Text Editor OR MS Word Editor from screen. Text/any data entered on this will then be saved.
    Can anyone help me regarding this?
    Thanks a lot in advance.
    Best Regards,
    Prasad

    Prasad,
    Pls. go through below link.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/204d1bb8-489d-2910-d0b5-cdddb3227820]
    Regards,

  • Email sending from SAP

    Hi All,
    I have return one function module to send an email from sap and i can see the status in SOST showing as sent but i haven't recived any emails. Can any one face the same issue
    Thanks
    Warun Kumar Todimala

    >
    warun kumar todimala wrote:
    > Hi All,
    >
    > I have return one function module to send an email from sap and i can see the status in SOST showing as sent but i haven't recived any emails. Can any one face the same issue
    >
    >
    > Thanks
    > Warun Kumar Todimala
    Hi,
    i checked that requirement i recive a mail to officila id only not any other id like gmail and yahoo

  • Sending email alert from SAP Application System

    Hi,
       we have one scenario like we need to send one email alert from application system, if ther is some error in  proxy or any error is ther in SXI_MONITOR of application sytem. Is ther any way to achieve this.
    Regards
    Pradeep P N

    >
    Pradeep P N wrote:
    > Hi,
    >
    >    we have one scenario like we need to send one email alert from application system, if ther is some error in  proxy or any error is ther in SXI_MONITOR of application sytem. Is ther any way to achieve this.
    >
    >
    >
    > Regards
    > Pradeep P N
    for sending mails from application system you can use various FMs -
    http://sapr3.tripod.com/abap011.htm
    http://www.sap-basis-abap.com/abap021.htm
    for XI related you can always utilize alerts

  • Creating a hyperlink from a picture in a pdf that opens Outlook email

    I use Adobe Acrobat 8.1 and am trying to create a link in a PDF so that with READER 7.0 or higher, when a recipient clicks on a picture (object) it will access Outlook and open up a new email that the recipient would complete and then send! Is it via a hyperlink? Not sure, and would appreciate any help that could be offered. Thanks.

    There is a possibility this will not work reliably. For forms, the mailto submission requires MAPI on the client machine. That may also be true for any use of mailto. In that case, it will be dependent on the client machine configuration. On non-windows machines, I have no clue what might happern.

  • How do i change my email editor from outlook express to gmail?

    When a website asks me to click on to an email address, I am taken to my old email address (outlook express) instead of my current one (gmail). how do I change this, please?

    Here are the instructions for setting Gmail as your default mail client:
    http://googlesystem.blogspot.com/2009/06/set-gmail-as-default-email-client-in.html

  • Performance issue - Open a Crystal Report from SAP BW

    Hi,
    I have an general question on the performance of Crystal Reports: We are using Crystal Reports 2008 SP 2 in context with SAP BW 7.0. We don't have a BO XI. We use the BW as a central storage for our reports. Now we have the problem that the opening of some reports takes a long time. For expample one report needs ~13 secound an another > 5 minutes.
    Where can be the problem? What happens in SAP BW when a report is called? And what can we do to make it faster?
    Thanks for your informations!

    Hi Ingo,
    the value of MaxPickListSize is "c8".
    Yesterday I have spent a lot of time to find the bottleneck. I have traced the SQL statements, which are performed from Crystal Reports / Integration Kit when I open a report. It might be the values for the parameters. That's our situation:
    Crystal Reports
           |
    Query (restriced on Cube 1)
           |
    MultiProvider
      - Cube 1
      - Cube 2
      - Cube 3
      - DSO 1
    The slow report is based on the BW Query and in the filter restricted to the Cube 1. If I open the report, all values for the parameters are read from all the InfoProviders under the MultiProvider (Cube 1, Cube 2 Cube 3 and DSO 1). The very big DSO 1, which is not used, increases the duration extremly. This may not be the desired behavior?! Is this a bug? I would expected that only the values are loaded from Cube 1.

  • Encoding issue in email send from SAP

    Hi,
    I am currently having encoding issue in email send by SRM .
    Can some one help me ?
    My problem :
    When i key in my SC subject/desc through IE7 with encoding unicode (UHT-8). Everything look fine.
    After i order the SC, Email will be sending out to the approver.
    The email received by approver is including strange character.
    Example desciption i putting on SC : Testing Encoding from IE7
    Result : Email which received by approver : Testing Encoding from IE7Â.
    Can some one advice me on this?
    Thanks,
    Vanece

    Hello Vanece,
    >
    Vanece Hee wrote:
    > (...)
    > They look fine in BBP_PD as well.
    >
    > when i trace them in SOST, the word will be look weird.
    > (...)
    Problem could come from internal and external data format.
    Depending on your SRM release, check OSS notes for report you used to generate approval mail ( RSWUWFMLEC, RBBP_NOTIFICATION_APP, etc.).
    >
    Vanece Hee wrote:
    > (...)
    > When i change the encoding setting in outlook to unicode for the email, it work for some email only.
    > (...)
    Ask to your Outlook team to have a look at Outlook settings.
    You can also check OSS note 1319517 - Unicode Collection Note.
    Regards.
    Laurent.

  • Opening outlook file (*.msg) using SAP document viewer...

    Hello Gurus,
    My program uses a function module called 'ARCHIVOBJECT_DISPLAY' to display archived document. This opens SAP dcoument viewer in which I am able to display all kind of files such as doc, pdf, xls but when I try to open a msg file i.e outlook files, it just gives some junk.
    Can someone throw some light on this ?
    Regards,
    Rajesh.

    Try to pass DOC as the DOC_TYPE. Outlook messages are actually a Winword file.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • IPhone 5s Voice Call Issues

    I've had an iPhone 5s (upgraded to 8.1.3) since mid-November and have been experiencing difficulties on voice calls ever since (I switched carriers as well). When calling specific contacts (family, friends etc.), the calls sound as though as I am on

  • Why can't I print out google maps on my hp photosmart premium c410?

    I'm set up wireless and it works good except when I try to print out a map from google maps and sometimes from yahoo maps. Can someone help with this? I also have a hp 1350 all in one I have to usb plug in when printing from google maps. I'm running

  • How to make RAID1 of two 750GB HDDs with 945P NEO3-F

    I have a PC with this MSI 945P NEO3-F MB and currently two new 750 GB Samsung SATA2 drives in it. The MB is some 18 months old but I just got the two HDDs today. What I would like to do is set these two HDDs in RAID1 so that I wouldn't loose any data

  • No Measure defined in a reporting enabled analytic or calculation View

    Hello, I'm trying to activate a simple calculation view but getting this error: No Measure defined in a reporting enabled analytic or calculation View The SQL is working on the SQL COnsole but not as View. hier is the code. Hopefully, someone can hel

  • Importing iphoto library into Aperture 3 creates duplicate events

    I am so hoping you can help me here. I started importing my iphoto library that was going well to a point it stopped importing. Looking at Aperture i can see project folders that coincide with the iphoto events but not all of them came across, still