Procedure or Function that send E-mail with image background and file attached

hi
I4d like know if someone there is a procedure or function that send E-mail with image background and file attached, for me.
thanks
Josi Vieira

If you go to this part of OTN you will find the official Oracle UTL_SMTP demo, which includes attachments:
http://technet.oracle.com/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Getting a background is slightly trickier. The UTL_SMTP package is for primarily sending text e-mails, whereas images require HTML e-mail. I suggest you look at the structure of a sample HTML e-mail and see if you can write the necessary HTML strings in the DATA parameter. Otherwise you'll need to investigate handcrafting a program based on the UTL_TCP package.
[rant]
If this seems like a lot of trouble I agree and urge you not to bother. HTML e-mail is one of the curses of the modern age, not least because it is frequently used by purveyors of viruses. I have a filter on my Outlook client that strips out all the HTML in any e-mail I receive, which means I get lots of e-mails rendered unreadable by the inclusion of <HTML> tags. But who cares, they're mostly spam anyway. In fact, the use of HTML in an e-mail is almost always an indicator of the irrelevance of its content.
[rant]
Vibes, APC

Similar Messages

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • What is the best way to send auto mail with excel(generated by query) attachment?

    Hello,
    Need to generate first data from stored procedure and the save it to an excel file and then send mail with the same excel file.
    So am searching for the best way so that i could do all process in a single task with daily or monthly schedule.
    As per my understanding, we could it via SSIS and by sql server using
    sp_send_dbmail.
    But i have to generate excel file first by stored procedure and then end it by mail.
    So please suggest the best way to accomplish all task in a single task.
    Thanks
    Ajay 

    Hi Ajay,
    As shown in the blog mentioned by Syed, to delete records from the Excel file, you need to use Update OpenRowset command to update the corresponding rows to blank.
    Alternatively, you can also use Derived Column Transformation or Conditional Split Transformation after the OLE DB Source so that you can replace the target rows with NULL before exporting to Excel destination or just redirect the expected records to the
    Excel destination.
    Then, in the Control Flow, you can add a Send Mail Task to send the Excel file by setting it as the attachment. The following screenshot is for your reference:
    Regards,
    Mike Yin
    TechNet Community Support

  • Send HTML mail with image

    Hi experts and gurus,
    how can I send an HTML email which is displaying an image in the HTML context (table)?
    I'm using the 'SO_NEW_DOCUMENT_SEND_API1' like below:
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = ls_doc_data
          document_type              = 'HTM'
          put_in_outbox                = 'X'
          commit_work                 = 'X'
        TABLES
          object_content             = gt_mail_body
          receivers                  = gt_receiver .
    I think that might switch to function module 'SO_NEW_DOCUMENT_ATT_SEND_API1', but I have no clue how to set up the PACKING_LIST properly and to incorporate the image into the HTML code afterwards.
    Can anybody help me?
    Regards, Steffen

    Hi,
    I am also trying to send the image in the mail body but the image is not being displayed in the mail.
    I am using cl_bcs class to send the image as the attachment in the mail and the body content but the
    image is not being displayed instead all I can see a box with red cross however, the attached gets open.
    But it is not able to find the image source I guess.
    I am using Lotus notes to check the mail.
    Please help me ......
    I am uploading the image file from desktop into my code then I am attaching it in the mail.
    Please let me know the solution
    The code is as follows :
    REPORT  ztest_mail_544.
    DATA: l_send_request         TYPE REF TO cl_bcs,
            l_document             TYPE REF TO cl_document_bcs,
            l_sender               TYPE REF TO cl_sapuser_bcs,
            l_sub                  TYPE char50,
            l_recipient            TYPE REF TO if_recipient_bcs,
            tl_contents            TYPE STANDARD TABLE OF soli,
            tl_reciev              TYPE STANDARD TABLE OF somlreci1,
            lp_encrypt             TYPE bcsd_encr,
            wa_contents            TYPE solisti1,
            l_doc_len              TYPE so_obj_len,
            l_cnt                  TYPE sy-tabix,
            l_rcv_email            TYPE adr6-smtp_addr,
            l_result               TYPE sy-binpt,
            l_bcs_exception        TYPE REF TO cx_bcs,
            l_subj                 TYPE string,
            l_doc                  TYPE REF TO cl_document_bcs,
            e_result               TYPE sr_state,
            ls_receivers           TYPE somlreci1,
            ll_text                TYPE uname.
    DATA filename TYPE string .
    DATA : it_tab TYPE solix_tab.
    filename = 'C:\Documents and Settings\Desktop\otter.jpg'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = filename
        filetype                      = 'BIN'
      TABLES
        data_tab                      = it_tab
    EXCEPTIONS
       file_open_error               = 1
       file_read_error               = 2
       no_batch                      = 3
       gui_refuse_filetransfer       = 4
       invalid_type                  = 5
       no_authority                  = 6
       unknown_error                 = 7
       bad_data_format               = 8
       header_not_allowed            = 9
       separator_not_allowed         = 10
       header_too_long               = 11
       unknown_dp_error              = 12
       access_denied                 = 13
       dp_out_of_memory              = 14
       disk_full                     = 15
       dp_timeout                    = 16
       OTHERS                        = 17
    wa_contents-line = 'Mail containing pics <br/>'.
    APPEND wa_contents TO tl_contents.
    CLEAR wa_contents.
    wa_contents-line = '<p><img src="otter.jpg" width="304" height="228"></img > </p><br/>'.
    APPEND wa_contents TO tl_contents.
    TRY.
    *-- Create persistent send request
        l_send_request = cl_bcs=>create_persistent( ).
           tl_contents[] = it_mail_body[].
    *-- Get the length of the Document
        DESCRIBE TABLE tl_contents LINES l_cnt.
        READ TABLE tl_contents INTO wa_contents INDEX l_cnt.
        l_doc_len = ( l_cnt - 1 ) * 255 + STRLEN( wa_contents ).
    *-- Subject of the mail
        CLEAR l_sub.
        l_sub = 'test mail for image'.
        l_document = cl_document_bcs=>create_document(
                     i_type       = 'HTM'
                     i_text       = tl_contents
                     i_length     = l_doc_len
                     i_subject    = l_sub
                     i_language   = sy-langu
                     i_importance = '9' ).
    *-- Add document to send request
        CALL METHOD l_send_request->set_document( l_document ).
    *-- Don't send delivery info for successful mails
        CALL METHOD l_send_request->set_status_attributes
          EXPORTING
            i_requested_status = 'E'
            i_status_mail      = 'A'.
    *-- Set sender
        l_sender = cl_sapuser_bcs=>create( 'HR_SUPPORT' ).
        CALL METHOD l_send_request->set_sender
          EXPORTING
            i_sender = l_sender.
        DATA : i_attachment_type    TYPE  soodk-objtp,
               i_attachment_subject TYPE  sood-objdes .
        DATA : t_attachment TYPE STANDARD TABLE OF  solix.
        TRY.
           l_att_type = i_attachment_type.
           l_subject  = i_attachment_subject.
            i_attachment_type = 'jpg'.
            t_attachment[] = it_tab[].
            l_doc = l_document .
            i_attachment_type = space.
            i_attachment_subject = 'otter.jpg'.
            CALL METHOD l_doc->add_attachment
              EXPORTING
                i_attachment_type    = i_attachment_type
                i_attachment_subject = i_attachment_subject
                i_att_content_hex    = t_attachment.
          CATCH cx_document_bcs.
        ENDTRY.
        l_recipient = cl_cam_address_bcs=>create_internet_address('xyz @abc.com' ).
        CALL METHOD l_send_request->add_recipient
          EXPORTING
            i_recipient  = l_recipient
            i_express    = 'X'
            i_copy       = ''
            i_blind_copy = ''.
        IF sy-subrc = 0.
        ENDIF.
        CALL METHOD l_send_request->set_send_immediately( 'X' ).
    *-- Send Email
        CALL METHOD l_send_request->send(
            EXPORTING
              i_with_error_screen = 'X'
            RECEIVING
              result              = l_result ).
        COMMIT WORK.
      CATCH cx_bcs INTO l_bcs_exception.
        write : 'mail not sent '.

  • How send e-mail with XML + PDF and body text

    Hi everyone,
    I have a new requirement but I´m with doubts, how to send an e-mail with two attachements (XML and PDF) and body text using -
    MIME: multipart/mixed;boundary
    I already have code to send XML + body text as you can see below:
    Element contentType = docout.createElement("Content_Type");
      root.appendChild(contentType);
      Text contentTypeText = docout.createTextNode("multipart/mixed;boundary=--AaZz");
      absTraceLog.addDebugMessage("Content_Type e-mail --- "+contentTypeText.toString());
      contentType.appendChild(contentTypeText)
    String text = "----AaZz\r\nContent-Type: text/plain; charset=UTF-8\r\n" +
            "Content-Disposition: inline\r\n\r\n" + nfeText +
            "\r\n----AaZz\r\nContent-Disposition: attachment; filename="+ prefixo +" "+ chaveNFe +".xml" +"\r\n\r\n" + xmlString + "\r\n";
    Element content = docout.createElement("Content");
    root.appendChild(content);
    contentText = docout.createTextNode(text);
    Content.appendChild(contentText);
    The code above work good, but I can´t duplicate any field from XiMail 3.0 - because it´s 0:1.
    So how to do that ?
    Thanks.
    Regards,
    BR.
    Viana.

    Eng,
    That´s works good with mailPackage:
                content= "--" + "--Zz" + CRLF
                        + "Content-Type: text/html; charset=UTF-8" + CRLF
                        + "Content-Disposition: inline" + CRLF + CRLF
                        + textBodyMail + CRLF
                        + "--" + "--Zz" + CRLF
                        + "Content-Type: application/xml; name=" + attachmentName + CRLF
                        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF
                        + "Content-Transfer-Encoding: base64" + CRLF + CRLF
                        + encoder.encode(inputString.getBytes("UTF-8")) + CRLF
                        + "--" + "--Zz" + CRLF
                        + "Content-Type: application/pdf; name=" + pdfName + CRLF
                        + "Content-Disposition: attachment; filename=" + pdfName + CRLF
                        + "Content-Transfer-Encoding: base64" + CRLF + CRLF
                        + encoder.encodeBuffer(new BASE64Decoder().decodeBuffer(pdfAttachment));
    Regards,
    BR.
    Ricardo Viana.

  • Send a mail with a body and attachment

    Hi guys!!!!
    I have a RFC -> XI -> Mail Scenario!
    I'm able to send text in the body of the mail. I'm able to send text as an attachment. But I'd like to send both (text in the body and other text as an attachment). How can I do this?
    thanks in advance
    Julio

    First, I'd like to thank all the replies! And Jagesh, I solved my problem reading the thread you told me.
    I created a message as follow:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
         <Subject>test</Subject>
         <From>test_source @ abc.com</From>
         <To>test_target @ abc.com</To>
         <Content_Type>multipart/mixed; boundary="AaBb--984dfgeSSd3532"</Content_Type>
         <Content>*AaBb984dfgeSSd3532*
    Content-Type: text/plain
    Hello, this is sample data.
    *AaBb984dfgeSSd3532*
    Content-Type: text/plain;name="CSV_data.csv"
    abc
    </Content>
    </ns:Mail>
    In addittion to this, I configured Mail channel as follow:
    Content encondig = none
    Keep Attachments = false

  • Read mails with embedded screenshot and .msg attachment

    Hi Folks,
    Requirement : Fetch emails from an email box and store it in Oracle Database for further processing.
    Issue faced : 1) I am unable to fetch the screenshot embedded in the email. I tried fetching them as an attachment, but when I try to open the attachment its throws an error.
                        2) When an email with .msg attachment is received, the disposition and file name are read as null and hence the attachment is not read.
    I tried searching on net but all that I see is how to send such emails and not fetch one .
    Can any one please guide me through this?
    Thanks
    Rajitha@

    What program is being used to send the messages with attachments?
    If you read the message using (e.g.) Thunderbird and save the attachment, is it correct?
    If possible, use the JavaMail msgshow.java sample program to read the message and save the attachments.  Does that work correctly?
    If none of that helps you figure out the source of the problem, I'm going to need more details to help you debug it.  I'm going to need to see the part of your code that saves the attachment, the debug output when your program reads the message and saves the attachment, and possibly a sample message with attachment that demonstrates the problem.  It's probably easier to send that information to me at [email protected]

  • InDesign Transparency Effects - Problems with Image Quality and File Size

    Hello,
    We are experiencing new problems exporting InDesign files to PDF.
    To summarize, though our largest workflow is to create files for offset printing, we also deliver our work to PDF for mounting on a website so our clients can download directly from the web. Our new problem is Transparency Effects, and creating a PDF that will both have a high quality (or resolution), and be a small file size.
    We are working with multiple page documents (24 to 48 pages), and would very much like to work with InDesign Transparency Effects. However, after spending much time testing a variety of PDF types, we are finding there is a radical difference between quality and file size. I was curious if anyone has had these problems, and if there is a simple answer. InDesign is an incredible program that allows us to design on the fly with Transparency Effects, but, if we are going to experience these problems, we will have to eliminate these wonderful tools.
    Can you help me or lead me to information online that will help.
    Thank you,
    Lain

    Please don't post in multiple forums. Your question has nothing to do with the PDF language and specifications, but rather PDF workflow or InDesign. I've responded to your other posting and am closing this thread.
    - Dov

  • How to create a hyperlink to send e-mail with attachments (INSDESIGN CS6 for DPS)

    Hello,
    I need to create a hyperlink button that sends e-mails having images as attachment. Can you please help?
    Thank you.

    You can create a link that sends an email message (mailto:)
    http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Article s/MailLinks.html#//apple_ref/doc/uid/TP40007892-SW1

  • Looking for function that send mail

    I AM LOOKING FOR A FUNCTION THAT SEND MAIL
    <b><b>WITH ATTACMENT ONLY</b> ANYONE KNOW????
    THANKS.

    REPORT ZMAILOUTPUT
        MESSAGE-ID ZZ.
    *  CONSTANTS                                                           *
    CONSTANTS : C_X(1)      TYPE C VALUE 'X',      " For constant value
                C_OTF(3)    TYPE C VALUE 'OTF',    " For format
                C_U(1)      TYPE C VALUE 'U'.      " Mail Option
    *  VARIABLES                                                           *
    DATA : V_RQIDENT  TYPE TSP01-RQIDENT,  " For Spool Number
           V_RQCLIENT TYPE TSP01-RQCLIENT, " For Client
           V_RQO1NAME TYPE TSP01-RQO1NAME, " For Object name
           V_SPOOL    TYPE TSP01-RQIDENT,  " For Spool Number
           V_SPOOL1   TYPE TSP01-RQIDENT.  " For Spool Number
    *  FLAGS                                                               *
    DATA : F_SPOOL TYPE C.
    *   INTERNAL TABLES                                                    *
    * Internal table for sending mails
    DATA: IT_PDF          LIKE TLINE      OCCURS 10 WITH HEADER LINE,
          IT_XI_PDF       LIKE TLINE      OCCURS 0  WITH HEADER LINE,
          IT_HTML         LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          IT_XI_TEMP      LIKE BAPIQCMIME OCCURS 0  WITH HEADER LINE,
          IT_XI_MIME(255) TYPE C          OCCURS 0  WITH HEADER LINE.
    * For sending mail
    DATA: IT_OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    * Internal table for Single List with Column Length 255
    DATA : IT_OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    * Internal table for Single List with Column Length 255
    DATA : IT_OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    * Internal table for Structure of the API Recipient List
    DATA : IT_RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    * Structure of the API Recipient List
    DATA: X_DOC_CHNG LIKE SODOCCHGI1.
    * Internal table for storing the variants
    DATA : BEGIN OF IT_VARIANT1 OCCURS 0,
            VARIANT LIKE VARID-VARIANT,
           END   OF IT_VARIANT1.
    * Internal table to store variants for the programs
    DATA: IT_VARIANT2 LIKE IT_VARIANT1 OCCURS 0 WITH HEADER LINE.
    * Internal table for storing the selected values
    DATA IT_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
    * Internal table for storing the mail-ids
    DATA : BEGIN OF IT_MAILID OCCURS 0,
            KOKRS LIKE CSKS-KOKRS,
            KOSTL LIKE CSKS-KOSTL,
            DATBI LIKE CSKS-DATBI,
            TELX1 LIKE CSKS-TELX1,
           END   OF IT_MAILID.
    * Internal table for storing the mail-ids
    DATA : IT_MAILID1 LIKE IT_MAILID OCCURS 0 WITH HEADER LINE.
    *   SELECTION SCREEN                                                   *
    DATA : V_CHAR TYPE CHAR50.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_EMAIL FOR V_CHAR  NO INTERVALS
                    LOWER CASE
                    NO-DISPLAY.
    SELECT-OPTIONS: S_EMAIL1 FOR V_CHAR  NO INTERVALS
                    LOWER CASE
                    NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-028.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : P_C1 AS CHECKBOX.
    SELECTION-SCREEN COMMENT 3(66) TEXT-026 FOR FIELD P_C1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS : P_SET LIKE TSP1D-PAPART MATCHCODE OBJECT ZH_TSP1D.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_VARA1 TYPE RS38M-SELSET.
    SELECTION-SCREEN END OF BLOCK A1.
    SELECTION-SCREEN BEGIN OF BLOCK A2 WITH FRAME TITLE TEXT-029.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : P_C2 AS CHECKBOX.
    SELECTION-SCREEN COMMENT 3(56) TEXT-027 FOR FIELD P_C1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS : P_SET1 LIKE TSP1D-PAPART MATCHCODE OBJECT ZH_TSP1D.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_VARA2 TYPE RS38M-SELSET.
    SELECTION-SCREEN END OF BLOCK A2.
    * AT SELECTION SCREEN ON VALUE REQUEST
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARA1.
    * For fetching the variants available for the program
      PERFORM FETCH_VARIANTS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARA2.
    * For fetching the variants available for the program
      PERFORM FETCH_VARIANTS1.
    * AT SELECTION SCREEN
    AT SELECTION-SCREEN.
    * For Validation
      PERFORM VALIDATION.
    *  START OF SELECTION                                                  *
    START-OF-SELECTION.
    * To get the output data and mail
      PERFORM FETCH_DATA.
    *  END OF SELECTION                                                    *
    END-OF-SELECTION.
      IF F_SPOOL = C_X.
        MESSAGE E000 WITH 'Spool Not Generated'(060).
      ENDIF.
    *&      Form  fetch_data
    *       To get the output data and mail
    FORM FETCH_DATA .
    * To send the output to spool
      PERFORM GENERATE_SPOOL.
    ENDFORM.                    " fetch_data
    *&      Form  generate_spool
    *       To send the output to spool
    FORM GENERATE_SPOOL .
      DATA: L_PARAMS LIKE PRI_PARAMS,
            L_DAYS(1)  TYPE N VALUE 2,
            L_COUNT(3) TYPE N VALUE 1,
            L_VALID    TYPE C,
            L_VALID1   TYPE C,
            L_PARAMS1  LIKE PRI_PARAMS.
      DATA: L_DEVICE TYPE USR01-SPLD.
    *Get the printer name for the user
      SELECT SINGLE SPLD INTO L_DEVICE FROM USR01 WHERE BNAME = SY-UNAME.
      IF L_DEVICE IS INITIAL.
        L_DEVICE = 'LOCL'.
      ENDIF.
    * For report-1
      IF P_C1 = 'X'.
    * Setting the print parameters
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            DESTINATION    = L_DEVICE
            COPIES         = L_COUNT
            LIST_NAME      = SY-UNAME
            LIST_TEXT      = 'SUBMIT ... TO SAP-SPOOL'(008)
            RELEASE        = C_X
            NEW_LIST_ID    = C_X
            EXPIRATION     = L_DAYS
    *        LINE_SIZE      = 255
    *        LINE_COUNT     = 65
            LAYOUT         = p_set
            SAP_COVER_PAGE = SPACE
            COVER_PAGE     = SPACE
            RECEIVER       = 'SAP*'(010)
            DEPARTMENT     = 'System'(011)
            NO_DIALOG      = C_X
          IMPORTING
            OUT_PARAMETERS = L_PARAMS
            VALID          = L_VALID.
        IF L_VALID <> SPACE.
          CLEAR V_SPOOL.
    * Fetch the spool number b4 submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL.
    * Submitting the program to spool
          SUBMIT RKAEP000 TO SAP-SPOOL
            USING SELECTION-SET P_VARA1
            SPOOL PARAMETERS L_PARAMS
            WITHOUT SPOOL DYNPRO
            AND RETURN.
          CLEAR V_SPOOL1.
    * Fetch the spool number after submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL1.
          IF V_SPOOL = V_SPOOL1.
            F_SPOOL = C_X.
            IF P_C2 IS INITIAL.
              STOP.
            ENDIF.
          ELSE.
    * Checking the format ( ABAP/OTF)
            PERFORM FORMAT_CHECK TABLES S_EMAIL.
          ENDIF.
        ELSE.
          MESSAGE E000 WITH 'Problem in print settings'(003).
          STOP.
        ENDIF.
      ENDIF.
    * For Report-2
      IF P_C2 = 'X'.
    * Setting the print parameters
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            DESTINATION    = L_DEVICE
            COPIES         = L_COUNT
            LIST_NAME      = SY-UNAME
            LIST_TEXT      = 'SUBMIT ... TO SAP-SPOOL'(008)
            RELEASE        = C_X
            NEW_LIST_ID    = C_X
            EXPIRATION     = L_DAYS
    *        LINE_SIZE      = 200
    *        LINE_COUNT     = 65
            LAYOUT         = p_set1
            SAP_COVER_PAGE = SPACE
            COVER_PAGE     = SPACE
            RECEIVER       = 'SAP*'(010)
            DEPARTMENT     = 'System'(011)
            NO_DIALOG      = C_X
          IMPORTING
            OUT_PARAMETERS = L_PARAMS1
            VALID          = L_VALID1.
        IF L_VALID1 <> SPACE.
          CLEAR V_SPOOL.
    * Fetch the spool number b4 submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL.
    * Submitting the program to spool
          SUBMIT GP3DIEHXY88SNFJ0391V7KF9EK7050 TO SAP-SPOOL
            USING SELECTION-SET P_VARA2
            SPOOL PARAMETERS L_PARAMS1
            WITHOUT SPOOL DYNPRO
            AND RETURN.
          CLEAR V_SPOOL1.
    * Fetch the spool number after submit
          PERFORM FETCH_RECENT_SPOOL USING V_SPOOL1.
          IF V_SPOOL = V_SPOOL1.
            MESSAGE E000 WITH 'Spool Not Generated'(060).
            STOP.
          ENDIF.
    * Checking the format ( ABAP/OTF)
          PERFORM FORMAT_CHECK TABLES S_EMAIL1.
        ELSE.
          MESSAGE E000 WITH 'Problem in print settings'(003).
          STOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " generate_spool
    *&      Form  fetch_recent_spool
    *       Fetch the recent spool number generated
    FORM FETCH_RECENT_SPOOL USING P_V_SPOOL TYPE TSP01-RQIDENT .
      DATA:  L_USER LIKE TSP01-RQ2NAME.
      CLEAR : V_RQIDENT,
              V_RQCLIENT,
              V_RQO1NAME.
      L_USER = SY-UNAME.
    * Get latest Spool No
      SELECT SINGLE RQIDENT
                    RQCLIENT
                    RQO1NAME
             INTO (V_RQIDENT , V_RQCLIENT , V_RQO1NAME)
        FROM TSP01
       WHERE RQCRETIME =   ( SELECT MAX( RQCRETIME )
                                    FROM TSP01
                                   WHERE RQ2NAME EQ L_USER
                                     AND RQFINAL EQ '.' ).
      IF SY-SUBRC = 0 .
        P_V_SPOOL = V_RQIDENT.
      ENDIF.
    ENDFORM.                    " fetch_recent_spool
    *&      Form  format_check
    *       Checking the format ( ABAP/OTF)
    FORM FORMAT_CHECK TABLES P_S_EMAIL STRUCTURE S_EMAIL.
      DATA : L_OBJTYPE    LIKE RSTSTYPE-TYPE.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
        EXPORTING
          AUTHORITY     = 'SP01'(019)
          CLIENT        = V_RQCLIENT
          NAME          = V_RQO1NAME
          PART          = 1
        IMPORTING
          OBJTYPE       = L_OBJTYPE
        EXCEPTIONS
          FB_ERROR      = 1
          FB_RSTS_OTHER = 2
          NO_OBJECT     = 3
          NO_PERMISSION = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF L_OBJTYPE(3) = C_OTF.
    * Convert OTF Spool to PDF
        PERFORM CONVERT_OTF2PDF TABLES P_S_EMAIL.
      ELSE.
    * Convert ABAP Spool to PDF
        PERFORM CONVERT_ABAP2PDF TABLES P_S_EMAIL.
      ENDIF.
    ENDFORM.                    " format_check
    *&      Form  convert_otf2pdf
    *       Convert OTF Spool to PDF
    FORM CONVERT_OTF2PDF TABLES P_P_S_EMAIL STRUCTURE S_EMAIL .
      CLEAR   IT_PDF.
      REFRESH IT_PDF.
      DATA : L_BYTECOUNT  TYPE I.
    * Fn. to get the PDF format
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = V_RQIDENT
          NO_DIALOG                = 'X'
        IMPORTING
          PDF_BYTECOUNT            = L_BYTECOUNT
        TABLES
          PDF                      = IT_PDF
        EXCEPTIONS
          ERR_NO_OTF_SPOOLJOB      = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DSTDEVICE        = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 9
          ERR_BTCJOB_SUBMIT_FAILED = 10
          ERR_BTCJOB_CLOSE_FAILED  = 11.
      IF SY-SUBRC = 0.
    * For page format
        PERFORM PAGE_FORMAT TABLES P_P_S_EMAIL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " convert_otf2pdf
    *&      Form  convert_abap2pdf
    *        Convert ABAP Spool to PDF
    FORM CONVERT_ABAP2PDF TABLES P_P_S_EMAIL STRUCTURE S_EMAIL.
      CLEAR   IT_PDF.
      REFRESH IT_PDF.
      DATA : L_BYTECOUNT  TYPE I.
    * Fn. to convert to PDF format
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = V_RQIDENT
          NO_DIALOG                = 'X'
        IMPORTING
          PDF_BYTECOUNT            = L_BYTECOUNT
        TABLES
          PDF                      = IT_PDF
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 9
          ERR_BTCJOB_SUBMIT_FAILED = 10
          ERR_BTCJOB_CLOSE_FAILED  = 11.
      IF SY-SUBRC = 0.
    * For page formatting
        PERFORM PAGE_FORMAT TABLES P_P_S_EMAIL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " convert_abap2pdf
    *&      Form  send_mail
    *       For sending mail
    FORM SEND_MAIL TABLES MAIL STRUCTURE S_EMAIL .
    * Structures and internal tables for the send data
      DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
            OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
            OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
            OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
            RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE.
      DATA: DOC_CHNG LIKE SODOCCHGI1,
            TAB_LINES LIKE SY-TABIX.
    * Data for the status output after sending
      DATA: SENT_TO_ALL LIKE SONV-FLAG.
      CLEAR: IT_RECLIST, IT_RECLIST[],
             IT_OBJTXT , IT_OBJTXT[],
             IT_OBJPACK, IT_OBJPACK[],
             IT_OBJBIN , IT_OBJBIN[],X_DOC_CHNG.
      LOOP AT IT_HTML.
        OBJBIN-LINE = IT_HTML-LINE.
        APPEND OBJBIN.
        CLEAR OBJBIN.
      ENDLOOP.
    * Create the document which is to be sent
      DOC_CHNG-OBJ_NAME  = 'List'(012).
      DOC_CHNG-OBJ_DESCR = 'Mail'(013).
    * Heading
      OBJTXT-LINE = 'Mail with pdf attachment'(014).
      APPEND OBJTXT.
      CLEAR OBJTXT.
    * Size
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    * Fill the fields of the packing_list for the main document:
      CLEAR OBJPACK-TRANSF_BIN.
    * The document needs no header (head_num = 0)
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
    * Body
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'RAW'(015).
      APPEND OBJPACK.
    * Create the attachment (the list itself)
      DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    * Fill the fields of the packing_list for the attachment:
      OBJPACK-TRANSF_BIN = 'X'.
    * Header
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
    * Body
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'PDF'(016).
      OBJPACK-OBJ_NAME = 'Attachment'(017).
      OBJPACK-OBJ_DESCR = 'Mail with pdf Attachment'(018).
      OBJPACK-DOC_SIZE = TAB_LINES * 255.
      APPEND OBJPACK.
    *-Fill the mail recipient list
      LOOP AT MAIL.
        RECLIST-RECEIVER = MAIL-LOW.
        RECLIST-REC_TYPE = C_U.
        APPEND RECLIST.
        CLEAR: RECLIST,
               MAIL.
      ENDLOOP.
    *-Send the document by calling the SAPoffice API1 module for sending
    *-documents with attachments
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = DOC_CHNG
          PUT_IN_OUTBOX              = C_X
          COMMIT_WORK                = C_X
        IMPORTING
          SENT_TO_ALL                = SENT_TO_ALL
        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.
      CASE SY-SUBRC .
        WHEN 0.
          MESSAGE I000 WITH 'Mail has been sent successfully'(006).
        WHEN OTHERS.
          MESSAGE E000 WITH 'Problem in sending the mail'(023).
      ENDCASE.
    ENDFORM.                    " send_mail
    *&      Form  page_format
    *        For page foramtting
    FORM PAGE_FORMAT TABLES EMAIL STRUCTURE S_EMAIL .
      DATA : L_LINES       TYPE I,
             L_TEMP(500)   TYPE C,
             L_OFFSET      TYPE P,
             L_LINESLEN(2) TYPE P,
             L_MIMELEN(2)  TYPE P,
             L_TABIX       LIKE SY-TABIX.
      CLEAR : IT_XI_PDF,
              IT_XI_TEMP.
      REFRESH : IT_XI_PDF,
                IT_XI_TEMP.
      IT_XI_PDF[] = IT_PDF[].
    * Reformat the line to 255 characters wide (--code from SAP--)
      CLEAR: L_TEMP, L_OFFSET, IT_XI_TEMP.
      DESCRIBE TABLE IT_XI_PDF   LINES  L_LINES.
      DESCRIBE FIELD IT_XI_PDF   LENGTH L_LINESLEN IN CHARACTER MODE.
      DESCRIBE FIELD IT_XI_TEMP  LENGTH L_MIMELEN IN CHARACTER MODE.
      LOOP AT IT_XI_PDF.
        L_TABIX = SY-TABIX.
        MOVE IT_XI_PDF TO L_TEMP+L_OFFSET.
        IF L_TABIX = L_LINES.
          L_LINESLEN = STRLEN( IT_XI_PDF ).
        ENDIF.
        L_OFFSET = L_OFFSET + L_LINESLEN.
        IF L_OFFSET GE L_MIMELEN.
          CLEAR IT_XI_TEMP.
          IT_XI_TEMP = L_TEMP(L_MIMELEN).
          APPEND IT_XI_TEMP.
          SHIFT L_TEMP BY L_MIMELEN PLACES.
          L_OFFSET = L_OFFSET - L_MIMELEN.
        ENDIF.
        IF L_TABIX = L_LINES.
          IF L_OFFSET GT 0.
            CLEAR IT_XI_TEMP.
            IT_XI_TEMP = L_TEMP(L_OFFSET).
            APPEND IT_XI_TEMP.
          ENDIF.
        ENDIF.
      ENDLOOP.
      CLEAR : IT_XI_MIME,
              IT_XI_MIME[].
      LOOP AT IT_XI_TEMP.
        IT_XI_MIME(255) = IT_XI_TEMP-LINE.
        APPEND IT_XI_MIME.
        CLEAR  IT_XI_MIME.
      ENDLOOP.
    * Final Data
      CLEAR : IT_HTML,
              IT_HTML[].
      IT_HTML[] = IT_XI_MIME[].
    * For sending mail
      PERFORM SEND_MAIL TABLES EMAIL.
    ENDFORM.                    " page_format
    *&      Form  fetch_variants
    *       For fetching the variants available for the program
    FORM FETCH_VARIANTS .
      DATA : L_PROGRAM LIKE RS38M-PROGRAMM VALUE 'RKAEP000',
             L_VARA1 TYPE DFIES-FIELDNAME VALUE 'P_VARA1'.
      CLEAR : IT_VARIANT1,
              IT_VARIANT1[].
    * Get variants
      PERFORM GET_VARIANTS TABLES IT_VARIANT1
                           USING L_PROGRAM.
    * F4 Help
      IF NOT IT_VARIANT1[] IS INITIAL.
        PERFORM GET_F4_HELP TABLES IT_VARIANT1
                             USING L_VARA1
                            CHANGING P_VARA1.
      ELSE.
        MESSAGE E000 WITH 'No variants available for report1'(054).
      ENDIF.
    ENDFORM.                    " fetch_variants
    *&      Form  validation
    *       For Validation
    FORM VALIDATION .
      DATA : L_PRO1 LIKE RS38M-PROGRAMM VALUE 'RKAEP000',
             L_PRO2 LIKE RS38M-PROGRAMM VALUE 'GP3DIEHXY88SNFJ0391V7KF9EK7050',
             L_C1,
             L_C2.
    * If both check-box are unchecked
      IF P_C1 IS INITIAL
    AND P_C2 IS INITIAL.
        MESSAGE E000 WITH 'Check any one check-box'(049).
      ENDIF.
    * If checked without varaint
      IF NOT P_C1 IS INITIAL AND P_VARA1 IS INITIAL.
        MESSAGE E000 WITH 'Please give any one of the variant for report1'(055).
      ENDIF.
    * If checked without varaint
      IF NOT P_C2 IS INITIAL AND P_VARA2 IS INITIAL.
        MESSAGE E000 WITH 'Please give any one of the variant for report2'(061).
      ENDIF.
    * Reading the variant and fetching the mail-ids
      IF P_C1 = C_X.
        L_C1 = '1'.
        CLEAR : S_EMAIL,
                S_EMAIL[].
        PERFORM READ_VARIANTS TABLES IT_MAILID
                                     S_EMAIL
                               USING P_VARA1
                                     L_PRO1
                                     L_C1.
        IF S_EMAIL[] IS INITIAL.
          MESSAGE E000 WITH 'No Id available for given Cost report1'(066).
        ELSE.
          SORT S_EMAIL BY LOW.
          DELETE ADJACENT DUPLICATES FROM S_EMAIL COMPARING LOW.
        ENDIF.
      ENDIF.
    * Reading the variant and fetching the mail-ids
      IF P_C2 = C_X.
        CLEAR : S_EMAIL1,
                S_EMAIL1[].
        L_C2 = '2'.
        PERFORM READ_VARIANTS TABLES IT_MAILID1
                                     S_EMAIL1
                               USING P_VARA2
                                     L_PRO2
                                     L_C2.
        IF S_EMAIL1[] IS INITIAL.
          MESSAGE E000 WITH 'No Id available for given Cost report2'(067).
        ELSE.
          SORT S_EMAIL1 BY LOW.
          DELETE ADJACENT DUPLICATES FROM S_EMAIL1 COMPARING LOW.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validation
    *&      Form  GET_VARIANTS
    *       Fetching Variants
    FORM GET_VARIANTS  TABLES   P_IT_VARIANT STRUCTURE IT_VARIANT1
                       USING    P_V_PROGRAM  TYPE RS38M-PROGRAMM.
      SELECT VARIANT
             FROM VARID
             INTO TABLE P_IT_VARIANT
             WHERE REPORT = P_V_PROGRAM.
    ENDFORM.                    " GET_VARIANTS
    *&      Form  GET_F4_HELP
    *       text
    FORM GET_F4_HELP  TABLES   P_IT_VARIANT1 STRUCTURE IT_VARIANT1
                       USING   P_L_VARA1 LIKE DFIES-FIELDNAME
                      CHANGING P_P_VARA LIKE P_VARA1.
    * Fn. for Pop-Up
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = P_L_VARA1
          VALUE_ORG       = 'S'
          DISPLAY         = ' '
        TABLES
          VALUE_TAB       = P_IT_VARIANT1
          RETURN_TAB      = IT_RETURN
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.
      IF SY-SUBRC = 0.
        P_P_VARA = IT_RETURN-FIELDVAL.
      ELSE.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GET_F4_HELP
    *&      Form  FETCH_VARIANTS1
    *       text
    FORM FETCH_VARIANTS1 .
      DATA : V_PROGRAM1 LIKE RS38M-PROGRAMM VALUE 'GP3DIEHXY88SNFJ0391V7KF9EK7050',
             L_VARA2  TYPE DFIES-FIELDNAME VALUE 'P_VARA2'.
      CLEAR : IT_VARIANT2,
              IT_VARIANT2[].
    * Get Variants
      PERFORM GET_VARIANTS TABLES IT_VARIANT2
                           USING V_PROGRAM1.
    * F4 Help
      IF NOT IT_VARIANT2[] IS INITIAL.
        PERFORM GET_F4_HELP TABLES IT_VARIANT2
                            USING  L_VARA2
                          CHANGING P_VARA2.
      ELSE.
        MESSAGE E000 WITH 'No variants available for report2'(050).
      ENDIF.
    ENDFORM.                    " FETCH_VARIANTS1
    *&      Form  read_variants
    *        Reading the variant and fetching the mail-ids
    FORM READ_VARIANTS TABLES P_IT_MAILID STRUCTURE IT_MAILID
                              P_S_EMAIL   STRUCTURE S_EMAIL
                       USING  P_P_VARA1   LIKE P_VARA1
                              P_L_PRO1    LIKE RS38M-PROGRAMM
                              P_L_C1      TYPE C.
      DATA : L_TEMP(44),
             IT_VALUTAB LIKE RSPARAMS OCCURS 0 WITH HEADER LINE.
      RANGES : R_COCEN FOR CSKS-KOSTL.
    * Function Module to get the variant contents
      CALL FUNCTION 'RS_VARIANT_CONTENTS'
        EXPORTING
          REPORT               = P_L_PRO1
          VARIANT              = P_P_VARA1
        TABLES
          VALUTAB              = IT_VALUTAB
        EXCEPTIONS
          VARIANT_NON_EXISTENT = 1
          VARIANT_OBSOLETE     = 2
          OTHERS               = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR : R_COCEN,
              R_COCEN[].
      LOOP AT IT_VALUTAB WHERE SELNAME = 'KOSTL'
                            OR SELNAME = '_C-CCTR'.
    * Getting the range of cost centers
        IF IT_VALUTAB-OPTION = 'BT'.
          R_COCEN-LOW    = IT_VALUTAB-LOW.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-LOW.
          R_COCEN-HIGH   = IT_VALUTAB-HIGH.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-HIGH.
          R_COCEN-OPTION = 'BT'.
          R_COCEN-SIGN   = 'I'.
          APPEND R_COCEN.
          CLEAR  R_COCEN.
        ENDIF.
    * Getting the single cost centers
        IF IT_VALUTAB-OPTION = 'EQ'.
          R_COCEN-LOW    = IT_VALUTAB-LOW.
    * For Conversion Routine
          PERFORM CONVERSION USING R_COCEN-LOW.
          R_COCEN-OPTION = 'EQ'.
          R_COCEN-SIGN   = 'I'.
          APPEND R_COCEN.
          CLEAR  R_COCEN.
        ENDIF.
      ENDLOOP.
    * If no cost centers
      IF NOT R_COCEN[] IS INITIAL.
        SELECT KOKRS
               KOSTL
               DATBI
               TELX1
          FROM CSKS
               INTO TABLE P_IT_MAILID
         WHERE KOSTL IN R_COCEN.
        IF P_IT_MAILID[] IS INITIAL.
          IF P_L_C1 = '1'.
            MESSAGE E000 WITH 'No IDs available for report1'(059).
          ELSEIF P_L_C1 = '2'.
            MESSAGE E000 WITH 'No IDs available for report2'(062).
          ENDIF.
        ENDIF.
    * Deleting the blank entries
        DELETE P_IT_MAILID WHERE TELX1 = SPACE.
        CLEAR L_TEMP.
        READ TABLE P_IT_MAILID INDEX 1.
        L_TEMP = P_IT_MAILID-TELX1.
        DATA : L_CHECK.
        LOOP AT P_IT_MAILID WHERE TELX1 <> L_TEMP.
          L_CHECK = C_X.
        ENDLOOP.
    * For checking the unique ids
        IF L_CHECK = C_X.
          IF P_L_C1 = '1'.
            MESSAGE E000 WITH 'No unique mail-ids for  report1'(058).
          ELSEIF P_L_C1 = '2'.
            MESSAGE E000 WITH 'No unique mail-ids for  report2'(065).
          ENDIF.
        ENDIF.
    * Populating the IDs for the cost centers
        LOOP AT P_IT_MAILID.
          SET LOCALE LANGUAGE SY-LANGU.
          TRANSLATE P_IT_MAILID-TELX1 TO LOWER CASE.
          SET LOCALE LANGUAGE SPACE .
          CONCATENATE P_IT_MAILID-TELX1 '@allergan.com' INTO L_TEMP.
          P_S_EMAIL-LOW = L_TEMP.
          P_S_EMAIL-SIGN = 'I'.
          P_S_EMAIL-OPTION = 'EQ'.
          APPEND P_S_EMAIL.
          CLEAR  P_S_EMAIL.
        ENDLOOP.
      ELSE.
        IF P_L_C1 = '1'.
          MESSAGE E000 WITH 'No Cost Center Available for report1'(057).
        ELSEIF P_L_C1 = '2'.
          MESSAGE E000 WITH 'No Cost Center Available for report2'(063).
        ENDIF.
      ENDIF.
    ENDFORM.                    " read_variants
    *&      Form  CONVERSION
    *       For Conversion Routine
    FORM CONVERSION  USING    P_IT_VALUTAB_LOW TYPE C.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_IT_VALUTAB_LOW
        IMPORTING
          OUTPUT = P_IT_VALUTAB_LOW.
    ENDFORM.                    " CONVERSION
    check this Program......

  • Send PO Mail with PDF File that Chinese character doestn't display

    Send PO Mail with PDF File that Chinese character doestn't display.
    I am using RSTXPDFT4, unicode ECC6.0
    Some computer Adobe Reader can read the file, but some computer cannot read, just a blank page.
    Thanks.

    Hi
    I worked for one client-chinese where we have to print chinese & english ( bilingual).You need to have dricer program which could identify both scripts .You are right ( unicode0
    Please check for the driver program : TWPDF : PDF converter Chinese in SPAD setting.
    SAP note is available.I will check and let you update .
    Edited by: sunny on Oct 28, 2009 10:29 AM

  • Send PO Mail with PDF File that Chinese character doestn't display correctl

    Send PO Mail with PDF File that Chinese character doestn't display !
    I am using RSTXPDFT4 , tried different computer, some Adobe Reader can read
    some are Blank .......
    why ?

    Hi,
    那不是要每一台 PC 如果看不到中文就要更新 ?
    如果用戶不懂, 那就不是永遠看不見 ? 因為那是供應商嗎 !

  • Pl sql procedure required to send a mail with .xlsx attachement

    Hi All,
    we are facing issues with excel files which are generating more than 65000 rows.
    we required plsql procedure which send a mail with .xlsx attachment.
    please provide suggestions & code examples.
    Thanks & Regards,
    Raj

    891875 wrote:
    Hi All,
    we are facing issues with excel files which are generating more than 65000 rows.
    we required plsql procedure which send a mail with .xlsx attachment.
    please provide suggestions & code examples.
    newer versions of Excel do not have 65K row limit!

  • How to send a mail with HTML body from Oracle

    Hi Team,
    Can somebody guide me how to send a mail with HTML body from oracle.
    Here is the piece of code i am trying to send a mail.
    procedure SEND_MAIL is
    cursor c_1 is select * from table_name;
    l_mail_id varchar2(40);
    -- ls_mailhost VARCHAR2(64) := Mailhost;
    ls_from VARCHAR2(64) := ‘[email protected]
    ls_subject VARCHAR2(200);
    ls_to VARCHAR2(64);
    l_mail_conn UTL_SMTP.connection;
    ls_left_menu_name VARCHAR2(64);
    ll_emp_num number(8);
    begin
    for i in c_1 loop
    begin
    l_mail_conn := UTL_SMTP.OPEN_CONNECTION('IP');
    UTL_SMTP.HELO(l_mail_conn, 'IP');
    UTL_SMTP.MAIL(l_mail_conn, LS_FROM);
    UTL_SMTP.RCPT(L_mail_conn, LS_TO);
    UTL_SMTP.DATA(l_mail_conn,'From: ' ||ls_from || utl_tcp.crlf ||
    'To: ' ||ls_to || utl_tcp.crlf ||
    'Subject: ' ||ls_subject|| utl_tcp.crlf);
    UTL_SMTP.QUIT(l_mail_conn);
    exception
    when no_data_found then
    null;
    when others then
    RAISE_APPLICATION_ERROR(-20000, 'Failed to send mail due to the following error: ' || sqlerrm);
    end;
    end loop;
    end;
    Thnx

    Hi Nicolas!
    Have you tried to set "Output Format" for "RAW Text" to HTM in SCOT.
    If HTM is missing in your dropdown-list, you could check out table SXCONVERT2. Copy the line with category T/format TXT, and change the format from TXT to HTM. The existing function
    SX_OBJECT_CONVERT__T.TXT does not need to be changed. Now you should be able to choose HTM in SCOT. You will probably need som HTML-tags in your text to make it look good.
    Hope this helps!
    Regards
    Geir

  • Send External mail with Attchment from SAP

    Hi All,
    OUR REQUIREMENT: We need to send EXTERNAL MAIL with ATTACHMENT(Excel) form SAP .
    We have developed a function module which converts the internal table data into Excel Format and sends it as an attachment to External Mail.
    ISSUE : But our issue is we are unable to open that document using GOOGLE DOCS Could any one help me how to do this.
    it was thriughing error like
    Error log is .
    ''Sorry, we are unable to generate a view of the document at this time. Please try again later.
    You can also try to download the original document by clicking here. Alternatively, you can view the plain HTML (automatically redirecting).
    Regards
    Venkat .
    Edited by: venkata pradeep on Mar 5, 2012 10:26 AM
    Edited by: venkata pradeep on Mar 5, 2012 10:28 AM

    Is the excel file recognized by MS Excel? If not, then issue is you have wrongly converted your attachment and/or your FM to create an excel file was wrongly coded or you have passed it wrongly to your mail code.
    If you consider an OOP approach in sending external mail, refer to this link:
    http://wiki.sdn.sap.com/wiki/display/Snippets/SendingmailwithattachmentusingObjectOriented+Approach

Maybe you are looking for

  • Multiple iPods, multiple libraries, once instance of iTunes.

    I have 3 iPods, a 30g, 60g,and 18g iTouch. I have one pc with one instance of itunes. I have an external drive which holds the libraries for the larger ipods, but I keep the itouch library on my local drive. I want to be able to have iTunes show the

  • Can I BAM with NW BPM?

    Hi community. I was trying to answer the question: how does the NW BPM platform feature BAM (business active monitoring) and could not find any direct answer. I have read on PI capabilities of creating monitoring process that are fed by event message

  • Less or less than equal in the for loop condition

    Hi, What do you prefer, what is more common, which one is more easily readable, less or less than equal in the for loop condition? for (int i = 0; i < arr.lenght; i++){..} //or for (int i = 0; i <= arr.lenght - 1 ; i++){..}I know this is basic progra

  • Facetime Audio Difficulty

    I was using facetime once on my macbook pro and used headphones during it. Before this I had no audio problems at all. Now whenever I use facetime on my macbook pro I need to use headphones or I cannot hear the people I am talking to and they cannot

  • APPCRASH on Vista w/ Version 5.0.1.18 .... Without Syncing

    I have read the post that Desktop is crashing when syncing. Mine is crashing on startup on Vista without syncing. What's going on with all these crashes on Vista? Thanks for your help  Solved! Go to Solution.