Background Submit to Spool,  convert spool to PDF send via email

I am calling an ABAP in the background. this abap makes use of a custom table as the main driver ie on each change of vendor within this custom table I want to create a spool and email the spool - the spool is suppossed to be created via a submit RMCB0300  with screen selection to to sap-spool and return. I then want the program to take the spool convert it to PDF and email.
Problems I am encountering:
1. writing to the spool via background ABAP  as follows
   submit RMCB0300 with selection-table rspar
              to sap-spool
              spool parameters %_print
             archive parameters %_archive
             without spool dynpro and return.
Doesn't appear to be creating the spool - rspar is populated.
2. Best way to retrieve the correct spool number.
3. how to successfully convert PDF output after CONVERT_ABAPSPOOLJOB_2_PDF for email attachment - if this returns IT_PDF_OUTPUT.
is this the best way to do it:
Loop at IT_PDF_OUTPUT
      Translate IT_PDF_OUTPUT using ' ~'.
      concatenate gd_buffer it_pdf_output into gd_buffer
    endloop.
   translate gd_buffer using '~ '
Do it_mess_att = gd_buffer.
     append it_mess_att.
     shift gd_buffer left by 255 places
     if gd_buffer is initial
       exit.
     endif.
enddo.
Thanks
Mark
Edited by: Matt on Apr 2, 2009 11:03 AM - amended title with formatting problems.

Please find the code for converting SPool to pdf and sending mail
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
     EXPORTING
       SRC_SPOOLID              = LV_MI_RQIDENT
       NO_DIALOG                = 'X'
       DST_DEVICE               = LV_PRINT_PARMS-PDEST
     IMPORTING
       PDF_BYTECOUNT            = LV_BYTECOUNT
       PDF_SPOOLID              = LV_RQIDENT
     TABLES
       PDF                      = LT_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.
   IF SY-SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
   LOOP AT LT_MTAB_PDF INTO LWA_MTAB_PDF.
     TRANSLATE LWA_MTAB_PDF USING ' ~'.
     CONCATENATE LV_GD_BUFFER LWA_MTAB_PDF INTO LV_GD_BUFFER.
     CLEAR LWA_MTAB_PDF.
   ENDLOOP.
   TRANSLATE LV_GD_BUFFER USING '~ '.
   DO.
     LWA_MESS_ATT = LV_GD_BUFFER.
     APPEND LWA_MESS_ATT TO LT_MESS_ATT.
     CLEAR LWA_MESS_ATT.
     SHIFT LV_GD_BUFFER LEFT BY 255 PLACES.
     IF LV_GD_BUFFER IS INITIAL.
       EXIT.
     ENDIF.
   ENDDO.
   CLEAR:  LWA_RECLIST, LT_RECLIST[],
           LT_OBJHEAD, LT_OBJHEAD[],
           LWA_OBJTXT,  LT_OBJTXT[],
           LWA_OBJBIN,  LT_OBJBIN[],
           LWA_OBJPACK, LT_OBJPACK[].
   "   CLEAR LT_OBJBIN.
   REFRESH LT_OBJBIN.
   LT_OBJBIN[] = LT_MESS_ATT[].
   DESCRIBE TABLE  LT_OBJBIN LINES LV_L_ATTACHMENT.
   LWA_OBJTXT = ''.
   APPEND LWA_OBJTXT TO LT_OBJTXT.
   CLEAR LWA_OBJTXT.
   DESCRIBE TABLE LT_OBJTXT LINES LV_L_TESTO.
   LT_DOC_CHNG-OBJ_NAME   = 'STATUS_REPORT'.
   LT_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
   LT_DOC_CHNG-OBJ_DESCR  = 'Generated File'.               "#EC NOTEXT
   LT_DOC_CHNG-SENSITIVTY = 'F'.
   LT_DOC_CHNG-SENSITIVTY = 'O'.
   LT_DOC_CHNG-OBJ_PRIO   = '1'.
   LT_DOC_CHNG-DOC_SIZE   = LV_L_TESTO * 255.
   CLEAR LWA_OBJPACK-TRANSF_BIN.
   LWA_OBJPACK-HEAD_START = 1.
   LWA_OBJPACK-HEAD_NUM   = 0.
   LWA_OBJPACK-BODY_START = 1.
   LWA_OBJPACK-BODY_NUM   = LV_L_TESTO.
   LWA_OBJPACK-DOC_TYPE   = 'RAW'.
   APPEND LWA_OBJPACK TO LT_OBJPACK.
   CLEAR LWA_OBJPACK.
   LWA_OBJPACK-TRANSF_BIN = 'X' .
   LWA_OBJPACK-HEAD_START = 1.
   LWA_OBJPACK-HEAD_NUM   = 1.
   LWA_OBJPACK-BODY_START = 1.
   LWA_OBJPACK-BODY_NUM   = LV_L_ATTACHMENT.
   LWA_OBJPACK-DOC_TYPE   = 'PDF'.
   LWA_OBJPACK-OBJ_NAME   ='SPOOL'.
   LWA_OBJPACK-OBJ_DESCR = 'Test'.     
   LWA_OBJPACK-DOC_SIZE = LV_L_ATTACHMENT * 255.
   APPEND LWA_OBJPACK TO LT_OBJPACK.
   CLEAR LWA_OBJPACK.
   CLEAR LWA_RECLIST.
   LWA_RECLIST-COPY = 'X'.
   LWA_RECLIST-RECEIVER   = P_EMAIL.
   LWA_RECLIST-REC_TYPE   = 'U'.
   LWA_RECLIST-NOTIF_DEL  = 'X'.
   LWA_RECLIST-NOTIF_NDEL = 'X'.
   APPEND LWA_RECLIST TO LT_RECLIST.
   CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
     EXPORTING
       DOCUMENT_DATA              = LT_DOC_CHNG
       PUT_IN_OUTBOX              = ' '
       COMMIT_WORK                = 'X'
     TABLES
       PACKING_LIST               = LT_OBJPACK
       OBJECT_HEADER              = LT_OBJHEAD
       CONTENTS_BIN               = LT_OBJBIN
       CONTENTS_TXT               = LT_OBJTXT
       RECEIVERS                  = LT_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.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.

