Getting message as attachment!!

Hi all,,
I have an ABAP program where i could send mails to the recipients.
But the recipients are able to receive the content of the mails only in attached pdf format.
But could not get as a body content in the email.
I had passed packing_list-Document type = 'RAW' in in so_document_send_API1
What should i need to do in the settings..
will be awarded..
thanks in adv!!

REPORT ztest.
This example shows how to send
  - a simple text provided in an internal table of text lines
  - and an attached MS word document provided in internal table
  - to some internet email address.
All activities done via facade CL_BCS!
DATA: send_request       TYPE REF TO cl_bcs.
DATA: text               TYPE bcsy_text.
DATA: text_xls               TYPE bcsy_text.
*data: binary_content     type solix_tab.
DATA: document           TYPE REF TO cl_document_bcs.
DATA: sender             TYPE REF TO cl_sapuser_bcs.
DATA: recipient          TYPE REF TO if_recipient_bcs.
DATA: bcs_exception      type ref to cx_bcs.
data: sent_to_all        type os_boolean.
START-OF-SELECTION.
    PERFORM main.
      FORM main                                                     *
FORM main.
  try.
    -------- create persistent send request ------------------------
      send_request = cl_bcs=>create_persistent( ).
     TRY.
      CATCH CX_SEND_REQ_BCS .
     ENDTRY.
    -------- create and set document with attachment ---------------
    create document from internal table with text
      APPEND 'Hi! how r u ? open the xls.' TO text.
      document = cl_document_bcs=>create_document(
                      i_type    = 'RAW'
                      i_text    = text
                      i_length  = '12'
                      i_subject = 'test created by BCS_EXAMPLE_2' ).
    add attachment to document
    BCS expects document content here e.g. from document upload
*TRY.
append 'HI' to text_xls.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
  EXPORTING
    I_ATTACHMENT_TYPE     = 'DOC'
    I_ATTACHMENT_SUBJECT  = 'My attachment'
   I_ATTACHMENT_SIZE     =
   I_ATTACHMENT_LANGUAGE = SPACE
  <b>  I_ATT_CONTENT_TEXT    = text</b>
   I_ATT_CONTENT_HEX     =
   I_ATTACHMENT_HEADER   =.
CATCH CX_DOCUMENT_BCS .
*ENDTRY.
     CALL METHOD document->add_attachment
       EXPORTING  i_attachment_type = 'XLS'
                  i_attachment_subject = 'My Attachment'
                  i_att_content_hex    = binary_content.
    add document to send request
      CALL METHOD send_request->set_document( document ).
    --------- set sender -------------------------------------------
    note: this is necessary only if you want to set the sender
          different from actual user (SY-UNAME). Otherwise sender is
          set automatically with actual user.
      sender = cl_sapuser_bcs=>create( sy-uname ).
      CALL METHOD send_request->set_sender
        EXPORTING i_sender = sender.
    --------- add recipient (e-mail address) -----------------------
    create recipient - please replace e-mail address !!!
      recipient = cl_cam_address_bcs=>create_internet_address(
                                        '[email protected]' ).
    add recipient with its respective attributes to send request
      CALL METHOD send_request->add_recipient
        EXPORTING
          i_recipient  = recipient
          i_express    = 'X'.
    ---------- send document ---------------------------------------
      CALL METHOD send_request->send(
        exporting
          i_with_error_screen = 'X'
        receiving
          result              = sent_to_all ).
      if sent_to_all = 'X'.
        write text-003.
      endif.
      COMMIT WORK.
*                     exception handling
* replace this very rudimentary exception handling
* with your own one !!!
  catch cx_bcs into bcs_exception.
    write: 'Fehler aufgetreten.'(001).
    write: 'Fehlertyp:'(002), bcs_exception->error_type.
    exit.
  endtry.
ENDFORM.
SEE THE ABOVE EXAMPLE, what i bolded is for getting the content

