SO_NEW_DOCUMENT_ATT_SEND_API1 Mail body

Dear all,
I have read all the posts about sending mails, i need a help on this.
SO_NEW_DOCUMENT_ATT_SEND_API1' this is the FM iam using to send mails and it is working fine, but the Mail body is not in proper format.
eg if im having 4 records
1 BP NOT CREATED
2 ADDRESS NOT FOUND
3 BP DOESNOT EXIST
4 BP CREATED SUCCESSFULLY
The mai body displays results like
BP NOT CREATED
ADDRESS NOT FOUND  BP DOESNOT EXIST BP CREATED SUCCESSFULLY
but i want it one by one.
For this Im passing the below parameters
*-- Populate packing list for body text
      CLEAR ls_packing-transf_bin.
      ls_packing-transf_bin = 'X'.
      ls_packing-head_start =  1.
      ls_packing-head_num =    0.
      ls_packing-body_start =  1.
      ls_packing-body_num =    lv_tab_lines.              " no.of records in our case 4
      ls_packing-doc_type = 'RAW'.
      ls_packing-doc_size = lv_tab_lines * 255.
      APPEND ls_packing TO lt_packing.
plz let me know where im going wrong..
Regards,
Pawan

Thanks Clemens Solved by using,
newline TYPE c VALUE cl_abap_char_utilities=>newline.
Regards,
Pawan