Similar Messages

  • Send spool list ceated by Job (SM36) as pdf-file via email

    We are running the report RM06EFLB (Transaktion ME84 - "Create Releases") in the background.
    The Job is creating a spool list with 17 pages.
    I want to send this 17 pages (in a readable form) to a number of persons.
    This did I try so far:
    - Distribution list with Recipient type "via Internet" as Spool list recipients in the Job. (Tried different formats for ABAP List in Transaction SCOT)
    => Email is send to recipients, attachment is readable depending on format.
         Problem: attachment is not complete, it contains only about 15 pages (985 rows).
    - Distribution list with Recipient type "Internal User - SAP-Office" as Spool list recipients in the Job.
    => Document is sent to Business Workplace
         Problem:  attachment is not complete, it contains only about 15 pages
    Any ideas how to get the complete spool list?
    Is there mayby a report around  that is sending a spool list as pdf-file via email to a number of recipients?
    (Would like to maintain this Report as an additional step in the job. The spool-number should be selected from the previous step.)
    Thank you for your help.
    Jens

    Oh sorry - here is the coding which is used in that program:
    First use function module  'CONVERT_ABAPSPOOLJOB_2_PDF' to convert the spool entry into pdf.
    Loop at output table PDF and concatenate all lines into a string. Convert string to xstring.
    Then call mail class:
    DATA: lv_pdf_x TYPE xstring,
            lv_subject TYPE string,
            lv_doc_desc TYPE so_obj_des,
            lv_mail_body TYPE soli_tab.
      DATA: ls_atta TYPE rcf_s_att4mail_hex,
            lt_atta TYPE rcf_t_att4mail_hex.
    * -- Fill parameter
      lv_subject = 'Requested Report'."#EC NOTEXT
      lv_doc_desc = 'Report XXL'."#EC NOTEXT
    *  lv_mail_body = ?
      ls_atta-name = lv_doc_desc.
      ls_atta-extension = 'PDF'.
      ls_atta-content = p_pdf_x. <- This is your xstring
      APPEND ls_atta TO lt_atta.
      TRY.
          CALL METHOD cl_hrrcf_services_mail=>send_web_mail
            EXPORTING
              p_subject              = lv_subject
              p_receiver             = p_receiver->email_address
              pt_atta_hex            = lt_atta
              p_sender               = p_sender->email_address
              p_body_c               = lv_mail_body.
        CATCH cx_hrrcf.
      ENDTRY.
    I hope that you have the above mentioned class in your system but it should work with other email functions as well.
    Regards
    Nicola

  • I have a large PDF that I cannot send via email because of its size, 76 MB. How do I shrink this file or convert it to another format so I can email this, less than 20MB? Thanks for your help

    I have a large PDF that I cannot send via email because of its size, 76 MB. How do I shrink this file or convert it to another format so I can email this, less than 20MB? Thanks for your help

    Open the file in Preview and select "Save as..." from the File menu. Select "Reduce File Size" from the Quartz Filter menu and save. The size probably won't be reduced enough, though. You may have to split the file into several parts and mail them separately. Or upload it to a web server and send the link.

  • Changing the file name of a PDF you send via email

    Hello Support,
    I am trying to find out how to change the file name of the attachment I send via email when I click submit via email. I would like the file to be sent with the file name, not some other file name.
    How can I fix it? This is very urgent! I need HELP!
    Cheers
    Joel
    Message was edited by: J Braden

    Hi,
    you can't.
    Except you save the file under a different name before you send it.

  • To send output as a PDF attachment via email

    Hi experts
    I have the (smartform) output data in OTF format..and displaying it in PDF form with FM 'HR_EFI_SHOW_PDF_FORM' .
    Now the requirement is <b>to send this output as a PDF attachment via email</b>.
    Please help me with sample code to perform this.
    Regards,
    Matt.

    Hi,
    Check this links,
    /people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
    Also for email:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
    Refer the following link for more details:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Thanks,
    Reward If Helpful.

  • Create a form without the option to submit or send via email

    Just oant to know is it posible to create a form without the option to submit or send via email. I want my students to fill in the form and save it to a personal folder. The submit form button creates confusion.

    Many thanks Randy, I'll give it a go. But it means setting up the how to pay question at the top of the form. Currently we have it setup at the bottom.
    Think I can do a "Will you be paying by credit card?" check box at the top - Tick equal show Fields A (which I have already mapped to the payment option) and Unchecked Show Fields B.
    Sound logical..will be cumbersome though as there are 12 mult show/hide fileds in there already  here's the link just for the original form for future reference for anyone in the forum wanting to see what the form looks like and is facing the same problem.
    Will make the changes in a quiet perios and anyone interested can take a look next week and see how I got on.
    Appreciate your response Randy
    Roger

  • I have been able to open pdfs created in older versions of adobe, but not the newest version. Is anyone having issues opening PDFs sent via email created in version 9?

    I have been able to open pdfs created in older versions of adobe, but not the newest version. Is anyone having issues opening PDFs sent via email created in version 9? If so, what was your solution? I have PDF reader app as well.

    Can you open the files in Preview?

  • How can i reduce the pdf file size? I need to send via email, at the moment its at 10mb

    How can i reduce the pdf file size? I need to send via email, at the moment its at 10mb

    Reducing PDF file size or Optimizing PDF is the feature that is supported only by Acrobat Pro (desktop app that is not free).
    Optimizing PDFs (Acrobat Pro)
    Free Adobe Reader products (Reader XI desktop, Reader for iOS, Reader for Android, Reader Touch for Windows 8, etc) do not offer the capability.

  • Convert Script to PDF using RVADOPFO, w/o using spool and send via email

    I want to convert output type script to pdf using the standard include RVADOPFO in the program. The output type is defined as medium '5' and comm starategy is also defined as INT(email) as want to send the output via email.
    Now the Include RVADOPFO contains ADDR_KEY-ADDRNUMBER & ADDR_KEY-PERSNUMBER. Where to maintain this info and how to pass in the include..below code is in the include..
    IF NOT NAST-TCODE IS INITIAL AND NAST-NACHA EQ '5'.
      ... use stratagy to get communication type
        CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
             EXPORTING
                  STRATEGY           = NAST-TCODE
                ADDRESS_TYPE       =
                ADDRESS_NUMBER     = VBDKA-ADRNR
                PERSON_NUMBER      = VBDKA-ADRNP
                  ADDRESS_NUMBER     = ADDR_KEY-ADDRNUMBER
                  PERSON_NUMBER      = ADDR_KEY-PERSNUMBER
             IMPORTING
                  COMM_TYPE          = LVS_COMM_TYPE
                  COMM_VALUES        = LVS_COMM_VALUES
           TABLES
                STRATEGY_TABLE     =
             EXCEPTIONS
                  ADDRESS_NOT_EXIST  = 1
                  PERSON_NOT_EXIST   = 2
                  NO_COMM_TYPE_FOUND = 3
                  INTERNAL_ERROR     = 4
                  PARAMETER_ERROR    = 5
                  OTHERS             = 6.
    Please provide solution asap. Thanks in advance

    Hi,
    Check this links:
    Sending Mail from SAP
    https://wiki.sdn.sap.com/wiki/display/sandbox/SendMailwithPDFAttachment?showChildren=false#children
    Thanks.

  • Reg: Converting Standard Payslip (PC00_M99_CEDT) to PDF and send via email

    Dear Experts,
    Please provide me a solution to convert the standard Pay slip (PC00_M99_CEDT) Remuneration statement to PDF and send it via email to individual employee by fetching the email ids through the info types.
    I checked the forum, few answers our complete but they have not given the solution.
    Thanks in advance
    Abdur
    Moderator message: moved to requirements forum (points-free!)
    Edited by: Thomas Zloch on Feb 7, 2011 11:53 AM
    Moderator message: moved back to ABAP General.
    Edited by: Thomas Zloch on Feb 9, 2011 1:03 PM

    Dear Experts,
    As suggested, I have written the below code.
    REPORT  ztest_period.
    DATA : td_listobject LIKE abaplist OCCURS 0 WITH HEADER LINE.
    DATA: txtlines(1024) TYPE c OCCURS 0 WITH HEADER LINE.
    DATA: list_tab TYPE TABLE OF abaplist,
          lt_objbin TYPE TABLE OF solisti1 WITH HEADER LINE.
    SUBMIT rpcedtx0 VIA SELECTION-SCREEN EXPORTING LIST TO MEMORY AND RETURN.
    CLEAR td_listobject. REFRESH td_listobject.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = td_listobject
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    CHECK sy-subrc = 0.
    CALL FUNCTION 'TABLE_COMPRESS'
    TABLES
    in = td_listobject
    out = lt_objbin
    EXCEPTIONS
    compress_error = 1
    OTHERS = 2.
    &code&
    I'm getting the raw data from FM 'LIST_FROM_MEMORY' Please tell me how should i convert it to normal data.
    Once i get the data, I need to send an email for individual personnel number for the respective month.
    Please advice me the next step.
    Thanks and Regards,
    Abdur Rafique
    Edited by: abdur rafique on Feb 21, 2011 11:39 AM

  • Keeping PDF form format when sending via email

    Hello, I have created a form using Adobe LiveCycle.  It contains a submit button to send the filled out form to a recipient via email.  After numerous draft attempts the form gets converted into an .XML format when it is attached to a new email message.  I want the form to stay as a PDF but LiveCycle indicates the form would need to be sent to an HTTP address.  I don't have such an address.
    Is there some way to force the form to keep its PDF format and be sent via email by the push of a button?
    (I know that you can click File--attach to Email to but I would like to avoid that method).  Thank you.

    Q: Is there some way to force the form to keep its PDF format and be sent via email by the push of a button?
    A #1: Yes, you can use the standard button, set the format to "PDF" and supply the mailto:[email protected] and it will use the client side email software to attach and send the PDF. Note: You will need to enable usage rights on the PDF to allow Adobe Reader users to submit whole PDF format. Normally Adobe Reader users are only allowed to submit the data formats, XML and XDP for LiveCycle forms, and HTML, XFDF and FDF for Acroforms.
    A #2: You can also bypass client-side email software such as OUTLOOK, if you set the submit button action to a URL of a server-side script, such as PHP or ASP.Net. The script could generate an SMTP message, and attach the submission without the use of client-side email software. By using a server-side script, the PDF submission process is almost fool proof.
    View online examples for emailing PDF form submissions with a server-side script:
    http://www.pdfemail.net/examples/

  • Error opening PDF attachment (via email)

    Hello,
    I've problems to send a PDF file with the function:
    'SO_DOCUMENT_SEND_API1'
    At first a small overview of my process:
    - 'SCMS_DOC_READ'                 -> to read the file from the archive
    - 'SCMS_BINARY_TO_FTEXT'     -> to convert from bin. to pdf
    - 'SO_DOCUMENT_SEND_API1'  -> to send the email
    My pdf result:
    % P D F - 1 . 4  % â ã Ï Ó  1   0   o b j  < <  / T y p e
    Project scope:
    %PDF-1.4%âãÏÓ1 0 obj<</Type
    As a result, by opening the PDF file an error occured.
    Further information:
    objpack-transf_bin = 'X'.
      call function 'SO_DOCUMENT_SEND_API1'
        exporting
          document_data              = doc_data
          put_in_outbox              = ''
          commit_work                = 'X'
        tables
          packing_list               = objpack
          object_header              = objhead
          contents_bin               = data          <-  PDF content
          contents_txt               = objtxt
          receivers                  = reclist
        exceptions

    most possible reason has been discussed in:
    Error in opening PDF attachment

  • Smartform PDF sending as email

    Hi,
    I had a requirement like sending smartform o/p as PDF to multiple email-id's.
    I had used the FM's CONVERT_OTF and SO_NEW_DOCUMENT_ATT_SEND_API1 Function module's.
    Now I am able to receive the emails but unable to open the PDF document It is saying that the PDF was not decoded properly. Kindly help me out. I had also tried it using the GUI_DOWNLOAD after the CONVERT_OTF Function module. and was able to open the PDF format.
    Kindly help me out.
    Thanks & Regards,
    Sridhar.

    Compare your part of code with the below given code.
    *& Report YSSN_SIMPLE_SMARTFORM *
    report zhr_bhaskar_pdf_to_email message-id zmsg.
    parameters: p_vbeln type vbak-vbeln default '35'.
    data: it_items type table of vbap,
    v_fm_name type rs38l_fnam,
    v_tot_lines type i,
    v_sy_tabix type i,
    output_data type ssfcrescl. " To hold Output information
    constants:
    c_sep type c value '-', " Value -
    c_x type c value 'X', " Value X
    c_space type c value ' '. " Space
    *****MAIL START
    include .
    data: g_mail_rec_obj type swotobjid,
    g_mail_sen_obj type swotobjid,
    g_mail_app_obj type swotobjid,
    g_cont_par type ssfctrlop,
    folder type swc_object,
    begin of sofmfol_key,
    foldertype like sofm-foltp,
    folderyear like sofm-folyr,
    foldernumber like sofm-folno,
    type like sofm-doctp,
    year like sofm-docyr,
    number like sofm-docno,
    forwarder like soub-usrnam,
    end of sofmfol_key,
    bor_key like swotobjid-objkey,
    g_mail TYPE ppfdmailad VALUE '[email protected]',
    g_mail type so_name value '[email protected]',
    g_mail TYPE ppfdmailad VALUE '[email protected]' ,
    g_mail TYPE ppfdmailad VALUE '[email protected]' ,
    g_rectype type so_escape value 'U'. " 'B'.
    data: job_output_info type ssfcrescl,
    hotfdata like itcoo occurs 1 with header line,
    htline like tline occurs 1 with header line,
    x_objcont like soli occurs 1 with header line,
    ld_packing_list like soxpl occurs 1 with header line,
    x_object_hd_change like sood1 occurs 1 with header line,
    x_objhead like soli occurs 1 with header line,
    x_receivers like soos1 occurs 1 with header line,
    format_pdf(10) value 'PDF',
    doc_size(12) type c,
    hltlines type i,
    htabix like sy-tabix,
    fle1(2) type p,
    fle2(2) type p,
    off1 type p,
    hfeld(500) type c.
    tables: soud.
    *****MAIL END
    select *
    into table it_items
    from vbap
    where vbeln = p_vbeln.
    if it_items[] is initial.
    exit.
    endif.
    perform call_smartform.
    *& Form call_smartform
    text
    --> p1 text
    <-- p2 text
    form call_smartform .
    *DATA: lx_control_parameters TYPE SSFCTRLOP,
    lx_OUTPUT_OPTIONS type SSFCOMPOP.
    lx_OUTPUT_OPTIONS-TDIMMED = ' '.
    lx_OUTPUT_OPTIONS-TDfinal = 'X'.
    lx_OUTPUT_OPTIONS-TDDELETE = 'X'.
    lx_CONTROL_PARAMETERS-NO_CLOSE = 'X'.
    lx_CONTROL_PARAMETERS-NO_OPEN = ' '.
    data: x_ssfcompop type ssfcompop,
    x_ssfctrlop like ssfctrlop,
    x_ssfcrescl type ssfcrescl.
    **MAIL
    g_cont_par-langu = sy-langu.
    g_cont_par-no_dialog = 'X'.
    g_cont_par-getotf = 'X'.
    g_cont_par-device = 'MAIL'.
    Get BOR-Objects for Recipient, Sender und Applikation
    perform mail_recipient_object changing g_mail_rec_obj.
    perform mail_sender_object changing g_mail_sen_obj.
    perform mail_appl_object changing g_mail_app_obj.
    **MAIL
    *--Internal table is having more than 1 record
    if v_tot_lines gt 1.
    if v_sy_tabix = 1.
    *--For first record of table
    x_ssfctrlop-no_open = c_space.
    x_ssfctrlop-no_close = c_x.
    elseif v_sy_tabix = v_tot_lines.
    *--For last record of table
    x_ssfctrlop-no_open = c_x.
    x_ssfctrlop-no_close = c_space.
    else.
    x_ssfctrlop-no_open = c_x.
    x_ssfctrlop-no_close = c_x.
    endif.
    endif.
    IF r_previ = c_x.
    x_ssfctrlop-preview = c_x.
    x_ssfctrlop-getotf = c_x.
    ENDIF.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'YSSN_SMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    importing
    fm_name = v_fm_name
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3
    if sy-subrc <> 0.
    message i000 with 'Smart form module name failure'.
    exit.
    endif.
    CALL FUNCTION '/1BCDWB/SF00000199'
    call function v_fm_name
    exporting
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = g_cont_par
    mail_appl_obj = g_mail_app_obj
    mail_recipient = g_mail_rec_obj
    mail_sender = g_mail_sen_obj
    OUTPUT_OPTIONS = lx_OUTPUT_OPTIONS
    USER_SETTINGS = 'X'
    t_vbap = it_items
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = job_output_info
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    perform send_pdf_mail.
    endform. " call_smartform
    *& Form send_pdf_mail
    text
    --> p1 text
    <-- p2 text
    form send_pdf_mail .
    data ld_binfile type xstring.
    pdf_table type rcl_bag_tline,
    data: ld_originator like soos1-recextnam.
    convert form
    loop at job_output_info-otfdata into hotfdata.
    append hotfdata.
    endloop.
    call function 'CONVERT_OTF'
    exporting
    format = format_pdf
    max_linewidth = 132
    importing
    bin_filesize = doc_size
    bin_file = ld_binfile
    tables
    otf = output_data-otfdata
    lines = htline
    exceptions
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    others = 4.
    *-Itab 134 Zeichen nach 255 Zeichen überführen
    describe table htline lines hltlines.
    describe field htline length fle1 in character mode.
    describe field x_objcont length fle2 in character mode.
    loop at htline.
    htabix = sy-tabix.
    move htline to hfeld+off1.
    if htabix = hltlines.
    fle1 = strlen( htline ).
    endif.
    off1 = off1 + fle1.
    if off1 ge fle2.
    clear x_objcont.
    x_objcont = hfeld(fle2).
    append x_objcont.
    shift hfeld by fle2 places.
    off1 = off1 - fle2.
    endif.
    if htabix = hltlines.
    if off1 gt 0.
    clear x_objcont.
    x_objcont = hfeld(off1).
    append x_objcont.
    endif.
    endif.
    endloop.
    x_object_hd_change-objnam = 'EMAIL'.
    x_object_hd_change-objdes = 'Smart Form'.
    x_object_hd_change-objla = sy-langu.
    x_object_hd_change-objsns = 'O'.
    x_object_hd_change-objlen = doc_size.
    x_object_hd_change-file_ext = 'TXT'.
    ld_packing_list-transf_bin = 'X'.
    ld_packing_list-head_start = 1.
    ld_packing_list-head_num = 0.
    ld_packing_list-body_start = 1.
    describe table x_objcont lines ld_packing_list-body_num.
    ld_packing_list-objtp = 'EXT'.
    ld_packing_list-objdes = 'Smart Form'.
    ld_packing_list-objla = sy-langu.
    ld_packing_list-objlen = doc_size.
    ld_packing_list-file_ext = 'PDF'.
    append ld_packing_list.
    x_receivers-recextnam = g_mail.
    x_receivers-recesc = 'E'.
    x_receivers-sndart = 'INT'.
    append x_receivers.
    ld_originator = '[email protected]'.
    ld_originator = FSABE-USRNAM.
    call function 'SO_OBJECT_SEND'
    exporting
    object_hd_change = x_object_hd_change
    object_type = 'RAW'
    originator_type = 'B' "Einfügen
    originator = ld_originator "Einfügen
    tables
    objcont = ld_text
    receivers = x_receivers
    packing_list = ld_packing_list
    att_cont = x_objcont
    att_head = x_objhead
    exceptions
    active_user_not_exist = 1
    communication_failure = 2
    component_not_available = 3
    folder_not_exist = 4
    folder_no_authorization = 5
    forwarder_not_exist = 6
    note_not_exist = 7
    object_not_exist = 8
    object_not_sent = 9
    object_no_authorization = 10
    object_type_not_exist = 11
    operation_no_authorization = 12
    owner_not_exist = 13
    parameter_error = 14
    substitute_not_active = 15
    substitute_not_defined = 16
    system_failure = 17
    too_much_receivers = 18
    user_not_exist = 19
    x_error = 20
    others = 21.
    endform. " send_pdf_mail
    *& Form mail_sender_object
    text
    <--P_G_MAIL_SEN_OBJ text
    form mail_sender_object changing p_mail_sen_obj.
    call function 'CREATE_SENDER_OBJECT_PPF'
    exporting
    ip_sender = sy-uname
    importing
    ep_sender_id = p_mail_sen_obj
    exceptions
    invalid_sender = 1
    others = 2.
    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. " mail_sender_object
    *& Form mail_appl_object
    text
    <--P_G_MAIL_APP_OBJ text
    form mail_appl_object changing p_mail_app_obj.
    SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.
    ENDSELECT.
    IF sy-subrc NE 0.
    call function 'SO_USER_AUTOMATIC_INSERT'
    exporting
    sapname = sy-uname
    exceptions
    no_insert = 1
    sap_name_exist = 2
    x_error = 3
    others = 4.
    if sy-subrc ne 0.
    clear soud.
    else.
    select * from soud where sapnam like sy-uname and deleted = ' '.
    endselect.
    endif.
    ENDIF.
    clear sofmfol_key.
    sofmfol_key-type = 'FOL'.
    sofmfol_key-year = soud-inbyr.
    sofmfol_key-number = soud-inbno.
    bor_key = sofmfol_key.
    if not bor_key is initial.
    swc_create_object folder 'SOFMFOL' bor_key.
    if sy-subrc = 0.
    swc_object_to_persistent folder p_mail_app_obj.
    if sy-subrc ne 0.
    clear p_mail_app_obj.
    endif.
    endif.
    else.
    clear p_mail_app_obj.
    endif.
    endform. " mail_appl_object
    *& Form mail_recipient_object
    text
    <--P_G_MAIL_REC_OBJ text
    form mail_recipient_object changing p_mail_rec_obj.
    call function 'CREATE_RECIPIENT_OBJ_PPF'
    exporting
    IP_COUNTRY =
    IP_FAXNO =
    ip_mailaddr = g_mail
    ip_type_id = g_rectype " 'U'
    importing
    ep_recipient_id = p_mail_rec_obj
    EP_ADDRESS =
    ET_RECIPIENT =
    exceptions
    invalid_recipient = 1
    others = 2.
    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. " mail_recipient_object

  • I can no longer send a Pages document.  When I click Share my Send Via Email is grayed out.  When I click on pdf or any format the pull down screen disappears and nothing happens.  Why?  I am using an iMac with Mountain Lion.

    I can no longer email a Pages document.  When I click Share my Share Via Email is grayed out.  If I click pdf the window disappears and nothing happens.  Any ideas?

    Do you have the application Mail as the default mail application?

  • No Payment document attachement (PDF) sent via email

    Hi,
    We have been running the auto-email with PDF payment attachement via F110 for quite some times. Recently my user feedback that some of the vendors receive the email sent by SAP system, however, no attachement being sent to them.
    I have checked the F110 log, which the requested email is generated successfully. However, i couldn't check whether there is email attachement being to them via SOST.
    We are in ECC6. The reported cases are perhaps 5% of the batch payment document running affected with no pdf file attachement sent via email.
    I have been searching around any similar case and how we trace the problem. Can someone share on it?
    Thank you very much in advance.

    Hi
    Ask to these vendor what kind of software they have to avoid SPAM, or if they manage black lists, 'grey' list. There are other software tools managing these messages. Sometimes these tools remove the attachments.
    I hope this helps you
    Regards
    Eduardo
    Edited by: E_Hinojosa on Dec 16, 2011 10:22 AM

