Text in the email body is going as attachment through email activity

hi ,
In my bpel email activity the body part is going as an attachment. Even a text like 'hi' also going as an attachment where i need to download the file and need to read the content.
Can any one help is in solving this issue.
Thank you
Gayaz

hi Jyotirmoy,
this is the format i am using
<scope name="Email_1">
<bpelx:annotation>
<bpelx:pattern patternName="bpelx:email"></bpelx:pattern>
</bpelx:annotation>
<variables>
<variable name="varNotificationReq"
messageType="ns3:EmailNotificationRequest"/>
<variable name="varNotificationResponse"
messageType="ns3:ArrayOfResponse"/>
<variable name="NotificationServiceFaultVariable"
messageType="ns3:NotificationServiceErrorMessage"/>
</variables>
<sequence name="Sequence_2">
<assign name="EmailParamsAssign">
<copy>
<from expression="string('Default')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:FromAccountName"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Bcc"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Cc"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:ReplyToAddress"/>
</copy>
<copy>
<from expression="concat(concat(concat('RLMS ',bpws:getVariableData('inputVariable','payload','/client:AarlmsDailyWeeklySubscriptionProcessRequest/client:input')),' Subscription Alert: Uploaded and modified files for folder'), bpws:getVariableData('folderPath'))"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Subject"/>
</copy>
<copy>
<from expression="bpws:getVariableData('emailIds')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:To"/>
</copy>
<copy>
<from>
<Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
<MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/mixed</MimeType>
<ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
<MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
<BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
<MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
<ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
<BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
</BodyPart>
</MultiPart>
</ContentBody>
</Content>
</from>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content"/>
</copy>
<copy>
<from expression="string('text/html; charset=UTF-8')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content/ns3:ContentBody/ns3:MultiPart/ns3:BodyPart[1]/ns3:MimeType"/>
</copy>
<copy>
<from expression="string('NotificationAttachment1.html')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content/ns3:ContentBody/ns3:MultiPart/ns3:BodyPart[1]/ns3:BodyPartName"/>
</copy>
<copy>
<from expression="string('hi')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns3:Content/ns3:ContentBody/ns3:MultiPart/ns3:BodyPart[1]/ns3:ContentBody"/>
</copy>
</assign>
<invoke name="InvokeNotificationService" partnerLink="NotificationService"
portType="ns3:NotificationService"
operation="sendEmailNotification"
inputVariable="varNotificationReq"
outputVariable="varNotificationResponse"/>
</sequence>
</scope>
Thank you
Gayaz