Similar Messages

  • Formating the mail body

    Hi to all
    Is it possible to format the mail body that we create using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' like a rich user interface?
    Kindly suggest.
    Thanks & Regards
    Vipin

    Its possible to give html tags in the body internal table thereby make it a rich user interface. For html you may need to use document type as HTM.
    I 've given an example in this link. Please have a look.
    Re: Bold, Colors in mail - Urgent
    Rgds,
    TM.

  • How to send data in mail body

    Hi experts,
    I can send all the data of internal table as attachment through mail. But requirement is to send all the data in mail body. No attachment should go with this mail. How to do this?
    Regards,
    Goutam Sahoo

    Hi Check this sample program. Clearly mentioned the body of the message .
    <pre>REPORT  zvenkat_mail_simple.
    Mail related declarations
    "Variables
    DATA :
         g_sent_to_all   TYPE sonv-flag,
         g_tab_lines     TYPE i.
    "Types
    TYPES:
         t_document_data  TYPE  sodocchgi1,
         t_packing_list   TYPE  sopcklsti1,
         t_attachment     TYPE  solisti1,
         t_body_msg       TYPE  solisti1,
         t_receivers      TYPE  somlreci1.
    "Workareas
    DATA :
         w_document_data  TYPE  t_document_data,
         w_packing_list   TYPE  t_packing_list,
         w_attachment     TYPE  t_attachment,
         w_body_msg       TYPE  t_body_msg,
         w_receivers      TYPE  t_receivers.
    "Internal Tables
    DATA :
         i_document_data  TYPE STANDARD TABLE OF t_document_data,
         i_packing_list   TYPE STANDARD TABLE OF t_packing_list,
         i_attachment     TYPE STANDARD TABLE OF t_attachment,
         i_body_msg       TYPE STANDARD TABLE OF t_body_msg,
         i_receivers      TYPE STANDARD TABLE OF t_receivers.
    "start-of-selection.
    START-OF-SELECTION.
      PERFORM send_mail.
      "Form  send_mail
      " PACKING LIST table requires information about how the data in the
      " tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to be
      " distributed to the documents and its attachments. The first row is
      " for the document, the following rows are each for one attachment.
    FORM send_mail .
      "Subject of the mail.
      w_document_data-obj_name  = 'MAIL_TO_HEAD'.
      w_document_data-obj_descr = 'Simple mail using SAP ABAP'.
      "Body of the mail
      PERFORM build_body_of_mail
        USING:space,
              'Hi,',
              'I am fine. How are you? How are you doing ? ',
              'This program has been created to send simple mail',
              'with Subject,Body with Address of the sender. ',
              'Thanks and Regards,',
              'Venkat.O,',
              'SAP HR Technical Consultant.'.
      "Write Packing List (Body)
      DESCRIBE TABLE i_body_msg LINES g_tab_lines.
      w_packing_list-head_start = 1.
      w_packing_list-head_num   = 0.
      w_packing_list-body_start = 1.
      w_packing_list-body_num   = g_tab_lines.
      w_packing_list-doc_type   = 'RAW'.
      APPEND w_packing_list TO i_packing_list.
      CLEAR  w_packing_list.
      "Fill the document data and get size of attachment
      READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
      w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
      "Receivers List.
      w_receivers-rec_type   = 'U'.  "Internet address
      w_receivers-receiver   = <give mail id here>.
      w_receivers-com_type   = 'INT'.
      w_receivers-notif_del  = 'X'.
      w_receivers-notif_ndel = 'X'.
      APPEND w_receivers TO i_receivers .
      CLEAR:w_receivers.
      "Function module to send mail to Recipients
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_document_data
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = g_sent_to_all
        TABLES
          packing_list               = i_packing_list
          contents_txt               = i_body_msg
          receivers                  = i_receivers
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc = 0 .
        MESSAGE i303(me) WITH 'Mail has been Successfully Sent.'.
      ELSE.
        WAIT UP TO 2 SECONDS.
        SUBMIT rsconn01 WITH mode = 'INT'
                     WITH output = 'X'
                     AND RETURN.
      ENDIF.
    ENDFORM.                    " send_mail
    "      Form  build_body_of_mail
    FORM build_body_of_mail  USING l_message.
      w_body_msg = l_message.
      APPEND w_body_msg TO i_body_msg.
      CLEAR  w_body_msg.
    ENDFORM.                    " build_body_of_mail</pre>
    Thanks
    Venkat.O

  • Prob in getting Mail body for the standard tcode F150(Dunning).

    Hello all,
    I am using F150 for the dunning notice print out.After seeing the display of the dunning notice once we come back it populates a popup window where it asks to send the mail to the particular mailid or not. I have used the BTE ---  SAMPLE_PROCEE_00001040 and copied it as z function module and customised according to my requirement in order to get the mail id of the customer in the pop up.My mail is going to the customers mail id properly only but my prob is that we are not able to get any mail body for that particular mail.Where can we add the mail body text to that mail in the standard tcode f150.can any one suggest is it possible or not.
    Regards,
    Pavani.
    Edited by: Pavani Rayappureddi on Aug 11, 2009 11:21 AM

    solved my self.
    added         C_ITCPO-TDTITLE  = 'Pending Receivables Statement-XXX GROUP'.
    in the bte code.

  • Lost mail body and marked messages - Maverick Upgrade

    I lost some message body (they are listed but have no content) and 15 out of 16 messages marked with a flag where not in the Marked Message Folder. That happened after upgrading to Maverick. I tried to replace only the Mail folder in the libraray with the old one from Time Capsule. Didn't work. Had to reinstall whole system.

    i had lost mail body, this is how i fixed it:
    hold option, click GO in the top bar (where the apple icon lives), go to library > Mail > V2
    now here's where things may differ slightly, i lost the body of mails i had moved to my computer (on my mac), plus i'm using Gmail accounts, that being said, inside the mailboxes folder is where the local folders are and Mail decided to create duplicate folders of some of them so i had
    Clients.mbox (with some emails)
    Clients-2.mbox (with the missing ones)
    i then moved the Clients-2.mbox to the desktop, went File > Import (in Mail) then selected Apple mail as the import type, selected the mbox folder on the desktop and imported them into mail at which stage i just moved them back in to the clients folder where they belong.
    i still have an issue where the reply arrow (next to email subjects of replied emails) is linking to completely irrelevant emails, that is not good. unless apple fixes it asap i would recommend moving to another email program as the Mail dev team has not only dropped the ball but stabbed it repeatedly with a blunt rusty object.

  • Hyperlink in the mail body

    I need to put hyperlink in th mail body.I am using the following lines to display the hyperlink........................
    <a href = xyz.com > test </a>
    But the problem is that  instead of displaying the test hyrerlink it is showing me :-
    <a href = _xyz.com_ > test </a>.
    How to fix this problem.

    Here it is
    <a href="www.xyz.com"> test </a>
    that's it.
    Regards,
    IA
    Edited by: Imthiaz Ahmed on Apr 9, 2008 4:55 PM

  • Create hyperlink for reply to in mail body while sending email.

    Hi All,
    We have a requirement where we need to create an hyperlink for reply to in the mail body.
    We have implemented entire functionality using CL_BCS classes and everything is working fine.
    Only problem we have is when we give document type as HTM instead of RAW then entire formatting of mail body gets disturbed although we get the hyperlink.
    Is there any way where we can send the mail in html format using CL_BCS,CL_DOCUMENT_BCS ?
    KR Jaideep,

    Hi ,
    Please find the code below I am using to make the hyperlink. Do I need to fill the entire mail body using HTML Tags ? If yes, then I guess it will increase the complexity of program as the mail content will vary from one mail to another depending upon whether different invoice documents have text maintained in them.
    lwa_text = '<html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '<body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = text-012.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        CONCATENATE '<a href="mailto:'
                    lv_receiver
                    '">'
                    lv_receiver
                    '</a>'
               INTO lwa_text.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        TRY.
            CALL METHOD cl_document_bcs=>create_from_text
              EXPORTING
                i_text         = li_text
                i_documenttype = 'HTM'
                i_subject      = 'Test for hyperlink'
                i_importance   = '1'
                i_sensitivity  = 'P'
              RECEIVING
                result         = lref_document_bcs.
          CATCH cx_document_bcs .
        ENDTRY.

  • How to get the content of message in the mail body

    Hi,
    Can anyone suggest me to get the message content as the mail body using messagetTransformation bean????

    Hi
    In the Receiver Mail Adapter use these settings
    Message Protocol:XIPAYLOAD
    and tick on Use mail package.
    Gt back if you have more doubts
    Thanks

  • Mail Adapter Use Mail Package, Mail Body and Attachment

    Hello
    Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message.
    Thanks for your reply.
    Regards Tom
    The different Weblog , I have check:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

    Hi Thomas,
    If you are configuring your Mail adapter as reciever then refer
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    your sender (say file) should have some message like this
    <i>
    <ml:Mail xmlns:ml=’http://sap.com/xi/XI/Mail/30’>
       <Subject>Important</Subject>
       <From>[email protected]</From>
       <To>[email protected]</To>
       <X_Mailer>Outlook Express </X_Mailer>
       <Content>
       This is the content.
       </Content>
    </ml:Mail></i>
    And for Sender Mail Adpater
    http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    Hope this will be helpful
    Regards
    Suraj

  • Pulling e-mail body for variable in job

    We currently are using the Email Event in TES to pull a single string from an e-mail trigger into a variable in a job.  However, we are now looking to see if we can put multiple strings into an e-mail and use them for multiple variables in a single job.  Is this a possibility, and if so, how should the strings be seperated?  If it is not a possibility, is anyone else pulling in multiple strings from an outside source like email to populate job variables?  We are currently runing ver. 5.3.1.                

    Hi Rachana,
    The problem with this was that, there was some configuration problem with the transaction SCOT.
    When the mail was sent to my client's ID: the E-Mail body looked perfect, but when it was sent to my Company's ID it was distorted.
    Please check, this could be the problem and let me know if you face further issues.
    Thanks & Regards,
    Goutham.

  • How is the e-mail body text determined when e-mail sent from PO in edit mod

    We have an e-mail that is sent to the supplier when the buyer edits the po then goes to header-output - create and send immediately.   We want to remove the SAP default Salutation
    Best Regards,
    Your Purchasing Company
    The problem is we cannot find where this e-mail body is being created.   Any ideas?
    Sandra

    Hello,
    The email body text that you get at SOST is from the cover form BBP_OUTPUT_COVER.
    When you Order a PO, the following is the text is seen in SOST.
    "&LV_TITLE&
    Please find enclosed the purchase order &IV_PO_HEADER-OBJECT_ID& &IV_PO_
    Kind regards,
    Your purchasing company"
    You can create your own cover form in order to substitute the standard BBP_OUTPUT_COVER.
    Regards,
    Ricardo

  • Change font in e-mail body

    Hi All,
    I need to know whether it is possible to use multiple font styles in the body of an e-mail sent through a report program.
    I am using the FM 'SO_DOCUMENT_REPOSITORY_MANAGER' as I want to send a document from the desktop as an e-mail attachment.
    The FM 'SO_DOCUMENT_SEND_API1' does not serve the primary purpose of my requirement. So, it is eliminated.
    Please suggest any method to achieve the requirement of using multiple font styles in e-mail body.
    Thanks,
    Dawood

    If you set the document to be a HTML type, then you can use HTML scripting to set
    the font.
    Create send request
       send_request = cl_bcs=>create_persistent( ).
    Create html content:
        mail_line = '.mail TBODY,{font-family:verdana;font-size:10pt;}'.
        append mail_line TO mail_text.
        ... (your text)
    Create document with type 'HTM' and provide your HTML scripting
          document = cl_document_bcs=>create_document( i_type    = 'HTM'
                                                       i_text    = mail_text
                                                       i_subject = 'Subject' ).
    Add document to send request
          CALL METHOD send_request->set_document( document ).
    Send document
          CALL METHOD send_request->send( ).

  • How to send mail body using RE_CN_RA_INVOICE interface from RECPA520

    Hi ABAP Guru,
    I am using a standard interface RE_CN_RA_INVOICE for tcode RECPA520 for generating pdf form and send the corresponding PDF to  corresponding address maintained in Business Partner.The problem is mail is sending with attachment but there is no mail body.
    Please help

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • Need a way to avoid subject repetition in workflow notification's mail body

    Hi,
    In workflow email, subject gets repeated in mail body too. Couple of queries -
    1. Is it possible to remove the repetition in mail body?
    2. If not outright removal, can we at least decrease the font?
    I got <af:panelHeader text="#{bindings.title.inputValue}" id="ph1"> in jspx page, but how do I restrict it to show title in body only in worklist and not in email. Can anyone share exact code snippet (using rendered/visible property) to be put here?
    Thanks,
    Harsh

    Hi;
    Please refer below notes which could be helpful on your issue:
    How to Create a Custom Notification Message for the Approval/Rejection Registration Process in Oracle iStore using JTF Approval? (Doc ID 1081864.1)
    Custom Email Messages Fail in Workflow (wfmessage) (Doc ID 738894.1)
    Regard
    Helios

  • Issue with embading image in mail body

    hi all,
    I want to embade an image in the mail body which im sending using sap.
    I have also tried to search on forum and I got some help which suggested me to use used html coding, I have tried it but the mail is
    thanks

    Hi.,
    First you have to store image in MIME Repository. , then use HTM  type to send mail .,
    check these : [Send Picture in body of Email|Send an picture to body of an email;
    and  [Send HTML mail with image|Re: Send HTML mail with image;
    hope this helps u.,
    Thanks & regards,
    Kiran

Maybe you are looking for

  • Cannot update free apps on my iphone and ipad - Asking for payment details

    I am not able to update my free apps on iphone and ipad, apps like instagram, the weather channel and Farmville2 arent updating. I've been asked credit card info and charged 1$. Why? Can someone please help me out. I have tried logging off and loggin

  • How to call Jasper Reports from a Servlet?

    hi! i am a newbie in Jasper Reports. Can somebody tell me how i am supposed to let my jasper-created report appear in my web app? i am using JSP/Servlet framework, and basically what i need my app to happen is when i click on my View summary page but

  • Hard Disk Not Exist message is displayed on cq10-400

    Hard Disk Not Exist message is displayed on cq10-400

  • A Uncanny Problem with IDoc Outbound:

    Hi, I meet a problem When outbounding a Z idoc: a field in a segment has no value (While according the trigerred FM logic, should not space):  segment structure: matnr lorvm sprat1 ... vkorg    the data source is from table MVKE. Some times the field

  • HT201269 A question about iTunes backups.

    I have backed up my old iPhone that used Ios 6. Now I have a new iPhone and my question is: Can i restore that new one if it has ios 7? Will it change back to Ios 6 or not??? Thanks!!!