Send pdf as email

hai gurus ,
my problem is i am sending pdf as email its working fine
but when i go and check the pdf file in  scot transaction the file is not getting  opened
plz help me
thanks in advance
anji.
Moderator message: please search for available information/documentation before asking, provide more technical details about errors when posting again.
Edited by: Thomas Zloch on Oct 28, 2010 10:58 AM

Hi,
Check this link [http://wiki.sdn.sap.com/wiki/display/Snippets/ConvertsspoolrequestintoPDFdocumentand+emails]
BR,
Lokeswari.
Moderator message: please do not post just links without any further explanations.
Edited by: Thomas Zloch on Oct 28, 2010 10:58 AM

Similar Messages

  • Unable to send PDFs as email attachments

    I have become unable to send PDFs as email attachments when using Firefox.
    Depending on the PDF, I either get the message “There was an error opening this document. The file is damaged and could not be repaired.” or it opens as a blank document. This occus when opening the file with both Adobe Reader and Acrobat Pro. The problem seems to be isolated to PDFs. (I am able to send Word files. If a PDF is zipped before attaching, it can be opened without problem.) This occurs on both an institutional email account and personal (Yahoo) email account. This problem is isolated to Firefox (does not happen in Chrome).
    I have reset Firefox to default settings, as well as reinstalling.
    Thank you.

    Update Adobe® Acrobat® Plug-in for Web Browsers, Version 10.1.13 to version 11.
    Also please update all of your plugins and try again.
    Does this happen when you open the pdf in pdf.js, it is possible to change the default viewer by:
    * [[How to disable the built-in PDF viewer and use another viewer]]

  • Sending PDF thru email with password protection in our SAP system

    Need solution for sending PDF thru email with password protection in our SAP ecc 6

    Or maybe you have found any other way? You can check here:
    Password protect PDF file:
    Re: Password protected PDF file 
    pdf with password encryption
    Regards Otto

  • Send .pdf as email attachment not under tools in 11.0.9

    The option to send .pdf as an email attachment is not under the tools menu as it has been in previous versions. Is this an option that has been removed, or is this an error in the installation?

    This does not solve the issue. I have updated my system to version 11.0.10 and the feature is still missing.

  • Suddenly can't send PDF by email. It says verification failed.

    I often send PDF files, but now they won't load. I hit "Accept" but it just stays there forever, and sometimes gives me a message saying verification failed. What did I do or what can I do?

    Hey jcg34428556,
    I would certainly help you out, but before that could you please specify few details on the same like the version of OS and Acrobat you are using.
    What email application (Gmail, Yahoo, etc.) are you using for sending the PDF.
    Please navigate to the following link and confirm whether you are doing it the same way:
    https://acrobatusers.com/tutorials/how-to-use-webmail-in-acrobat-infographic
    When exactly do you get this error message? If possible, please share the screenshot of the same.
    Hope to get your response.
    Regards,
    Anubha

  • Send pdf by email

    Hi
    I am trying to run the tutorial
    Offline interactive form based on sending and receiving emails
    The problem I am facing is trying to get thru the company SMTP server. If I connect directly thru ADSL
    using javamail everything is ok. But if I use the co. SMTP server I get the following exception:
    Couldn't connect using "javax.net.ssl.SSLSocketFactory" socket factory to host, port: smtp.gmail.com, 465; Exception: java.lang.reflect.InvocationTargetException
    //setup proxy params
              props.put("http.proxySet", "true");
              props.put("http.proxyHost", COMPANY_SMTP_HOST);
              props.put("http.proxyPort", "25");
              props.put("http.proxyUser", "");
              props.put("http.proxyPassword", "");
              // Setup mail server
              props.put("mail.smtp.host", "smtp.gmail.com");
              props.setProperty("mail.smtp.port", "465");
              props.put("mail.smtp.starttls.enable","true");
              System.setProperty("mail.smtps.auth", "true");
              //props.put("mail.smtps.auth", "true");
              props.put("mail.smtp.socketFactory.port", "465");
              props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
              props.put("mail.smtp.socketFactory.fallback", "false");
              props.put("mail.transport.protocol", "smtp");
              Session session = Session.getInstance(props, new Authenticator()
                   protected PasswordAuthentication getPasswordAuthentication()
                        return new PasswordAuthentication(username, password);
    As the application naturally runs on the company server it has to use the compzsny SMTP server.
    Thanks for your help
    yuval

    Yuval,
    Try using the IP address of the SMTP server.
    Chintan

  • 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

  • Sending pdf via email: pdf is not returned from function module

    Hi all.
    I am having trouble sending a pdf form as an attachment to an email.
    After calling the funtion module that is creating the PDF, field pdf of the return parameter /1bcdwb/formoutput should be used to create the attachment.
    But the field PDF is empty after calling the function module - only the field xml is given back.
    What did I miss?
    Thank you for your help and best regards, Kathrin!

    Hi Kathrin,
    See below for the example:
    ls_outputparams-getpdf = 'X'.
    CALL FUNCTION 'FP_JOB_OPEN'
         CHANGING
           ie_outputparams = ls_outputparams
         EXCEPTIONS
           cancel          = 1
           usage_error     = 2
           system_error    = 3
           internal_error  = 4
           OTHERS          = 5.
    If you setup the job like this then the pdf parameter will be filled with the XSTRING data for the generated PDF.
    Regards,
    Ryan Crosby

  • Send PDF as email attachment using Outlook 2011 ERROR

    Every time I try to send a PDF as an email attachment, I get the following error:
    "An error occurred while trying to create a mail document.  Acrobat is unable to complete your request."
    Prior to getting this error, every time I sent an email Adobe would open the default Mail program on the mac. I  opened mail and changed the preference to use Outlook 2011 as the default mail program, but this did not correct the error.
    Any ideas?
    Thanks!

    AmbooS wrote:
    This is a known issue with Mac Outlook 2011 which is an unsupported version for Acrobat X. This will be supported in the next release.
    If adobe was smart it would be added in the update rather than in than in AcrobatXI  And while at it they need to add support for SeaMonkey and Thunderbird as well.  You've been ingnoring of Dissing Mozilla Products since OSX has been out.

  • Send PDF in Email Button

    I have a PDF for new employees in LiveCycle Designer ES. I want to be able to have workers fill out form and be able to send in a PDF not an XML
    I’ve tried to create using regular button and doing mailto:[email protected] . Also I have tried using the email submit, but I am only able to send as an XML.
    Is there any way to make an email submission button that will be sent as a PDF?
    Please Help !!! ^__^
    Thanks,
    Deanna

    By default, Adobe Reader users can only send XML, FDF, XFDF, XDP format.
    To send in PDF format instead of XML, you must Extend Rights to the form.
    There is a drawback to this approach provided by Adobe.
    The end-users will need a 3rd party client side e-mail software such as OUTLOOK to send the PDF.
    Another approach is to submit to a server-side script (ASP.net/PHP), and take the response and attach to an e-mail message, which sends SMTP instead of OUTLOOK. So there will be no need for client side e-mail software.
    For more information:
    http://www.pdfemail.net/

  • Send pdf by email without database

    I have built a form in Livecycle and the form is attached to a database so that the drop down fields "pull" data from the database.  When the form fields are filled in the form is designed to be email to  other people. 
    The problem is that when a person receives the email and they try to open the attachment they get a message that the database is required. 
    How can I send the completed form as an attachment to an email so that the recipient is able to open the attachment without receiving the message that the database is required. Thanks.

    Hi,
    That is going to be difficult to get rid of the error. You could send a flattened (print to PDF) version if the user has Acrobat. Alternatively, you could set up a call to the database on docReady event and then show a custom dialog.
    Niall

  • Pages.  Shortcut for "send PDF by email"

    I created a shortcut for this command, but only works if I open the "print" window and the "PDF" menu on it, so it is not useful, how can I make a shorcut that works in any place or moment in Pages?

    Ever try to create a shorcut for the logical menu item:
    At this time I'm running Lion so I can't post a screenshot.
    You will have to trust me without proof.
    I linked a shortcut to
    menu > Share > Send by Mail > PDF
    To do that I selected PDF in the prefPane Keyboard > Shortcuts > Pages
    I used cmd + ctrl + shift + P
    I retrieved it active after quitting Pages.
    Yvan KOENIG (VALLAURIS, France) lundi 5 septembre 2011 21:32:57
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Deny user's sending pdf via email, so the option is not available

    HI,
    i have some sensitve data that i would like to create a variaty of PDFs for and have them availabe on my company intranet, i need users to be able to open and read these documents, but not edit them in any way, eg, no printing/ saving/ emailing/ editing of the content,/ screen shots/ or highlighting the content and pasting it into another document,  all i want them to be able to do is "READ ONLY"
    is Adobe Acrobat Pro the solution that i can use to do this with and HOW,
    please respond ASAP
    Todd

    East LT is trying to limit 'scraping' for a user who already has the file open - even with DRM that's simply a case of PrintScreen > Create PDF > From Image > OCR.
    'Clean rooms' are actually very simple to implement, and many small organizations do it in preference to the  investments required for DRM. You just need to put a computer in a locked office, make sure it's unplugged from the Internet and have a supervisor stand behind the person as they use it. We've had systems like that running on construction sites to prevent people 'borrowing' the plans - in which case it was a laptop chained to the wall in the security guard's cabin. The guard is already there so it cost nothing.
    LCDRM is all well and good, but we must be honest - unless Adobe re-open the Document Center service, it's beyond the budgets of anyone other than enterprise-class customers.

  • Sending PDF via Email and coding in workflow

    Dear Experts,
    Following is my Requirement
    When a Sales order is created, Delivery gets created automatically in Background. When Delivery is created based on the materials we would decide to which user an email should be sent. To the Email a PDF should be attached with the list of materials.
    To do this I have created a workflow with the Event LIKP. The Event is getting Triggered but where can i write the code to fetch the materials of Delivery and decide the email id of User based on materials. Alsoto attach as PDF i understand i need to write the code. All this code where can i write in Workflow.
    Please kindly help.
    Regards
    Sam.

    Dear Vinoth,
    Thanks for your reply. I have a solution which works through badi but the client wants it to be done by Workflow.
    Also  there are many other Workflow Developments where in between the Workflow steps some coding is needed.
    So Can you please guide me where i can write the coding i n workflow after the event is triggered.
    Regards
    Sam

  • Convert SMARTFORM report to PDF and send as an email attachment

    Hi
    I am using the CONVERT_OTF function module to convert a SMARTFORM report in the "spool" to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
    I would like to email the report in PDF format as an attachment. I am using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 to create an attachment however the attached file is not being created correctly and When try to open, it gives 'File is damaged and could not be repaired' error message. I believe that somehow I am not using the SO_NEW_DOCUMENT_ATT_SEND_API1 function module correctly.
    Please help me to correct this
    Thanks
    Rohitha
    see my code below,
    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.
      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 132 PLACES.
        IF WA_BUFFER IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
      REFRESH:  I_RECLIST,
                I_OBJTXT,
                I_OBJBIN,
                I_OBJPACK.
      CLEAR WA_OBJHEAD.
      I_OBJBIN[] = I_RECORD[].
      I_OBJTXT = '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_to_PDF'.
      WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
      WA_DOC_CHNG-OBJ_DESCR = 'Smartform to PDF'.
      WA_DOC_CHNG-SENSITIVTY = 'F'.
      WA_DOC_CHNG-DOC_SIZE = STRLEN( I_OBJTXT ) + ( ( V_LINES_TXT - 1 ) * 255 ) .
      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.
      I_OBJPACK-TRANSF_BIN = 'X'.
      I_OBJPACK-HEAD_START = 1.
      I_OBJPACK-HEAD_NUM = 1.
      I_OBJPACK-BODY_START = 1.
      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 = 'ATTACHMENT'.
      I_OBJPACK-OBJ_DESCR = 'test'.
      APPEND I_OBJPACK.
      CLEAR I_RECLIST.
      I_RECLIST-RECEIVER = 'my email address u2019.
      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'
          COMMIT_WORK                = '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 SY-SUBRC <> 0.
        WRITE:/ 'Error ', SY-SUBRC.
      ELSE.
        WRITE:/ 'Mail sent'.
      ENDIF.

    Hi rohitha.wijewardena ,
    Please find the below code which i followed and succeed ,
    CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
        EXPORTING
          pi_nast       = nast
          pi_country    = lv_dlv-land
          pi_addr_key   = lv_addr_key
          pi_repid      = sy-repid
          pi_screen     = lc_x
        IMPORTING
          pe_returncode = gv_retcode
          pe_itcpo      = lv_itcpo
          pe_device     = lv_device
          pe_recipient  = lv_recipient
          pe_sender     = lv_sender.
      IF gv_retcode = 0.
    *moving the data to composer and control parameters for output
        MOVE-CORRESPONDING lv_itcpo TO lv_composer_param.
        lv_control_param-device      = lv_device.
        lv_control_param-no_dialog   = lc_x.
        lv_control_param-preview     = lc_x.
        lv_control_param-getotf      = lv_itcpo-tdgetotf.
        lv_control_param-langu       = nast-spras.
        lv_composer_param-tdnoprint = space.
      ENDIF.
    *Getting the Smartform Function module using Standard Function module
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = lv_formname           "Smartform Name
       IMPORTING
         fm_name                  = lv_fm_name
       EXCEPTIONS
         no_form                  = 1
         no_function_module       = 2
         OTHERS                   = 3
      IF sy-subrc <> 0.
        gv_retcode = sy-subrc.
        PERFORM protocol_update.
        PERFORM add_smfrm_prot.
      ENDIF.
    **Smartform function module to get the output
      CALL FUNCTION lv_fm_name
        EXPORTING
       control_parameters         = lv_control_param
       mail_recipient             = lv_recipient
       mail_sender                = lv_sender
         output_options             = lv_composer_param
         user_settings              = ' '
          is_bil_invoice             = lv_bil_invoice
          gt_header                  = gt_header
       IMPORTING
         job_output_info            = gv_job_output
        TABLES
          gt_item                    = gt_item
       EXCEPTIONS
         formatting_error           = 1
         internal_error             = 2
         send_error                 = 3
         user_canceled              = 4
         OTHERS                     = 5
      IF sy-subrc <> 0.
        gv_retcode = sy-subrc.
        PERFORM protocol_update.
        PERFORM add_smfrm_prot.
      ENDIF.
      IF nast-nacha = lc_mail.
        gt_otfdata[] = gv_job_output-otfdata[].
    *           Converting Smartform to PDF                          *
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = lc_pdf
            max_linewidth         = 10
          IMPORTING
            bin_filesize          = gv_binfilesize
            bin_file              = gv_pdf_xstring
          TABLES
            otf                   = gt_otfdata[]
            lines                 = gt_pdftab[]
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            err_bad_otf           = 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.
    *           Sending PDF to Email  using Class                     *
        IF NOT lv_email IS INITIAL .
          TRY.
             gv_send_request = cl_bcs=>create_persistent( ).
              gv_pdf_content = cl_document_bcs=>xstring_to_solix( gv_pdf_xstring ).
              gv_document = cl_document_bcs=>create_document(
                    i_type    = lc_pdf
                    i_hex     = gv_pdf_content
                    i_length  = gv_pdf_size
                    i_subject = lc_subject ).            "Subject for Email
              gv_send_request->set_document( gv_document ).
             gv_recipient = cl_cam_address_bcs=>create_internet_address( lv_email ).
              gv_send_request->add_recipient( gv_recipient ).
              gv_sent_to_all = gv_send_request->send( i_with_error_screen = lc_x ).
              COMMIT WORK.
              IF gv_sent_to_all IS INITIAL.
                MESSAGE i500(sbcoms) WITH lv_email.
              ELSE.
                MESSAGE s022(so).
              ENDIF.
            CATCH cx_bcs INTO gv_bcs_exception.
              MESSAGE i865(so) WITH gv_bcs_exception->error_type.
          ENDTRY.
        ENDIF.

Maybe you are looking for

  • Questions on Report Builder and Graphics Builder

    Hi there: I'm currently using Report/Graphics builder V 6.0.8.11.3 NT version to create RDF and OGD files. I was wondering with the following confusions: 1) Is the RDF/OGD file that I create under NT plat form portable to Sun Unix?? (ie. would Report

  • Can I block an email address from sending me iMessages?

    I am receiving harassing iMessages from an unknown person. I can turn off iMessage, but then I can't use it with my family. Is there a way to block specific email addresses?

  • Adobe Flash Player 10 Fix for WinXP and Vista, IE7, IE8, Firefox, ect.(New Fast Fix)

    (This is a possible solution for most users) I have found that inside the folder C:\WINDOWS\system32\Macromed\Flash (WinXP Home/Pro) (Computer > C: Drive > Windows > System32 > Macromed > Flash for Vista) there should be a file named FlashUtil10b.exe

  • Table control in Enjoy transactions like FB50/FB60/FB70

    Hi, I am using enjoy transactions like FB50/FB60/FB70 which provide me the facility to enter more than one GL Accounts in a very easy manner. The screen looks like a table where we can enter the data very easily. Now we can hide and display fields in

  • BC4J-JSP on Tomcat where are the controls

    Hi I have deployed Jsp based on local business components to Tomcat. The problem is that all the controls like NavigatorBar, ViewCurrentRecord etc are not displayed properly in my browser. Also all the color schemes are gone. The Data however is visi