Sending PDF with a certain character type

Hi all,
1. After getting the print parameters with the function u2018GET_PRINT_PARAMETERS'
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = 'N006'
*LINE_SIZE = 080
line_count     = 65
IMMEDIATELY = ' '
NO_DIALOG = 'X'
IMPORTING
OUT_PARAMETERS = PARAMS
VALID = VALID.
2. NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG NO-TITLE NO-HEADING.
3. Make a PDF for a certain spool with the function 'CONVERT_ABAPSPOOLJOB_2_PDF'
4. And at last sending the pdf with  thefunction SO_DOCUMENT_SEND_API1'
The users receive wel the pdf, but they want another character type (bigger one) , how can I build this ?
Thanks

No solution

Similar Messages

  • Problem sending .pdf with email in ECC 6.0

    hi there,
    we are upgrading from r/3 4.6.c to ECC 6.0.
    i have the following problem: in many z-ababs we convert spool-files to pdf-files and send them with function SO_NEW_DOCUMENT_ATT_SEND_API1 via email.
    well, this is working okay, BUT: the ending '.pdf' is missing in the filename:
    in R/3 4.6.c it looks like the following:
    zfl_reporting.pdf
    Now it looks like this:
    zfl_reporting
    So the file is not recognized as pdf-file. You have to add a .pdf manually to open it.
    We can't do this as we send the pdf-files thousands of times to our customers.
    Any ideas ?
    reg, Martin

    hi
    Posted below is the sample code..
    find the bolded ones...
    REPORT ZMAIL_PDF NO STANDARD PAGE HEADING.
    Data for mailing purpose
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: OBJBIN  LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: OBJTXT  LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG  LIKE SODOCCHGI1.
    DATA: TAB_LINES LIKE SY-TABIX.
    Spool table
    TABLES : TSP01.
    Data required for creating spool
    DATA: MSTR_PRINT_PARMS LIKE PRI_PARAMS VALUE 'LP01',
          MC_VALID(1),
          MI_BYTECOUNT TYPE I,
          MI_LENGTH    TYPE I,
          MI_RQIDENT   LIKE TSP01-RQIDENT,
          REP          LIKE PRI_PARAMS-PLIST.
    Internal table for capturing data into PDF format
    DATA: MTAB_PDF LIKE TLINE OCCURS 0 WITH HEADER LINE.
    File name
    DATA : MC_FILENAME LIKE RLGRAP-FILENAME.
    SELECTION SCREEN
    PARAMETERS : P_REPID LIKE SY-REPID,
                 P_LINSZ LIKE SY-LINSZ DEFAULT 132,
                 P_PAART LIKE SY-PAART DEFAULT 'X_65_132'.
    START-OF-SELECTION.
    <b>  CONCATENATE 'C:\'
                   P_REPID
                  '.PDF'
             INTO  MC_FILENAME.</b>
      MOVE SY-REPID TO REP.
    Get print parameters
      PERFORM GET_PRINT_PARAMS.
    Send output of the required program to Spool
      SUBMIT (P_REPID) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                          SPOOL PARAMETERS MSTR_PRINT_PARMS
                          VIA SELECTION-SCREEN AND RETURN.
    Get the the spool number that is just created
      PERFORM GET_SPOOL_NUMBER USING    SY-REPID SY-UNAME
                               CHANGING MI_RQIDENT.
    Convert Spool to PDF & download the same
      PERFORM SPOOL_2_PDF.
    Upload downloaded PDF file for mailing
      PERFORM UPLOAD_PDF_FILE.
    Send mail with PDF attachment
      PERFORM SEND_MAIL.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    form get_spool_number using    f_repid
                                   f_uname
                          changing f_rqident.
      data:
        lc_rq2name like tsp01-rq2name.
      concatenate f_repid
                  f_uname
             into lc_rq2name separated by '_'.
      select * from tsp01 where  rq2name = sy-repid
        order by rqcretime descending.
        f_rqident = tsp01-rqident.
        exit.
      endselect.
      if sy-subrc ne 0.
        clear f_rqident.
      endif.
    endform." get_spool_number
    *&      Form  send_mail
          text
    -->  p1        text
    <--  p2        text
    form send_mail.
    Creation of the document to be sent
      DOC_CHNG-OBJ_NAME = 'TEST'.
      DOC_CHNG-OBJ_DESCR = 'TEST MAIL WITH PDF ATTACHMENT'. "mail subject
      OBJTXT = 'Test mail with PDF attachment'.
      APPEND OBJTXT.
      CLEAR OBJTXT.
      APPEND OBJTXT.
      APPEND OBJTXT.
      OBJTXT = 'Please double click the attachment to verify'.
      APPEND OBJTXT.
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    Creation of the entry for the compressed document
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM   = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM   = TAB_LINES.
      OBJPACK-DOC_TYPE   = 'RAW'.
      APPEND OBJPACK.
      DESCRIBE TABLE OBJBIN LINES TAB_LINES.
      OBJHEAD = 'Sample PDF attachement'. "
      APPEND OBJHEAD.
    Creation of the entry for the compressed attachment
      OBJPACK-TRANSF_BIN = 'X'.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM   = 1.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM   = TAB_LINES.
    <b>  OBJPACK-DOC_TYPE   = 'PDF'.</b>
      OBJPACK-OBJ_NAME   = 'TEST'.
      OBJPACK-OBJ_DESCR  = 'Test.PDF'.
      OBJPACK-DOC_SIZE   = TAB_LINES * 255.
      APPEND OBJPACK.
    Completing the recipient list
    For sending mail to Internet Address
      RECLIST-RECEIVER = '[email protected].
      RECLIST-REC_TYPE = 'U'.
      APPEND RECLIST.
    Sending the document
           CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
                EXPORTING
                     DOCUMENT_DATA = DOC_CHNG
                     PUT_IN_OUTBOX = '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.
          CASE SY-SUBRC.
            WHEN 0.
              WRITE  :/ 'MAIL SENT....'.
            WHEN 1.
              WRITE  :/ 'TOO MANY RECEIVERS'.
            WHEN 2.
              WRITE  :/ 'DOCUMENT NOT SENT'.
            WHEN 4.
              WRITE  :/ 'NO SEND AUTHORIZATION'.
            WHEN OTHERS.
              WRITE  :/ 'ERROR OCCURED WHILE SENDING MAIL'.
          ENDCASE.
    endform.                    " send_mail
    *&      Form  GET_PRINT_PARAMS
    FORM GET_PRINT_PARAMS.
      call function 'GET_PRINT_PARAMETERS'
      exporting destination           = 'LP01'
                copies                = 1
                list_name             = rep
                list_text             = 'LIST ..... TO SAP-SPOOL'
                immediately           = 'X'
                release               = 'X'
                new_list_id           = 'X'
                expiration            = 1
                line_size             = 132
                line_count            = 65
                layout                = 'X_PAPER'
                sap_cover_page        = 'X'
                cover_page            = 'X'
                receiver              = sy-uname
                department            = 'System'
                no_dialog             = 'X'
      importing out_parameters        =  mstr_print_parms
                valid                 = mc_valid.
    ENDFORM.                    " GET_PRINT_PARAMS
    *&      Form  SPOOL_2_PDF
    FORM SPOOL_2_PDF.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid      = mi_rqident
          no_dialog        = space
          dst_device       = mstr_print_parms-pdest
        importing
          pdf_bytecount    = mi_bytecount
        tables
          pdf              = mtab_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
          others     = 12.
         call function 'WS_DOWNLOAD'
           exporting
             bin_filesize                  =  mi_bytecount
    <b>        filename                      =  mc_filename</b>
             filetype                      = 'BIN'
           tables
             data_tab                      =  mtab_pdf
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    ENDFORM.                    " SPOOL_2_PDF
    *&      Form  UPLOAD_PDF_FILE
    FORM UPLOAD_PDF_FILE.
      call function 'WS_UPLOAD'
        exporting
    <b>      filename                      = mc_filename</b>
          filetype                      = 'BIN'
        tables
          data_tab                      = OBJBIN
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    ENDFORM.                    " UPLOAD_PDF_FILE
    **reward if helpful
    regards,
    madhumitha

  • N91 problem sending SMS with non English character...

    Hello I own a N91 4GB version. I have upgraded to version 2.20.008. I checked recently and have not found a newer version available for download.
    When composing an SMS a counter appears on the upper part of the screen, which shows how many characters remain and how many SMS(s) will be sent.
    When I use my native language, i.e. Greek, the counter starts as usual with 160 characters. When I type the first character it drops to 69 characters and then it works correctly decreasing the counter by 1. The result is that the phone sends more than 1 SMS even if there are no more than 160 characters.
    The problem does not appear if I use English characters.
    Is there a way to fix this? Do other users have the same problem?

    Hello alsanico,
    I'm from Greece too.
    I haven't seen N91's exact menu but i suppose it has similarities with my N95. They both run S60.
    Settings-
    General-
    Personalisation-
    Language-
    Writing Language-Ellinika
    If you have already made these settings then go to:
    Messaging-
    Options (left selection key)-
    Settings-
    Text Message-
    Character encoding-
    Reduced support
    Hope this helps...

  • Functionality to send email with attachments.(all types ot attachments)

    Hi experts,
    I have an requirement to modify the existing workflow to include the new part/functionality to send the email with attachments.
    I mean, the existing workflow is sending only the notification as of now, the new requirement was i need to add the new functionalaity such a way the email functionality needs to be enabled so that the receiver who is receiving the notification will also get the email as well along with the attachments.
    Note* Attachment could be of any types like pdf,tex,word etc...
    Please suggest will it be possible to achieve this functionalites?
    Any sample code will be a great help for me.
    Thanks in advance,
    Thiru.

    You can send attachments in email notification by defining message attributes of type document. Oracle Workflow supports document types called "PL/SQL" documents, "PL/SQL CLOB" documents, and "PL/SQL BLOB" documents.
    You can go through the below document for defining documents.
    http://www-apps.us.oracle.com/wf/doc/wfr1213/wfdg/html/T361836T362168.htm#2807860

  • Cannot use PDF with a certain site

    PDF will not display when using a certain site-all other sites are ok with PDF settings, have been to adobe website & downloaded their updated version but it still wont display on this particular site.

    No solution

  • SO_NEW_DOCUMENT_ATT_SEND_API1 sending pdf with wrong special characters

    Hi Experts,
    Im using the fm SO_NEW_DOCUMENT_ATT_SEND_API1 to send out a pdf (into sap office box). But when I open it
    I get totally wrong special characters (Chinese for instance, and ' is replaced by #).
    I have already applied the note 1430123 but it didnt resolve the issue.
    Can anybody help on this?
    Help will highly appreciated.
    Hubert

    Yes. This is very much possible.
    gv_xstring contains the pdf data in XSTRING format.
    Check the code :
    *   ---------- create persistent send request ----------------------
      send_request = cl_bcs=>create_persistent( ).
    *   ---------- Create document ----------------------------------------
    *   get PDF xstring and convert it to BCS format
      lp_pdf_size = XSTRLEN( gv_xstring ).
      pdf_content = cl_document_bcs=>xstring_to_solix(
          ip_xstring = gv_xstring ).
    *     Create Mail Body
      CLEAR ls_body.
      CONCATENATE 'Dear' gv_name1 ',' INTO ls_body SEPARATED BY space .
      APPEND ls_body TO lt_body.
      CLEAR ls_body.
      APPEND ls_body TO lt_body.
      CLEAR ls_body.
      ls_body = 'Warm greetings '.
      APPEND ls_body TO lt_body.
      CLEAR ls_body.
      ls_body = 'Manager'.
      APPEND ls_body TO lt_body.
      document = cl_document_bcs=>create_document(
                      i_type    = 'RAW'
                      i_text    = lt_body
    *                  i_length  = '12'
                      i_subject = 'Letter' ).
    **   Add Attachment to send request
      CALL METHOD document->add_attachment
        EXPORTING
          i_attachment_type    = 'PDF'
          i_attachment_subject = 'Letter'
          i_att_content_hex    = pdf_content.
    *     add document to send request
      CALL METHOD send_request->set_document( document ).
    *   ---------- add recipient (e-mail address) ----------------------
      IF gv_adrnr IS INITIAL.
        SELECT SINGLE adrnr
          FROM kna1
          INTO gv_adrnr
         WHERE kunnr EQ gv_kunrg.
      ENDIF.
      SELECT SINGLE smtp_addr
        INTO lv_email
        FROM adr6
       WHERE addrnumber EQ gv_adrnr.
      recipient = cl_cam_address_bcs=>create_internet_address(
          i_address_string = lv_email ).
    *   add recipient to send request
      send_request->add_recipient( i_recipient = recipient ).
    *   ---------- send document ---------------------------------------
      sent_to_all = send_request->send(
          i_with_error_screen = 'X' ).
      IF sent_to_all = 'X'.
    *    MESSAGE i022(so).
        gv_emailflag = 'X'.
      ENDIF.
    *   ---------- explicit 'commit work' is mandatory! ----------------
      COMMIT WORK.

  • Bringing back results that match a certain character type

    Hi, thank you for any help.
    Below is a few values from a field in a database table. I like to bring back the values that only have ###-####. I do not want to bring back any other values that has any other kind of characters in them unless its a number. Thank you
    I want to bring back only         
    105-1110          
    105-1114          
    105-1121          
    105-1125          
    105-1298          
    105-1300  
    I dont want to bring back the ones below.
    001-10            
    001-2-13          
    002-2-10          
    003-43            
    003-52            
    003-87           
    0820-FR           
    1-0-17            
    1-0-18            
    1-0-19            
    1-0-20            
    1-0-22            
    1-0-29            
    1000-SW           
    1030-SW                 
    105-CIFM          
    Edwin Lopera

    One option
    declare @table table(val varchar(10));
    insert into @table
    values
    ('105-1110'),
    ('105-1114'),
    ('105-1121'),
    ('105-1125'),
    ('105-1298'),
    ('105-1300'),
    ('001-10'),
    ('001-2-13'),
    ('002-2-10'),
    ('003-43'),
    ('003-52'),
    ('003-87'),
    ('0820-FR'),
    ('1-0-17'),
    ('1-0-18'),
    ('1-0-19'),
    ('1-0-20'),
    ('1-0-22'),
    ('1-0-29'),
    ('1000-SW'),
    ('1030-SW'),
    ('105-CIFM')
    select * from @table
    where val like '[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Groupware - only synchronise activites with a certain status?

    Hello out there,
    is it possible to set a filter as to only send activites with one certain status e.g. 'open' to the Groupware-Server (Exchange)?
    If so, when the activity status changes from 'open' to 'finished', are the activities removed from the users calendar?
    I'm using the Groupware-Szenario with Site Type GWA_01 (mBDoc). Where do I configure, for which users the caledar is synchronised? Or is the synchronisation automatically for all users?
    Regards,
    Friederike Braun

    Hello out there,
    is it possible to set a filter as to only send activites with one certain status e.g. 'open' to the Groupware-Server (Exchange)?
    If so, when the activity status changes from 'open' to 'finished', are the activities removed from the users calendar?
    I'm using the Groupware-Szenario with Site Type GWA_01 (mBDoc). Where do I configure, for which users the caledar is synchronised? Or is the synchronisation automatically for all users?
    Regards,
    Friederike Braun

  • 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 如果看不到中文就要更新 ?
    如果用戶不懂, 那就不是永遠看不見 ? 因為那是供應商嗎 !

  • Sending mail with PDF file attachment ?

    Hi All,
    I have scenario File ---> Mail, monitoring FTP directory for PDF file and sending using mail attachment.
    At the moment i am using JAVA mapping to construct the mail package structure follow all the step in this blog : XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    it is working if i am using text file but then how to encode the pdf content so i can send throught the mail adapter. ?
    Thank you and Best Regards
    Fernand

    Hi,
    Actually, i am using this java code below :
    try {
        //     create XML structure of mail package
        String output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
               + "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"         
               + "<Subject>" + mailSubject     + "</Subject>"
               + "<From>" + mailSender     + "</From>"
               + "<To>" + mailReceiver     + "</To>"
               + "<Content_Type>multipart/mixed; boundary=\"" + boundary + "\"</Content_Type>"
               + "<Content>";
        out.write(output.getBytes());
        // create the declaration of the MIME parts
        //First part
        output = "--" + boundary + CRLF
               + "Content-Type: text/plain; charset=UTF-8" + CRLF
               //+ "Content-Transfer-Encoding: 8bit" + CRLF
               + "Content-Disposition: inline" + CRLF + CRLF
               + mailContent + CRLF
        //Second part
        + "--" + boundary + CRLF
        + "Content-Type: Application/pdf; name=" + attachmentName + CRLF  
        //+ "Content-Transfer-Encoding: base64" + CRLF
        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF + CRLF;
        out.write(output.getBytes());
        //Source is taken as attachment
        copySource(in, out);
        out.write("</Content></ns:Mail>".getBytes());
      } catch (IOException e) {
        throw new StreamTransformationException(e.getMessage());
    protected static void copySource(InputStream in, OutputStream out)
         throws IOException {
        byte[] bbuf = new byte[in.available()];
        int bblen = in.read(bbuf);
        if (!(bblen < 0)) {
          //String sbuf = new String(bbuf);
          //String encoded = Base64.encode(sbuf);
          // replace all control characters with escape sequences
          //sbuf = sbuf.replaceAll("&", "&amp;");
          //sbuf = sbuf.replaceAll("\"", "&quot;");
          //sbuf = sbuf.replaceAll("'", "&apos;");
          //sbuf = sbuf.replaceAll("<", "&lt;");
          //sbuf = sbuf.replaceAll(">", "&gt;");
          out.write(bbuf);
    This code working fine with text file but not for pdf file. because i got error in mail adapter :
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: java.lang.NullPointerException; nested exception caused by: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)(:main:, row=11, col=4) -> com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)
    I guest the problem because the mail adapter doen't accept pdf content insite the mail package.
    please advise me
    Best Regards
    Fernand

  • I cannot send a Pages document, Word format via email from my ipad if it has a picture in the the doc.  I can send a Word doc if it does not have a pic in it or pdf with a pic.  Any thoughs why a word doc with a pic in it won't email in Pages?  thanks

    I cannot send a Pages document, Word via email if the doc contains a picture.  If I email a Pages doc without a pic in Word format or pdf with a pic it with go through to sender?  Not sure why Pages won't send Word doc with a picture in it.  I check the security on the email recipient and the email doesn't get blocked or throw in the junk box?
    thanks,
    drainguy41

    If you have upgraded to Mountain Lion, Save As… has returned to the File menu when you hold down the Option/alt key. But you don't really "save" as other file types, you translate & export as Word or RTF or text or PDF & that is easily done by going to File > Export or Share > Export.
    Also, please do us all a favor & don't use all capitals in your posts, either the body of the post or the title. All caps is the internet equivalent of shouting & is very hard to read.

  • Problem in sending mail with PDF attachment

    Hi all,
    Kindly check this code..
    I neeed to send the smartform as a PDF attachment..
    PDF generated form of smartform is generated successfully..
    <b>but PDF  going as attachment is showing errors in opening</b> .
    Please help me to solve this issue as soon as possible
          DESCRIBE TABLE objtxt LINES tab_lines.
          READ TABLE objtxt INDEX tab_lines.
          doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
         doc_chng-doc_size = tab_lines * 255.
    Creation of the entry for the compressed document
          CLEAR objpack-transf_bin.
          objpack-head_start = 1.
          objpack-head_num = 0.
          objpack-body_start = 1.
          objpack-body_num = tab_lines.
          objpack-doc_type = 'RAW'.
          APPEND objpack.
    Creation of the document attachment
          DESCRIBE TABLE objbin LINES tab_lines.
    Creation of the entry for the compressed document
          CLEAR objpack-transf_bin.
          objpack-transf_bin = 'X'.
          objpack-head_start = 1.
          objpack-head_num = 0.
          objpack-body_start = 1.
          READ TABLE objbin INDEX tab_lines.
          objpack-doc_size =  tab_lines * 255 .
          objpack-body_num = tab_lines.
          objpack-doc_type = 'PDF'.
          objpack-obj_name = 'SMART'.
          objpack-obj_descr = 'test'.
          APPEND objpack.
    Completing the recipient list
    target recipent
          CLEAR reclist.
          reclist-receiver = '[email protected]'.
          reclist-express  = 'X'.
          reclist-rec_type = 'U'.
          APPEND reclist.
    Sending the document
          CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            EXPORTING
              document_data              = doc_chng
              put_in_outbox              = '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
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 99.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Regards,
    ajith

    Hello Ajith,
    Use this Code.
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    i_tline TYPE TABLE OF tline WITH HEADER LINE,
    i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
    i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    wa_objhead TYPE soli_tab,
    w_ctrlop TYPE ssfctrlop,
    w_compop TYPE ssfcompop,
    w_return TYPE ssfcrescl,
    wa_doc_chng typE sodocchgi1,
    w_data TYPE sodocchgi1,
    wa_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
    v_form_name TYPE rs38l_fnam,
    v_len_in LIKE sood-objlen,
    v_len_out LIKE sood-objlen,
    v_len_outn TYPE i,
    v_lines_txt TYPE i,
    v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZZZ_TEST1'
    importing
    fm_name = v_form_name
    exceptions
    no_form = 1
    no_function_module = 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.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
    EXPORTING
    control_parameters = w_ctrlop
    output_options = w_compop
    user_settings = 'X'
    IMPORTING
    job_output_info = w_return
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 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.
    ENDIF.
    i_otf[] = w_return-otfdata[].
    call function 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    IMPORTING
    bin_filesize = v_len_in
    TABLES
    otf = i_otf
    lines = i_tline
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    others = 4.
    Fehlerhandling
    if sy-subrc <> 0.
    endif.
    loop at i_tline.
    translate i_tline using '~'.
    concatenate wa_buffer i_tline into wa_buffer.
    endloop.
    translate wa_buffer using '~'.
    do.
    i_record = wa_buffer.
    append i_record.
    shift wa_buffer left by 255 places.
    if wa_buffer is initial.
    exit.
    endif.
    enddo.
    Attachment
    refresh:
    i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
    clear wa_objhead.
    i_objbin[] = i_record[].
    Create Message Body
    Title and Description
    i_objtxt = 'test with pdf-Attachment!'.
    append i_objtxt.
    describe table i_objtxt lines v_lines_txt.
    read table i_objtxt index v_lines_txt.
    wa_doc_chng-obj_name = 'smartform'.
    wa_doc_chng-expiry_dat = sy-datum + 10.
    wa_doc_chng-obj_descr = 'smartform'.
    wa_doc_chng-sensitivty = 'F'.
    wa_doc_chng-doc_size = v_lines_txt * 255.
    Main Text
    wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
    clear i_objpack-transf_bin.
    i_objpack-head_start = 1.
    i_objpack-head_num = 0.
    i_objpack-body_start = 1.
    i_objpack-body_num = v_lines_txt.
    i_objpack-doc_type = 'RAW'.
    append i_objpack.
    Attachment
    (pdf-Attachment)
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 0.
    i_objpack-body_start = 1.
    Länge des Attachment ermitteln
    describe table i_objbin lines v_lines_bin.
    read table i_objbin index v_lines_bin.
    i_objpack-doc_size = v_lines_bin * 255 .
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'smart'.
    i_objpack-obj_descr = 'test'.
    append i_objpack.
    clear i_reclist.
    i_reclist-receiver = '[email protected]'.
    i_reclist-rec_type = 'U'.
    append i_reclist.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = wa_doc_chng
    put_in_outbox = 'X'
    TABLES
    packing_list = i_objpack
    object_header = wa_objhead
    CONTENTS_BIN = i_objbin
    contents_txt = i_objtxt
    receivers = i_reclist
    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 helped reward points
    Vasanth

  • To send email with editable PDF/XLS attachment

    Hi All,
      Is it possible to send editable PDF/XLS attachment in a mail to the customer via SAP, if yes how?
    Please Help! Urgent

    hi,
    *Sending mail with attachment
    * This program will allowed you to send email with attachment.
    * First, specify the attachment file from your local hardisk and execute.
    * Next, specify the sender email address and click the send button.
    report y_cr17_mail.
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    * Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
    *    PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    *  EXCEPTIONS
    *    USER_NOT_EXIST                  = 1
    *    PARAMETER_ERROR                 = 2
    *    X_ERROR                         = 3
    *    OTHERS                          = 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.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'sap-img.com testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'sap-img.com testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    *   FOLMEM_DATA        =
    *   RECEIVE_DATA       =
    * File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.
    *-- End of Program  
    Hope this helps, Do reward.

  • Convert Screen(spool) to PDF file sending mail with attach file

    Hi :
    I'd like convert spool list to pdf and sending file...
    so, I read thread about spool convert to PDF before,
    and know how to convert Spool to PDF file and send mail with attach file.
    but I have a problem.
    my solution as:
    step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
    step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
    then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
    I want to showing word is wider that 255.
    and then I find a manual method as:
    After program finished.
    Function Menu -> system -> List -> Send
    use Prog: "Create Document and Send"
    I use this prog sending mail and attached file ,
    PDF file do <b>NOT</b> have 255 word limit !
    finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
    which Function I have to use?...
    Please help me, Thanks!

    Hi,
    Check this sample code of sending spool as attachment to an email address..
    Parameters.
    PARAMETERS: p_email(50) LOWER CASE.
    PARAMETERS: p_spool LIKE tsp01-rqident.
    Data declarations.
    DATA: plist         LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: document_data LIKE sodocchgi1.
    DATA: so_ali        LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA: real_type     LIKE soodk-objtp.
    DATA: sp_lang       LIKE tst01-dlang.
    DATA: line_size     TYPE i VALUE 255.
    DATA: v_name        LIKE soextreci1-receiver.
    DATA rec_tab        LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    Get the spool data.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
         EXPORTING
              rqident              = p_spool
              first_line           = 1
              last_line            = 0
              desired_type         = '   '
         IMPORTING
              real_type            = real_type
              sp_lang              = sp_lang
         TABLES
              buffer               = so_ali
         EXCEPTIONS
              no_such_job          = 1
              job_contains_no_data = 2
              selection_empty      = 3
              no_permission        = 4
              can_not_access       = 5
              read_error           = 6
              type_no_match        = 7
              OTHERS               = 8.
    IF sy-subrc <> 0.
      MESSAGE s208(00) WITH 'Error'.
      LEAVE LIST-PROCESSING.
    ENDIF.
    Prepare the data.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 0.
    plist-body_num = 0.
    plist-doc_type = 'RAW'.
    plist-obj_descr = 'Test ALV'.
    APPEND plist.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 1.
    DESCRIBE TABLE so_ali LINES plist-body_num.
    plist-doc_type = real_type.
    Get the size.
    READ TABLE so_ali INDEX plist-body_num.
    plist-doc_size = ( plist-body_num - 1 ) * line_size
                     + STRLEN( so_ali ).
    APPEND plist.
    Move the receiver address.
    MOVE: p_email  TO rec_tab-receiver,
          'U'      TO rec_tab-rec_type.
    APPEND rec_tab.
    IF NOT sp_lang IS INITIAL.
      document_data-obj_langu = sp_lang.
    ELSE.
      document_data-obj_langu = sy-langu.
    ENDIF.
    v_name = sy-uname.
    Send the email.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = document_data
              sender_address             = v_name
              sender_address_type        = 'B'
         TABLES
              packing_list               = plist
              contents_bin               = so_ali
              receivers                  = rec_tab
         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 e208(00) WITH 'Error'.
    ENDIF.
    COMMIT WORK.
    Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    Thanks,
    Naren

Maybe you are looking for

  • How to create a new database after copying an existing database with a new name

    hi i have an existing database and want to copy with a new name in sql server 2005 how do it is possible  spose i have a db name attached in sql server StoreManagementDB now i want to copy this database with all the transactions as StoreManagementDB_

  • IPod Touch wont play music or connet to iTunes!

    My ipod touch wont play music through the headphones or docking station, it only plays music through the actual iPod and it isnt found when i connect to itunes, help!

  • About 64 bit platform

    can an oracle application on 64 bit platform be migrated to another. say from HP-UX 11i to windows server 2003. what is the difference in scalability issues between HP-UX 11i on PA-RISC 8700 ( 8 cpu) v/s windows server 2003 (enterprise edition) on It

  • Reg: NW CE ear build problems

    Hi all I have a java project which is to be put into a EAP. It simply doesnt appear under J2EE module dependency of the EAP. I have no clue why? The same was working a day before. I feel this very buggy. Can anyone please help? Overall I see the buil

  • HT1446 Is it easy to change the battery on a 2008 MacBook Air?

    Is it easy to change the battery on a 2008 MacBook Air?