Similar Messages

  • How to get message/rfc822 attachment name by using JavaMail

    Hi,
    I am fetching incoming mail which has message/rfc822 attachment. i.e: ".msg" (mime message) is attached to this incoming mail. When I try to get name of this message/rfc822 attachment, I am getting null. Body part for this message attachment doesn't contain attachment name? Is this known issue? Is there any solution for this? How to get attached message name?
    I am using javax.mail.part.getFileName() for getting bodypart's filename.
    Thanks,
    Shilpa

    This is not unusual. An attached message need not have a filename,
    especially if it wasn't stored in a file but rather was just attached to the
    new message from within the mailer that composed the new message.
    Some mailers will set a filename anyway, but there's no requirement
    that they do that.

  • Getting "Cannot Insert Object" message while attaching .pdf file to excel spreadsheet.

    While I am trying to attach an adobe (.pdf) file in excel spreadsheet I am getting message as “Cannot Insert Object”.
    I am following the below mentioned steps and getting message as “Cannot Insert Object”.
    Open the adobe (.pdf) file from IE browser.
    While saving the adobe file on local machine it gives warning as “This document does not allow you to save any changes you have made to it unless you are using Adobe Acrobat 9, Pro 9 or Pro Extended 9.  You will only be saving a copy of the original document.  Do you want to continue?” On pressing "OK" it successfully saves the file on my local machine.
    While I Tried to attach the saved adobe file in a spreadsheet of excel it gives message as “Cannot Insert Object”.
    Does any one have any thoughts at all as to how to solve this?

    Deepika,
    The alert dialog your screen shot depicts will only display if there is some kind of form annotation present in a PDF that is not "Reader Enabled".
    Look closer at your 'final' PDF.
    A PDF, not "Reader Enabled", that contains any form annotations will, when opened by Adobe Reader,
    result in the alert dialog that you mention. A "hard wired" default.
    Note that the forms document message bar can be "off" by a selection in Adobe Reader / Acrobat Preferences.
    Select the 'Forms' category. Select "Always hide forms document message bar".
    Be well...

  • Cannot attach files to email. get message "An internal error occurred when attempting to attach... " when do retry and "switch" can attach the file. What is the problem? Files attach ok with IE.

    Cannot attach files to email. get message "An internal error occurred when attempting to attach... " Have tried attaching docs and jpg. Same result , files don't attach. When click on try again and then "switch" the file does attach.

    Cannot attach files to email. get message "An internal error occurred when attempting to attach... " Have tried attaching docs and jpg. Same result , files don't attach. When click on try again and then "switch" the file does attach.

  • Getting message typed twice when including attachment in Mail 6.2 (1499)

    getting message typed twice when including attachment in Mail 6.2 (1499)
    anyone else having this issue?

    Can you explain further what you mean "getting message typed twice"?
    Does each letter double ("ccaatt"), each word double ("cat cat"), each sentence double ("The cat left. The cat left"), or the entire message text double ("Dear John The cat left. Sincerely, Mary Dear John The cat left. Sincerely Mary")?
    Does the doubling appear while you are typing, only after you attach a file, in the "Sent" mailbox copy after sending, or only on the receiving end?

  • Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?

    Message title says it: Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?
    I can't find anything in the Knowledge Base that says these two options no longer work or still do.
    I do not have a system capable of running Lion, but I need to know the answer nonetheless.

    Gee, I don't know: "paste attachments mail Lion"? ;-)
    One further question, if I may: in Panther (which is where I've aggregated nearly 7 years of mail), if you copy more than one file in the Finder, switch to Mail, and paste the files into a new message, only the file names paste in. If you copy one file and paste it into a Mail message, you get the file, not just the name. Is that still true, or has that (IMHO) bug been fixed since 10.3.9?

  • Why do i keep getting "Message Send Failure" every time I send pictures on iMessage? All are sent to other iPhone/iPad users.

    For a few months now, I've been getting "Message Send Failure" every time I send pictures to other Apple devices (iPhones, iPads, Macs), despite the recipient receiving them. So, even though the pictures are going through, the "Message Send Failure" notice keeps showing up. I checked with other people who have Apple devices and they also encountered the same issue whenever they send pictures (usually send an email to make sure it was received).  I thought when iOS 7.1.1 came out that it would fix this issue. Has anyone else encountered the same issue? Thanks!

    I started getting the error on my iPhone 5 (iOS 7.1.x) several weeks ago - if not a month ago. Today I finally decided to run through a wholesale sign-out/sign-in process on all my devices (iMac, MacBook, iPad 1, iPad 3 and iPhone5) and it worked!
    I signed out of iMessage/Messages on all devices. I also deleted my iCloud accounts on all my devices (make sure you tell the software to keep local copies when you are prompted - relax, it all stays in the cloud, too) Then I signed back in to iMessage/Messages and then re-added iCloud accounts all around. I just sent a message with a photo attachment and did not get the "Not Delivered" message - yay!
    (FYI - even though I received the error every time I sent a message with an image attachment, the message still went through - very, very happy, though to finally get rid of the message...)

  • Getting encoded Email attachment!!!!

    Hi Frds,
    I am sending a notification through email. Its the same SendEmailWith Attachments example. The samplecover.pdf file is shown properly in email attachment , but when I wanna read .txt/.doc/.rtf file its showing some encoding.
    I am using mime type for the attachment as
    "string('text/html; charset=UTF-8'
    Any pointers so that I could get my email attachment show proper message instead of encoding. Thanks to all

    I don't see the function under Advanced Functions. I looked through all the other function lists and I still don't see doTranslateToNative() anywhere. When I try to use the function anyway, I get an error when I try to deploy the BPEL process. The error message says the function is not registered, make sure the function is registered in xpath-functions.xml file located under domain config directory and make sure that function prefix is mapped to correct namespace in <process> activity.
    I looked in the xpath-functions.xml file and I don't see any functions listed in there. I'm not sure why the error message says the function needs to be listed in this file because other xpath functions are available for use in the BPEL process and they aren't listed in the file.
    Is there another solution besides using doTranslateNative()?

  • Get message "application virtualization client svcs not running". error 4625852-0fa10612-00006003

    When trying to print an attachment to an email, I get message "application virtualization client svcs not running". Error Code: 4625852-0FA10612-00006003.

    I mendoza How you do, sorry to learn that you are having this issue.
    specify 
    What printer do you have?
    What Operating system?
    What browser are you using?
    I will do my best to help share this infomation
    Regars:
    RobertoR
    and remember . . .
    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • How to change messaging server attachment quotas

    Hi All
    We have messaging server version 7.3.currently we are able to send 1MB,But we want to change it to 10MB,where need the chage,please help.
    -bash-3.00# ./imsimta version
    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009)
    libimta.so 7.3-11.01 64bit (built 19:54:45, Sep 1 2009)
    Using /opt/sun/comms/messaging64/config/imta.cnf (not compiled)
    SunOS mirror 5.10 Generic_141444-09 sun4v sparc SUNW,Sun-Blade-T6320
    Regards
    Kamal

    kkdas wrote:
    Iam getting this error messages convergence version 1.3 from client machine Iexploere 7,8 Firefox 5.0
    Firstly, there is no such version of Convergence. There is Convergence 1 Update 3 (a.k.a. Convergence patch 10). Convergence 1.3 doesn't exist.
    You can get the exact version of Convergence by running "./iwcadmin -V" e.g.
    -bash-3.00# ./iwcadmin -V
    Sun Convergence 1.0-11.01 (built November 2 2009 - 20:48:35) Also there is no such version of Firefox. There is Firefox 3.5, Firefox 3.0 -- there is no Firefox 5.0.
    Error
    you have not authorized to perform this operation.There is no such error message. The following error message does exist however:
    "Error: You are not authorized to perform this operation"
    If you expect people to help you in the forums the least you can do is spend the time to provide correct information so we don't waste time searching for non-existent error messages.
    Attachment size 3.3MB is ok if i try 4MB getting below this errorIf the attachment size is larger the Messaging Server allows you should get a popup with the message:
    "Error: File too large"
    What you can try is to increase the Messaging Server service.http.maxmessagesize and service.http.maxpostsize settings e.g.
    ./configutil -o service.http.maxmessagesize -v "12058624"
    ./configutil -o service.http.maxpostsize -v "12058624"
    ./stop-msg http
    ./start-msg httpRegards,
    Shane.

  • Guys, every time I download app on iPhone, i get message that "your user id has been disabled''

    guys, every time I download app on iPhone, i get message that "your user id has been disabled'

    That is exactly what happened to me!  I wrote to Apple and they informed me that my account had been disabled because somebody had made a complaint that their credit card had been used to buy stuff on my account without their consent thus my account was disabled and it was a permanant thing.  They suggested I set up a new Id, explained I could still use my apps but would not be able to update them.  I wrote back to them explaining that there was no way I would have done such a thing, that I felt that I was being penalised over something I had not control over and I had bought my apps in good faith expecting to be able to update them as required.  I also pointed out that a little while ago I found that my account had suddenly changed to a USA based one so that I had reset it and the password along with the credit card attached to it.  I didn't really think much about it but now I wonder if I had been hacked. 
    I did get a very nice email back saying that they would investigate but having waited a few days I just got an email from a supervisor saying they had closed the account, there would be no further information given and I could look at their terms and conditions. I haven't been even been told what apps were supposedly bought through my account to see if there has been a genuine mix-up with credit cards through the banking system.  I feel somewhat besmirched by the whole affair; I would never do anything illegal or misuse my account but despite being a loyal Apple customer who has promoted their products at every given opportunity, both professionally and socially, I have been summararily dismissed without being given the chance to defend myself or my reputation.

  • Send Message With Attachment

    Good Day
    Experts:
    I am looking to Send a message with an attachment from my AddOn code to a recipient. 
    For now, I am just trying to send it to myself here internally.  I have spent time in the Help, Sample and the forum
    with no luck.  The Messages object and the Messages Services and I cannot get the code to send an e-mail.
    Now, my SBO Mailer service is started in the SAP B1 Serve Suite Manager. 
    Here is my code for the oMessages object.  This adds without error but I never get the e-mail.  Is there somewhere I can check to see if the email got lost?
        Dim lErrCode As Long
        Dim sErrMsg As String
        lErrCode = Nothing
        sErrMsg = ""
        Dim msg As SAPbobsCOM.Messages
        msg = g_B1Connection.Company.GetBusinessObject(BoObjectTypes.oMessages)
        msg.MessageText = "This is the content of message"
        msg.Subject = "Hello manager"
        Call msg.Recipients.Add()
        msg.Recipients.UserCode = "manager"
        msg.Recipients.NameTo = "manager"
        msg.Recipients.SendEmail = BoYesNoEnum.tYES
        msg.Recipients.EmailAddress = "<email address>"
        Call msg.Attachments.Add()
        msg.Attachments.Item(0).FileName = "C:\NextBPCode.txt"
        msg.Add()
        g_B1Connection.Company.GetLastError(lErrCode, sErrMsg)
        If lErrCode = 0 Then
        Else
           UpdateStatus("Error sending email..." & sErrMsg & "", SAPbouiCOM.BoStatusBarMessageType.smt_Error)
       End If
    Any help is appreciated as I have spent way too much time so far on this issue.
    Thanks,
    EJD

    Hi Ed,
    Your code works fine (I can send emails to an account with attachments using this code).
    I'm assuming that you can send the message (and attachment) if you do it manually through the user-interface. If you don't get the message when you do it manually then check your SBO Mailer settings.
    When you add a message in SBO you should see new entries in the OALR and ALR1 tables. The ALR1 table has a status column (U for unsent, P for pending, S for sent and E for error). If the status remains at U then your mailer is not attempting to send the email. If you get an E status then check the application log in Event Viewer as this should record a more detailed error message (and then check SAP Notes for the code). Also check your attachments path to see if the attachment has been copied across (attachment path is in the path tab of General Settings).
    Kind Regards,
    Owen

  • Running 10.6.8. Trying to open and view contents of a CD (of an MRI) and getting message 'This program cannot be run in DOS mode' Is there a way? Thanks for the help.

    Running 10.6.8. Trying to open and view contents of a CD (of an MRI) and getting message 'This program cannot be run in DOS mode' Is there a way? Thanks for the help.

    Go to the support site for the provider of the MRI software.
    Sounds like it windows/PC. I have ran across that for the CDs that veterinarians provide for digital x-rays.
    I would try on a PC or on yuur Mac with Windows via BootCamp or a virtual machine like VirtualBox

  • How do I get messages to go back to an AIM account? It's only seeing the iPad's Facetime email address and not seeing the old AIM account name that is on my desktop. I am using my iMac using iChat to talk to a newer iMac that doesn't have iChat.

    How do I get messages to go back to an AIM account? It's only seeing the iPad's Facetime email address and not seeing the old AIM account name that is on my desktop. I am using my iMac using iChat to talk to a newer iMac that doesn't have iChat. We had this working using Messages and Facetime (on the new machine) talking to my existing iChat account. One day last week, when Facetime rang, my kids answered on the iPad. Dang! Now it's all fouled up! The new iMac won't see my AIM account name and shows that I'm offline, because the iPad is off. We were able to call using "most recent call" in Facetime, but now I can't go and control that new iMac remotely to help with some email concerns the user is having. I'm trying to not personalize this too much, but it's grandkids talking to Grandma and Mom and Dad trying to solve new machine hiccups. Normally, I could just go in via iChat and control the other machine and troubleshoot, but I can't do it with Facetime only. My buddy list doesn't see  the other computer even though we are connected on Facetime right now. My name is not highlighted for the other computer. What could have gone so wrong?
    Any help would be appreciated.

    How do I get messages to go back to an AIM account? It's only seeing the iPad's Facetime email address and not seeing the old AIM account name that is on my desktop. I am using my iMac using iChat to talk to a newer iMac that doesn't have iChat. We had this working using Messages and Facetime (on the new machine) talking to my existing iChat account. One day last week, when Facetime rang, my kids answered on the iPad. Dang! Now it's all fouled up! The new iMac won't see my AIM account name and shows that I'm offline, because the iPad is off. We were able to call using "most recent call" in Facetime, but now I can't go and control that new iMac remotely to help with some email concerns the user is having. I'm trying to not personalize this too much, but it's grandkids talking to Grandma and Mom and Dad trying to solve new machine hiccups. Normally, I could just go in via iChat and control the other machine and troubleshoot, but I can't do it with Facetime only. My buddy list doesn't see  the other computer even though we are connected on Facetime right now. My name is not highlighted for the other computer. What could have gone so wrong?
    Any help would be appreciated.

  • Cannot open pictures in Window 8.1...getting message 'the remote procedure call failed". What is the solution?

    cannot open pictures in Window 8.1...getting message 'the remote procedure call failed".  What is the solution?
    I recently bought a new HP computuer and uploaded Window 8.1.  I then transfered photo files from old computer to new computer using a portable storage drive.
    When trying to view the photos, a message pops up showing a file path...and the message 'the remote procedure call failed'.  Photos are in jpeg format.
    Please let me know what I can do to view photos?

    What program you use to view these photos? Choose another app to view these photos
     for a test.
    This issue only occurred when you view photo? What is the result if we connect the
    portable storage drive to other computer (if possible)?
    Run sfc/scannow to check and fix if there are some missing or corrupted system files.
    Check the event viewer to see the detailed information of this issue.
    Regards
    Yolanda
    TechNet Community Support

Maybe you are looking for

  • How do you reduce the size of keyboard increments

    Greetings, When I have a graphic selected and would like to "nudge" it just a little, if I use one of the arrow keys, it moves it alot.  I don't know where to go in preferences (?) to make any changes, and then I'm not sure what to look for to do so.

  • Cannot install camera raw 6.3

    I downloaded camer raw 6.3 from the adobe downloads site but I cannot install it. There is no camera raw 6.3 installer.exe. There is an AdobePatchInstaller.exe but it returns an error code "update is not applicable" when I run it. Any suggestions. Ji

  • E70 Firmware updates: Changelog?

    Hi. Anyone knows where can I find the changelog of these firmware updates? My version is 1.0610.05.07 and everything seems to work fine. I'm wondering if there is an advantage to upgrade.

  • Using iTunes 7 with external hard drive

    I just purchased an external hard drive (Verbatim Smart disc) to hold all my music because my library was too large for my iBook. All the music was loaded onto it by the nice people at the Mac store who helped me sort out why my computer was being fu

  • Log Out.webloc

    What is Log Out.webloc with safari icon, which has appeared on my desktop?