Maybe you are looking for

  • CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN .

    Hi all, i hope there is someone that can help me. My problem is: in an ABAP custom report in a FORM user-command my code is   CASE ls_selfield-sel_tab_field.     WHEN 'ITAB-BELNR'.       IF NOT ls_selfield-value IS INITIAL.         SET PARAMETER ID '

  • Keyboard layout indicator in gnome panel, red icon instead of letters

    See the image, red round icon is the keyboard notification, but it shoud be ( or was ) letters. Any idea how to change the icon back to letters? I have 2 layouts, changing gtk theme or icon theme doesn't help. Thanks. Last edited by gofree (2010-09-2

  • Basic output question

    i am in an intro to java class and had to write a program that calculates 12 factorial. i wrote the program, and it works perfectly, but my professor says it has no output. please PLEASE explain to me why the output isnt System.out.println whatever.

  • Cs 5.5 installer installs version 5.1 for some applications

    creative suite 5.5 installer installs version 5.1 for photoshop, illustrator and fireworks. works perfectly loading 5.5 for everything else. how do i fix this?

  • XML - ORA-19025: EXTRACTVALUE returns value of only one node

    Hi, I am new to XML DB. Can somebody help me with the below XML I use the following XML ... (I have pasted only a part of it coz i require data only till this section ) XML <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http