Similar Messages

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • Convert spool to xls and send the attachment through email

    Hello,
    I have a requirement to convert spool to xls and then send the xls as an attachment through email,how sould i go about it,which fm can i use please advice..
    Thanks.

    Please check the links
    Re: Spool to XLS
    Re: converting spool data to xls file format.
    Regards
    Satish Boguda

  • Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Sending smartform as PDF attachment through email

    Hi,
    I have used the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the smartform as PDF attachment through email.In SOST transaction I can see that the mail has been sent to the reciepient,but the mail is not going to the mail box.What would be the reason for this?
    Regards,
    Hema

    That should be the basis issue. They needs to do some settings. Please ask them to do so.
    Pranav

  • How do I send an attachment through email

    How can I send an attachment through email.

    This is not a firefox problem, but see analytical information in this link:
    [http://www.ehow.com/how_4942_send-e-mail.html How to Send an E-mail Attachment]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • How do you send a attachment through email on iPad 2

    How do you send a attachment through email using iPad 2

    How to Attach Photos and Videos to Emails on an iPhone or  iPad
    http://www.wikihow.com/Attach-Photos-and-Videos-to-Emails-on-an-iPhone-or-iPad
    iPad Basics: Sending an Email With An Attachment
    http://ipadacademy.com/2012/03/ipad-basics-sending-an-email-with-an-attachment
    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
    How to Send Multiple email Attachments from your iPad or iPhone
    http://ipadacademy.com/2014/03/how-to-send-multiple-email-attachments-from-your- ipad-or-iphone
     Cheers, Tom

  • TS3276 Hi.  Just started using Mac Mail on a macbookpro v10.6.8.  I tried to send a message with two excel (for mac) files attached.  One attached as a file, one inserted all the text into the message body.  Help?

    Just started using my Mac Mail program instead of web mail.  When I went to attach two pdf files, one attached as a file, the other inserted all the text into the body of the email message.  How do I get it to attach both pdf's as files?

    I think you're confusing two different things. If you attached PDF files and one of them displayed the PDF icon in the message window, that means it was more than one page. If you saw what appeared to be the actual document for the other PDF file, that means it's only one page and it's normal for it to display that way.
    However, I seem to recall there may (or should) be a button at the bottom-right of the message window that allows you to display those files as icons, even if they're one page. If not, there's a third-party addition you can use to add that feature:
    http://lokiware.info/Attachment-Tamer

  • Smart Form not going as attachment with Email

    Hi,
    I am configuring actions for support message and email has to be automatically sent to a particular partner based on status of support message.
    I am using standard actions and standard smart forms.
    The email is also going but without attachment.The mail body is also blank. The subject appears as the name of smart form
    When I preview from Actions in transaction, I am able to view the complete smartform.
    Is there any settings I have missed out.
    In SCOT we have configured SAP Script/ Smart Forms as PDF.
    Useful answers will be rewarded.
    Regards,
    J.Prabananth

    Hi
    Check for the Processing Type
    Form name : CRM_REMINDER_MAIL_01
    Processing class : CL_SAMPLE_PROCESSING_CLASS_PPF
    Processing Method : COPY_1_OF_EXEC_SMART_FORM
    Archive mode : Mail only
    Regards
    Raj
    Please reward if helps!

  • UTL_SMTP writing to email body after writing to attachment doesn't work

    Read in contents of files and Write text to email body if size is < 10k , otherwise to an attachment. Problem is after writing to an attachment we can't get it to switch to write the next file contents to the message body.
    Example; we have 6 files in the table array. The first two files are less than 10k in size so the text from these files get written to the mail body. The third file size is 12k so the text gets written to an attachment. The 4th file is 2k but instead of being written to the email message body it gets appended to the previous attachment. All subsequent files of size < than 10k get appended to the attachment.

    Sounds like you've written some custom code and it has a bug in it. How about you post a SMALL (yet complete) example that can be run by anyone with an Oracle database (the same version as you, which you've not told us and should). From there you should get lots of help.
    To get your version
    select *
    from v$version;

  • BI Publisher how to make email body not be a attachment (message.txt)

    I am using Oracle Business Intelligence Publisher Release 10.1.3.4 Part Number E12602-01 with OBIEE 10g. When I schedule a BI pub PDF report send via email, my text in "BODY" text area shows up as an attachment (message.txt) not in the email body. How can I solve this. We don't need bursting.
    Thanks in advance!

    jordansydney wrote:
    I have literally tried everything! read all the forums! I need an actual solution!
    If everything has been tried, there is nothing more to try.  Just give up. 
    Or Troubleshooting FaceTime and iMessage activation issues

  • Creating email body  while generating output type as email.

    Hi All,
        I wanna create an email body while sending email through output type for smartform.
        I am successfully creating a mail with attachement. But requirement ned to send a body with same email..
        can any one know the same pls share. its very urgent... thx
    Thanks..

    Hello,
    declare the following
    data :
    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    in the program write the below cod as following
    i_objtxt = 'Find attached the output of the smart form.'. --> this is the body of the mail.
    APPEND i_objtxt.
    now pass this to the call function.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = w_doc_chng
            put_in_outbox              = 'X'
          IMPORTING
            sent_to_all                = v_sent_all
          TABLES
            packing_list               = i_objpack ......
    This shall trigger the body.

  • Is it possible to send the Pdf format of WebI linking report through email?

    Hi All,
    I have created linking between 2 WebI reports through OpenDocument. I can schedule the parent report and send it to User Email as PDF format, But when the user click the link in parent report its not opening the PDF format of child report after passing the parameter from Parent report. It throws following error.
    Is it possible to send the linked reports(without breaking the functionality of passing the parameter to Child report) to user who don't have access to BO environment? Please help me out.
    User needs to get the Parent PDF report in email, once they click the link it should pass the parameter to child report and the corresponding child report should open in PDF format. (In Infoview "View Mode" i can able to achieve this, how about in Email?).
    Thanks and Regards,
    Tharini Prabhu

    So to achieve my requirement, according to my understanding I have to do the following steps.
    Please correct me if I am wrong.
    1.     Without BO credentials the user can’t able to access the Link and child report created using OpenDoc.
    2. To overcome this I have to create one reserved userid through Admin and assign to all set of Users who will use the Reports.
    3. Have to use Single Sign on function through SDK to avoid the popping window for entering credentials right ?
    I can’t able to find the Sap Note 1326701 in http://www.sapossnotes.com/
    Could you please provide me the details how to implement that?

  • To send TXT file as an attachment  through Email

    Hi Experts,
    I am working on requirement where i have to send a txt file as an attachment.
    Could any one suggest me a solution.
    Thanks and Regards,
    Jeswanth Kadali

    Hi,
    Use the function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    We find it convenient to use a custom function module as a wrapper for that.
    Here's the code.
    FUNCTION Z_EMAILS_ATTACH.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(EMAIL_SUBJECT) LIKE  SODOCCHGI1-OBJ_DESCR
    *"     VALUE(ATTACHMENT_SUBJECT) LIKE  SOPCKLSTI1-OBJ_DESCR OPTIONAL
    *"     VALUE(ATTACHMENT_DOC_TYPE) TYPE  SO_OBJ_TP OPTIONAL
    *"     REFERENCE(ATTACHMENT_HEADER) LIKE  SOLISTI1 STRUCTURE  SOLISTI1
    *"  TABLES
    *"      EMAIL_BODY STRUCTURE  SOLISTI1
    *"      EMAIL_ATTACHMENT STRUCTURE  SOLISTI1 OPTIONAL
    *"      RECEIVERS STRUCTURE  SOMLRECI1
    *"  EXCEPTIONS
    *"      UNKNOWN_COMMUNICATION_TYPE
    *"      ERROR_SENDING_MAIL
    *"      EMPTY_ATTACHMENT
    *"      NO_ATTACHMENT_SUBJECT
    *"      USER_HAS_NO_EMAIL_ADDRESS
    *"      NO_RECEIVERS
    NOTE
    Single-testing when the tables passed to the function have reference
    structure SOLISTI1 meets with a problem.
    Entering non-blank rows into these tables is impossible, it seems.
    This is believed to be because the single testing fails to cope with
    the width of SOLISTI1-LINE [255 char].
    For single testing, use CVDTLINE as the reference structure - it's
    only 132 char.  Then remember to change it back to SOLISTI1...
    Based on Z_EMAIL_ATTACH which sends just one mail.
    08.06.2007  JNM
    DATA: document LIKE sodocchgi1.
    DATA: packlist LIKE sopcklsti1     OCCURS 0 WITH HEADER LINE.
    DATA: contents LIKE solisti1       OCCURS 0 WITH HEADER LINE.
    DATA: header   LIKE solisti1       OCCURS 0 WITH HEADER LINE.
    DATA: RECVLIST LIKE SOMLRECI1      OCCURS 0 WITH HEADER LINE.
    DATA: NEXT_ROW LIKE SY-TABIX.
    DATA: lines    LIKE sy-tabix.
    DATA: LAST_LINE_LENGTH TYPE I.
    DATA: d_doc_size LIKE packlist-doc_size.
    data: email_address type ad_smtpadr.
    A user without an email address cannot email.
    CALL FUNCTION 'Z_USER_EMAIL_ADDRESS'
      EXPORTING
        USER_NAME              = SY-UNAME
      IMPORTING
        EMAIL_ADDRESS          = email_address
      EXCEPTIONS
        UNKNOWN_USER           = 1
        NO_ADDRESS_KEY         = 2
        NO_ADDRESS_DATA        = 3
        NO_EMAIL_ADDRESS       = 4
        OTHERS                 = 5.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
              raising USER_HAS_NO_EMAIL_ADDRESS.
      ENDIF.
    Receivers?
    describe table receivers lines lines.
    if lines eq 0.
      raise no_receivers.
      endif.
    initialization
    CLEAR: CONTENTS, DOCUMENT, HEADER, PACKLIST, RECVLIST.
    REFRESH: CONTENTS, HEADER, PACKLIST, RECVLIST.
    attachment?
    DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
    IF LINES EQ 0 AND ATTACHMENT_SUBJECT CN SPACE.
      RAISE EMPTY_ATTACHMENT.
      ENDIF.
    IF LINES NE 0 AND ATTACHMENT_SUBJECT CO SPACE.
      RAISE NO_ATTACHMENT_SUBJECT.
      ENDIF.
    email body
    concatenate 'SAP client:'
      sy-host sy-sysid sy-mandt
      into contents separated by space.
    append contents.
    clear contents.
    append contents.
    APPEND LINES OF EMAIL_BODY TO CONTENTS.
    header - row for body
    HEADER = 'BODY HEADER'.
    APPEND HEADER.
    packing list - row for body
    PACKLIST-TRANSF_BIN = SPACE.
    PACKLIST-HEAD_START = 1.
    PACKLIST-HEAD_NUM = 1.
    PACKLIST-BODY_START = 1.
    DESCRIBE TABLE CONTENTS LINES PACKLIST-BODY_NUM.
    NEXT_ROW = 1 + PACKLIST-BODY_NUM.
    *packlist-doc_type = 'EXT'.
    PACKLIST-DOC_TYPE = 'RAW'.
    APPEND PACKLIST.
    IF ATTACHMENT_SUBJECT CN SPACE. " if there's an attachment
    attachment into contents
      APPEND LINES OF EMAIL_ATTACHMENT TO CONTENTS.
      DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
      READ TABLE EMAIL_ATTACHMENT INDEX LINES.
      LAST_LINE_LENGTH = STRLEN( EMAIL_ATTACHMENT ).
    header - attachment
      if attachment_header is initial.
        HEADER = 'ATTACH'.
      else.
        header = attachment_header.
        endif.
      APPEND HEADER.
    packing list - row for attachment
      CLEAR PACKLIST.
      case attachment_doc_type.
       when 'XLS'.
         PACKLIST-TRANSF_BIN = 'X'.
        when others.
          PACKLIST-TRANSF_BIN = SPACE.
        endcase.
      PACKLIST-HEAD_START = 2.
      PACKLIST-HEAD_NUM   = 1.
      PACKLIST-BODY_START = NEXT_ROW.
      if not attachment_doc_type is initial.
        packlist-doc_type   = attachment_doc_type.
      else.
        PACKLIST-DOC_TYPE   = 'RAW'.
        endif.
    packlist-doc_type   = 'EXT'.
      PACKLIST-OBJ_DESCR  = ATTACHMENT_SUBJECT.
      PACKLIST-OBJ_NAME   = 'ATTACHMENT'.
      PACKLIST-BODY_NUM   = LINES.
      D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
      PACKLIST-DOC_SIZE   = D_DOC_SIZE.
      APPEND PACKLIST.
      ENDIF. "attachment
    document
    document-obj_name = 'EMAIL'.
    DOCUMENT-OBJ_DESCR = EMAIL_SUBJECT.
    document-obj_langu = sy-langu.
    document-obj_expdat = sy-datum.
    document-sensitivty = 'F'.
    document-obj_prio = 9.
    document-no_change = 'X'.
    document-priority = 9.
    document-expiry_dat = sy-datum.
    ADD 1 TO: DOCUMENT-OBJ_EXPDAT, DOCUMENT-EXPIRY_DAT.
    DESCRIBE TABLE contents LINES lines.
    D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
    document-doc_size = d_doc_size.
    call the mail function
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = document
            put_in_outbox              = 'X'
              commit_work                = 'X'
         TABLES
              object_header              = header
              packing_list               = packlist
              contents_txt               = contents
              receivers                  = 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.
      RAISE ERROR_SENDING_MAIL.
      ENDIF.
    ENDFUNCTION.
    Also remember that the SAP user sending the email must have an email address in the user details, so that SAP has something to put in the "From" field when creating the email.
    That's why we use this:
    FUNCTION Z_USER_EMAIL_ADDRESS.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(USER_NAME) TYPE  SYUNAME DEFAULT SY-UNAME
    *"  EXPORTING
    *"     REFERENCE(EMAIL_ADDRESS) TYPE  AD_SMTPADR
    *"  EXCEPTIONS
    *"      UNKNOWN_USER
    *"      NO_ADDRESS_KEY
    *"      NO_ADDRESS_DATA
    *"      NO_EMAIL_ADDRESS
    tables:
      adr6,
      usr21,
      usr02.
    SAP logon data
    select single *
      from usr02
      where bname = user_name.
    if sy-subrc ne 0.
      message i017(ZREP) with
        'SAP user' user_name 'is unknown'
        raising unknown_user.
      endif.
    SAP user address key
    select single *
      from usr21
      where bname = user_name.
    if sy-subrc ne 0.
      message i017(ZREP) with
        'No address data assigned to SAP user' user_name
        raising no_address_key.
      endif.
    SAP user address
    select single *
      from adr6
      where addrnumber = usr21-addrnumber and
            persnumber = usr21-persnumber.
    if sy-subrc ne 0.
      message i017(ZREP) with
        'No address data found for SAP user' user_name
        raising no_address_data.
      endif.
    email_address = adr6-smtp_addr.
    if email_address is initial.
      message i017(ZREP) with
        'No address data found for SAP user' user_name
        raising no_email_address.
      endif.
    ENDFUNCTION.
    John

  • How to send zip file as attachment through email

    Hi All,
    I am having a requirement that I need to download the internal table data into .txt file and I need to zip the text file. And this zip files needs to send to the customer through email.
    I am able download the data into .txt and able to zip the file. But I am not able send the .zip file through email.
    I know that we can send .xls, .txt, .csv and also .ppt, .doc file types we can send as an attachement through abap program. But I don't know about .zip files. Is there any possibilty to send .zip file as an attachment thorugh email.
    Can any one help me how to send a .zip file thorugh email as an attachment. 
    Regards,
    vinod

    hi Vinod,
    Can you please tell me how you have zipped the file.
    I am having a text file in application server. I need to zip that file. Then the middleware moves it to Legacy system.
    I used the following code. With this I am having the data in Binary format which my midleware cannot understand.
    What I need on the whole is just to reduce the size of the file.
    form ZIP_FILE .
    DATA: lt_data TYPE TABLE OF x255,
          lt_textdata TYPE TABLE OF x255.
    DATA: ls_data LIKE LINE OF lt_data.
    DATA: lv_dsn1(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEX.TXT'.
    DATA: lv_dsn3(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEXZIP.zip'.
    *DATA: lv_dsn3(100) VALUE '/interfaces/SM5/test.zip'. " Contains sample1.xls and sample2.xls
    DATA: lv_file_length TYPE i.
    DATA: lv_content TYPE xstring.
    DATA: lo_zip TYPE REF TO cl_abap_zip.
    CREATE OBJECT lo_zip.
    Read the data as a string
    clear lv_content .
    OPEN DATASET lv_dsn1 FOR INPUT IN BINARY MODE.
    READ DATASET lv_dsn1 INTO lv_content .
    CLOSE DATASET lv_dsn1.
    lo_zip->add( name = 'sample.TXT' content = lv_content ).
    lv_content = lo_zip->save( ).
    *clear lv_content .
    Conver the xstring content to binary
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = lv_content
    IMPORTING
    output_length = lv_file_length
    TABLES
    binary_tab = lt_data.
    OPEN DATASET lv_dsn3 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT lt_textdata INTO ls_data.
    TRANSFER ls_data TO lv_dsn3.
    ENDLOOP.
    CLOSE DATASET lv_dsn3.
    IF sy-subrc EQ '0'.
        MESSAGE s999(zfi_ap_gl) WITH text-t10.
      ENDIF.
    Can you please help.
    Thanks Aravind

Maybe you are looking for

  • Limitation on principal name length due to propagation?

    Is there a limitation on the java.security.Principal name length due to the underlying implementation of the security context propagation, even though it is a java.lang.String? Thanks, Guillaume Bedard

  • Not able to Create TABLESPACE PSAPROLL|PSAPUNDO    with 728 MB

    Hi Experts,                When i an trying to upgrade PI 7.0 to pi 7.1 with EHP1 in checks roadmap in abap it throws error like ERROR> Insufficient free space in the database as follows: Create TABLESPACE PSAPROLL|PSAPUNDO    with 728 MB INFO> To ad

  • Nokia lumia 610 ringtone,and bluetooth file transf...

    i have nokia 610 and i have donwloaded a ringtone from marketplace i mean song and i want to set it as my ringtone  what should i do in order to set that song as my ringing tone pls tell and more thing if i want to send any file to other mobile do i

  • Business Context Tab

    Hi, In business context tab I am getting service contracts attached to my transaction. I dont want to have service contracts in the business context tab. I just want business activites and attachments in business context tab. Please let me know how c

  • F4 help disable

    hi experts, i have a created a zreport alv. i have use selection screen  lips-vgbel.report is OK  but  selection screen vgbel show the f4 help can i disable this output help.. thanks in advance kamal Moderator Message: Duplicate post locked Edited by