SEND SPOOL REPORT AS E-MAIL

Hi,
How do I send a spool report as an e-mail?
NOT as PDF file.
If we can send it as a text file that would also be fine, but preferably as a Spool report as it is (non-editable).

Hi,
  Have a look at this code...
z_send_email_fax_global
FUNCTION-POOL z_gfaian_mail_fax. "MESSAGE-ID ..
WORK TABLE AREAS
TABLES: tsp01.
INTERNAL TABLES
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
file(60) TYPE c,
END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
g_document LIKE sood4,
g_header_data LIKE sood2,
g_folmem_data LIKE sofm2,
g_header_data LIKE sood2,
g_receive_data LIKE soos6,
g_ref_document LIKE sood4,
g_new_parent LIKE soodk,
l_folder_id LIKE sofdk,
v_email(50).
DATA: hd_dat like sood1.
VARIABLES
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
store_flag LIKE sonv-flag,
delete_flag LIKE sonv-flag,
owner LIKE soud-usrnam,
on LIKE sonv-flag VALUE 'X',
sent_to_all LIKE sonv-flag,
g_authority LIKE sofa-usracc,
w_objdes LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
=================================================================================
z_send_email_fax2
FUNCTION z_faian_mail_fax2.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
*" TABLES
*" LT_BODY_EMAIL STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
Fist part: Verify if the spool really exists
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc NE 0.
RAISE err_no_abap_spooljob. "doesn't exist
ELSE.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = lt_body_email
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
CLEAR lt_rec_tab.
lt_rec_tab-sel = 'X'.
lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
lt_rec_tab-recnam = 'U-'.
lt_rec_tab-deliver = 'X'.
lt_rec_tab-not_deli = 'X'.
lt_rec_tab-read = 'X'.
lt_rec_tab-mailstatus = 'E'.
lt_rec_tab-adr_name = fax_mail_number.
lt_rec_tab-sortfield = fax_mail_number.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-sortclass = '5'.
APPEND lt_rec_tab.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-recesc = object_type.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
lt_files-file = c_file.
APPEND lt_files.
begin of insertion by faianf01
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
end of insertion by faianf01
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
check_send_authority = 'X'
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDIF.
ENDFUNCTION.
=================================================================================
z_send_email_fax
FUNCTION ZCBFS_SEND_MAIL.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" TABLES
*" LIST_FAX_MAIL_NUMBER STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
DATA: vg_achou(1) TYPE n.
Fist part: Verify if the spool really exists
vg_achou = 1.
DO 60 TIMES.
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc IS INITIAL.
CLEAR vg_achou.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.
IF vg_achou = 1.
RAISE err_no_abap_spooljob. "doesn't exist
ENDIF.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
LOOP AT LIST_FAX_MAIL_NUMBER.
lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
lt_rec_tab-recesc = 'U'.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
ENDLOOP.
lt_files-file = c_file.
APPEND lt_files.
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDFUNCTION.
Please check this links for sample code.
http://www.sap-basis-abap.com/sapac018.htm
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
Regards

Similar Messages

  • How to send a report via e-mail

    Hello All,
               I want to send a report via e-mail.
               What should I do for that?
                Please help me out...
    Regards,
    Ravi Khattar.

    Hi,
      Please check the below code....
    data: t_objpack    like sopcklsti1 occurs 1 with header line,
            t_objhead    like solisti1   occurs 1 with header line,
            t_objtxt     like solisti1   occurs 0 with header line,
            t_objbin     like solisti1   occurs 1 with header line,
            t_reclist    like somlreci1  occurs 1 with header line,
            t_lobj       like abaplist   occurs 0 with header line,
            t_listobj    like abaplist   occurs 1 with header line.
      data: v_tab_line1  type i,
            v_tab_line2  type i,
            v_docsize    type i,
            v_len        type i,
            v_line(1250) type c,
            v_subj(132)  type c,
            v_cr(1)      type x value '0D',
            v_linefd(2)  type x value '0D0A',
            v_docdata    like sodocchgi1.
      clear: t_objpack[], t_objhead[], t_objtxt[], t_reclist[], t_listobj[].
      concatenate 'This email is generated from a SAP' sy-sysid '-'
         sy-mandt '- batch environment.' into t_objtxt separated by ' '.
      append t_objtxt.
      t_objtxt = 'Please do not respond to this email.'. append t_objtxt.
      v_docdata-obj_name = 'SAMPLE_TEST'.
      concatenate 'Sales Order Status Attachment -' sy-datum '-' sy-uzeit
             into v_subj separated by ' '.
      v_docdata-obj_descr = v_subj.
      describe table t_objtxt lines v_tab_line1.
      read table t_objtxt index v_tab_line1.
      v_docdata-doc_size   = ( v_tab_line1 - 1 ) * 255 + strlen( t_objtxt ).
      t_objpack-head_start = 1.
      t_objpack-head_num   = 1.
      t_objpack-body_start = 1.
      t_objpack-body_num   = v_tab_line1.
      t_objpack-doc_type   = 'RAW'.
      append t_objpack.
      clear v_line.
      if p_type = '1'.
        loop at t_list.
          concatenate v_line t_list v_linefd into v_line.
          v_len = strlen( v_line ).
          do 4 times.
            if v_len ge 255.
              if v_line+254(1) = v_cr.
                v_line255     = v_line254.
                v_line+254(1)  = ' '.
              endif.
              t_objtxt = v_line(255).
              v_line   = v_line+255.
              v_len    = v_len - 255.
              append t_objtxt.
            else.
              exit.
            endif.
          enddo.
        endloop.
        if v_line ne ' '.
          t_objtxt = v_line(255).
          append t_objtxt.
        endif.
        describe table t_objtxt lines v_tab_line2.
        t_objpack-doc_size   = ( v_tab_line2 - v_tab_line1 ) * 255.
        t_objpack-body_start = v_tab_line1 + 1.
        t_objpack-transf_bin = ' '.
        t_objpack-doc_type   = 'TXT'.
      else.
        t_objbin[] = html[].
        describe table t_objbin lines v_tab_line2.
        t_objpack-doc_size   = v_tab_line2 * 255.
        t_objpack-body_start = 1.
        t_objpack-transf_bin = 'X'.
        t_objpack-doc_type   = 'HTM'.
      endif.
      t_objpack-head_start = 1.
      t_objpack-head_num   = 1.
      t_objpack-body_num   = v_tab_line2.
      t_objpack-obj_name   = 'SAMPLE_TEST'.
      t_objpack-obj_descr  = 'Test'.
      append t_objpack.
      loop at s_email.
        t_reclist-receiver = s_email-low.
        t_reclist-rec_type = 'U'.
        append t_reclist.
      endloop.
      t_reclist-receiver   = sy-uname.
      t_reclist-rec_type   = 'B'.
      append t_reclist.
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data = v_docdata
                put_in_outbox = ' '
           TABLES
                packing_list  = t_objpack
                object_header = t_objhead
                contents_bin  = t_objbin
                contents_txt  = t_objtxt
                receivers     = t_reclist.
      if sy-subrc = 0.
       endif.
    Cheers,
    Bujji

  • Schedule Send Execl Report by E-mail to System User

    Hello:
       I need to schedule send Excel Report by E-mail to system user internet address. If only define the job by Reprot Agent? Do we have other method?
    Hope this clear!Can you give some advice?
    Regards&Thanks
    zagory

    Hi zagory,
    i forgot one tech issue to be setup: The internet Mail gateway needs to be setup if you want to send proper e-mails.
    presupposed all tech. issues are solved, I agree with my colleague. Setup is fairly easy to handle, as soon as you know the customers demands like
    - who is allowed to send
    - who will do it in the future
    - who are the recipients
    - when should the precalc. take place/when should the Workbook be executed (Timepoints, after dataupdate ...)
    for authorisations check out object: s_rs_bcs.
    also make sure that the executor has permissions for the backgroud user (serach in TRC SU21, i can not remember.)
    if all is known = approx. 2-3 days until go live, depending on the complexity of the existing scheduling and the authorisation concept.
    Not to mention the training for all that and the tchnical setup.
    hth
    cheers
    Sven

  • How to send ALV report Output through mail in background !

    Hi ,
    I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background and the out put of the report should be mailed to particular email ids in background itself. How can i do this ?
    Is there and method or setting through which we can do this ?
    Regards

    Hi Nau,
    For this requirement you will have to write another program.
    This program will convert the spool requests into PDF document and sends an email  to the recipients that you specify.
    These are the threads which are already posted in The SDN.
    *http://wiki.sdn.sap.com/wiki/display/Snippets/Converts+spool+request+into+PDF+document+and+emails*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="353650"></a>*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="902985"></a>*
    You need to use the Function module :
    -- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    I will provide you with the code to get this functionality.
    *&      Form  SEND_EMAIL
    form SEND_EMAIL .
    DATA:   t_mailpack   TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
              t_mailhead   TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailbin    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailtxt    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailrec    TYPE somlreci1  OCCURS 0 WITH HEADER LINE.
      DATA: wa_maildata    TYPE sodocchgi1,
            l_filename(50) TYPE c,
            l_fldname(30)  TYPE c,
            l_fldval(100)  TYPE c,
            l_lines        TYPE i,
            l_text         TYPE text128 .
      DATA: w_email_subrc  TYPE i.
      DATA: w_ship like vbfa-vbeln.
      CLEAR: wa_maildata,
             t_mailtxt,
             t_mailbin,
             t_mailpack,
             t_mailhead,
             t_mailrec.
      REFRESH: t_mailtxt,
               t_mailbin,
               t_mailpack,
               t_mailhead,
               t_mailrec.
    *-- Fill output file
    *- Fill header
      CLEAR: t_mailbin.
    *  t_mailbin[] = pdf_tab[].
      t_mailbin[] = it_att[].     "Uthaman
    *This line is added to get the shipment no in Subject Line
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    w_ship = vbfa-vbeln.
    shift w_ship left deleting leading '0'.
    *-- File name
    if nast-kschl EQ 'ZFPL'.
      CLEAR l_filename.
      CONCATENATE 'Packing List -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF' INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Packing List'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    if nast-kschl EQ 'ZFBA'.
      CLEAR l_filename.
      CONCATENATE 'Booking Advice -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF'
                  INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Booking Advice'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    *-- Prepare Packing List
    *-- Write Packing List (Main Subject)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE t_mailtxt LINES l_lines.
    *  READ TABLE t_mailtxt INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailtxt ).
    *  CLEAR t_mailpack-transf_bin.
      t_mailpack-transf_bin = ' '.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 0.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'RAW'.
      APPEND t_mailpack.
      t_mailhead = l_filename.
      APPEND t_mailhead.
    *-- Write Packing List (Attachment)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE pdf_tab[] LINES l_lines.
    *  READ TABLE pdf_tab INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailbin ).
      t_mailpack-transf_bin = 'X'.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 1.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'PDF'.
      t_mailpack-obj_name = l_filename.
      t_mailpack-obj_descr = l_filename.
      t_mailpack-obj_langu = 'E'.
      APPEND t_mailpack.
    *-- Set recipients
    tables :  ztotcemail.
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    CLEAR vttk.
    SELECT SINGLE * FROM vttk WHERE tknum EQ vbfa-vbeln.
    SELECT SINGLE * FROM ztotcemail WHERE tplst = vttk-tplst
                                      AND lifnr = vttk-tdlnr.
    IF SY-SUBRC EQ 0.
      t_mailrec-receiver = ztotcemail-smtp_addr. "'Here you will give the email address'.
      t_mailrec-rec_type  = 'U'.
      APPEND t_mailrec.
    ENDIF.
    **-- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_maildata
          put_in_outbox              = 'X'
    *      commit_work                = 'X'  " N-16
        TABLES
          packing_list               = t_mailpack
          object_header              = t_mailhead
          contents_bin               = t_mailbin[]
          contents_txt               = t_mailtxt[]
          receivers                  = t_mailrec
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      w_email_subrc = sy-subrc.
      IF sy-subrc EQ 0.
        MESSAGE s000(zotc) WITH 'Email output sent successfully'.
      ELSE.
        MESSAGE s000(zotc) WITH 'Can not send email output'.
      ENDIF.
    endform.                    " SEND_EMAIL
    Hope the above information will be helpful.
    Regards,
    Kittu

  • How to send BIP report link by mail not the attachment.

    Hi,
    I have a requiment to send the BI Publisher report link by mail.But not to send the report as an attachment.
    can any one have solution for this requirement.

    hi,
    Alternatively, u can do this Send a report with all the report names on one side and another side link to that particular report.If any one click on that link means it will open the report(pdf/html/excel) format by referring to the url.we will get this by using RTF Template.
    Thanks,
    Saichand

  • Send Crystal Report publication via mail dynamically

    Hi!
    I want to achieve the following scenario:
    I have a Crystal Report within my BOE 3.1 system. Is it possible to trigger an event from an external system which indicates that the report on my server gets executed and will be sent to a specified user via email?
    I'm thinking of some kind of solution like OpenDocument - where I access the report via an URL, pass parameters to it, and the executed report will be displayed on the users screen. Now, I don't want to display the report on the user's screen, I want to send it to him via mail.
    Has anyone ever tried to implement such a kind of scenario? Does BOE offer web services which might help me to achieve my scenario?
    thank you,
    Dominik

    Hi Dominik,
    Yes, that is something that you can do using the SDK.
    The idea is that when your user clicks on the button, it will generate a new schedule to run now and with email destination.
    There are few examples in the SDK. You can start with this KB:
    1203257 - How to schedule a Web Intelligence document with prompts using the Enterprise Java SDK
    The main URL with SDK Documentation is:
    http://www.sdn.sap.com/irj/sdn/bi-sdklibrary
    One of the first things you have to know is to choose the right SDK for your project. You will find a quick approach in the following links:
    http://devlibrary.businessobjects.com/BusinessObjectsXI3/en/diagrams/bosdks_overview_121_en.pdf
    and
    http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b625a7
    Because you are thinking to do something related with scheduling you should focus in the Enterprise SDK.
    http://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/a09374f5-a982-2b10-0297-85c67690b4f2
    A collection of samples can be found here:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/JavaBusinessObjectsEnterpriseSDKSamples#JavaBusinessObjectsEnterpriseSDKSamples-Scheduling
    And a specific sample to run now and schedule:
    https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/405a1725-4b57-2c10-928e-c25c34a5cf43
    You will also find valuable information at see the following links:
    Our java wiki:
    http://wiki.sdn.sap.com/wiki/display/Java/JavaDevelopmentHome
    Our SDK external forum:
    http://forums.sdn.sap.com/
    I hope this helps you,
    Julian

  • Sending multiple reports thru single mail in Crystal reports server XI R2

    2)
    Ex:
    I have a crystal report  which takes country as input parameter. Each country has one responsible person.
    US--- A person
    UK---B person
    INDIA ---C person
    I need to run this report with these three paramters(may increase infuture) and send the exported report to A,B and C as an mail attachment through crystal reports server XI R2.
    I have achieved above with Java code and deployed that java code as JAR file in crystal reports server and scheduled this JAR file.
    Here I need to attach all these three attachments to single mail and send it to Manager. And also I need to wait till all the reports gets executed and then attach all the attachments to single mail.
    Please help me how to achieve this.
    I am using --- Crystal reports server XI R2
    Thanks,
    Vijay Kanth

    How are you creating the first three files, are you scheduling each to smtp, or are you waiting until they finish and emailing the instance through your jar file?
    If you are scheduling each one, and the instance in enterprise keeps a copy of the finished report, then you could monitor the status of the 3 jobs, once all finish you could get the report and email them out through your java code.  There wouldn't be a way to email all three reports as one email to the manager directly through the product.  You would be able to cc or bcc the manager on each, but then the manager would be receiving 3 emails.

  • Send Daily Reports via E-mail from MARS

    Hi!
    I want to know if the MARS can send via email daily reports to a specific account.
    Thanks for any help.

    well, you could start by logging into the MARS CLI as pnadmin. Use tcpdump to monitor the SMTP traffic.
    [pnadmin]$ tcpdump -X port 25
    Now select the report and click "resubmit". You should see the SMTP traffic to the mail server. You can probably troubleshoot by looking at the ASCII output from tcpdump. If not, look at the tcpdump output and at least make sure the connection is to the right IP address and that some data is exchanged after the initial TCP handshake. Now take a look at the mail server logs, which should give you an idea of what to do next.

  • How to send my report through e-mail

    Hello to All
    i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
    please send me the solution for the same.
    thanks.
    null

    Hello to All
    i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
    please send me the solution for the same.
    thanks.
    null

  • Send the Report output to email from spool

    Hi All,
    The following process which i am doing to send the report output(Executed in background) to my mail id.
    I ran the report in Background and got the output in the spool. i opened the spool from the transaction SM37 and send the output to my external mail id via the following process
    click Spool Request->forward-> send SAP data
    here i am getting one POP up in there i gave my mail id and tick the check box on Express and click copy.
    Now i received the output in my mail .
    By doing the above process in the Quality server i am receiving the output in the mail as a PDF format that is correct.(Output is also correct).
    But when i execute the same in production server i am receiving the output in the mail as HTML format. (output and format is totally wrong). I want to know why its coming as HTML format instead of PDF format.
    Kindly help me regarding this.. Any configuration is there? If yes please let me know soon..
    Regards,
    Navaneeth...

    Hi,
    use scon, double-click on SMTP, select internet
    and compare the types of you both SAP-Systems.
    Hope it helps.
    Regards, Dieter

  • Very urjent how to send report output in mail

    hi experts,
    how to send report output in mail which function module should i use wht parameters should i pass.
    thanks in addavnce,
    points to be awarded.

      CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
                destination    = '026c'
                copies         = count
                list_name      = 'VATS_ASBUILT'
                list_text      = v_list
                immediately    = 'X'
                release        = 'X'
                new_list_id    = 'X'
                expiration     = days
                line_size      = 132
                line_count     = 65
                layout         = 'X_65_132'
    *            sap_cover_page = 'X'
    *            cover_page     = 'X'
                receiver       = 'SAP*'
                department     = 'VATS'
                no_dialog      = 'X'
           IMPORTING
                out_parameters = params
                valid          = valid.
      SUBMIT zppr_vats_asbuilt  WITH p_aufnr EQ v_aufnr
                   TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                      SPOOL PARAMETERS params
                         AND RETURN.
      SELECT SINGLE rqident FROM tsp01 INTO l_spoolno
                         WHERE rqtitle = v_list .
    * convert report to PDF format
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = l_spoolno
                no_dialog                = 'X'
           TABLES
                pdf                      = l_ipdf
           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.
        EXIT .
      ENDIF.
    Now comes the part to send the mail
      try.
    * -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
          clear document.
    * -------- create and set document with attachment ---------------
    * create document from internal table with text
          document = cl_document_bcs=>create_document(
          i_type = 'RAW'
          i_text = text
          i_length = '12'
          i_subject = '' ).
    *changing the content of the attachment
          binary_content[] = l_iobjbin[].
    *change the name of the PDF attachment
          concatenate 'Build ID' s_buildid_i 'Rev' v_buildid_rev
                              into i_att_sub separated by space.
    * add attachment to document
          call method document->add_attachment
            exporting
              i_attachment_type    = 'PDF'
              i_attachment_subject = i_att_sub
              i_att_content_hex    = binary_content.
    *setting the option to send an e-mail more than 50 characters
          call method send_request->set_message_subject
            exporting
              ip_subject = t_sub.
    * add document to send request
          call method send_request->set_document
            exporting
              i_document = document.
    * --------- set sender -------------------------------------------
    * note: this is necessary only if you want to set the sender
    * different from actual user (SY-UNAME). Otherwise sender is
    * set automatically with actual user.
          sender = cl_sapuser_bcs=>create( 'VATSUPPORT' ).
          call method send_request->set_sender
            exporting
              i_sender = sender.
    *Send the list based on receivers list obtained
          loop at l_ireclist.
            AD_SMTPADR = l_ireclist-receiver.
    * --------- add recipient (e-mail address) -----------------------
    * create recipient - please replace e-mail address !!!
          recipient = cl_cam_address_bcs=>create_internet_address(
          AD_SMTPADR ).
    * add recipient with its respective attributes to send request
          call method send_request->add_recipient
            exporting
              i_recipient = recipient
              i_express   = 'X'.
          ENDLOOP.
          call method send_request->set_status_attributes
            exporting
              i_requested_status = 'E'
              i_status_mail      = 'E'.
    * To send the mail immediately
          call method send_request->set_send_immediately( 'X' ).
    * ---------- send document ---------------------------------------
          call method send_request->send( ).
          commit work.

  • Sendin Spool reports to an e-mail address.

    Just wondering how one would go about developing a process to look for a specific spool report and send it to a specific e-mail address.  I would place the reports and associated e-mail address in a Z table to be maintained by a user group.  I have no clue on how to read the spool and collect a specific report to be sent via e-mail.  Any help or suggestions would be greatly appreciated.
    Thanks,
    Scott

    Here is some sample code.  This program takes the spool from a previous job step.  It converts this spool to PDF and then inserts this PDF as an attachment in an E-mail.
    * Program Name: KEG Job Sched Run with PDF Output Creation: 03/22/2001
    * SAP Name    : ZESU_JOB_RUN_WITH_PDF_OUTPUT      Application: U       *
    * Author      : Thomas Jung                       Type: 1              *
    * Description :  This Program will read the spool produced
    * by the specified previous job step and converts it to
    * PDF.  This PDF-Formatted report is then output to a file.            *
    * Inputs: File name, job step                                          *
    * Outputs: File formatted in PDF with the report output.               *
    * External Routines
    * FILE_GET_NAME
    * CONVERT_ABAPSPOOLJOB_2_PDF
    * CONVERT_OTFSPOOLJOB_2_PDF
    * Z_E_OPEN_FILE_FOR_OUTPUT_BIN
    * Z_E_WRITE_TO_FILE_WITH_LENGTH
    * SO_NEW_DOCUMENT_ATT_SEND_API1
    * BAPI_USER_GET_DETAIL
    * Return Codes:
    * The program uses the standard function modules for File manipulation
    * therefore it has all the standard error routines for Files.          *
    * Ammendments:                                                         *
    *    Programmer        Date     Req. #            Action               *
    * ================  ==========  ======  ===============================*
    * Thomas Jung       03/27/2001  ------  Initial Program.               *
    report  zesu_job_run_with_pdf_output message-id zes_job.
    * DATA DICTIONARY TABLES                                               *
    tables: raldb. "Transfer Structure for Logical Databases
    tables: tbtcp.
    tables: icon,   "Icons table
            bapiadsmtp, "BAPI structure for e-mail addresses (central
            bapiadpag.
    * TYPE POOLS                                                           *
    type-pools: sbdst.
    * CONSTANTS                                                            *
    constants: logical_file_name like filename-fileintern
                  value 'ZEX_STANDARD_FILENAME',
               pdf_ext(4) type c
                  value '.pdf',
               pdf_type(3) type c
                  value 'PDF',
               internet(1) type c
                  value 'U',
               dist_list(1) type c
                  value 'C',
               kimball_domain(12) type c value '@kimball.com'.
    constants: kim_ftp(80) type c
    value
    'ftp://kww.kog.kimball.com/webtools/acrobat_reader/acroread40w95.exe'.
    constants: ext_ftp(80) type c
    value
    'http://www.adobe.com/products/acrobat/readermain.html'.
    * VARIABLES                                                            *
    data: length type i.
    data: f4_field like trdir-name.
    data: pathleng type i,
          nameleng type i,
          physleng type i.
    data jselect like btcselect.
    data: report like sy-repid.
    data: doc_chng         like sodocchgi1.
    data: tab_lines        like sy-tabix.
    * INTERNAL TABLES                                                      *
    data: begin of html_tab occurs 0.
            include structure w3html.
    data: end of html_tab.
    data: icontab(32) occurs 10 with header line.
    data: itab like abaplist occurs   0 with header line.
    data: ipdf        like tline      occurs 0 with header line.
    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.
    * SELECTION SCREEN LAYOUT                                              *
    selection-screen begin of block one with frame title text-001.
    parameters: fileintn like filename-fileintern obligatory
                    default logical_file_name,
                filepath like rlgrap-filename lower case.
    parameters: file1    like rlgrap-filename obligatory lower case,
                physname like rlgrap-filename lower case.
    parameters: date1 as checkbox.
    parameters: time1 as checkbox.
    selection-screen end of block one.
    selection-screen begin of block two with frame title text-002.
    parameter: step like tbtcp-stepcount.
    parameter: abap radiobutton group one.
    parameter: oft  radiobutton group one.
    selection-screen end of block two.
    selection-screen begin of block three with frame title text-003.
    parameter: file  radiobutton group two.
    parameter: email radiobutton group two.
    selection-screen skip 1.
    parameter: int radiobutton group thre.
    parameter: dis radiobutton group thre.
    selection-screen skip 1.
    parameter: ext_user like somlreci1-receiver.
    selection-screen end of block three.
    * SELECTION SCREEN PROCESSING - OUTPUT                                 *
    at selection-screen output.
      perform filename_processing.
      loop at screen.
        if screen-name eq 'FILEPATH' or
           screen-name eq 'PHYSNAME'.
          screen-input = 0.
          modify screen.
        endif.
      endloop.
    * START OF SELECTION                                                   *
    start-of-selection.
      move sy-repid to report.
      perform auth_check.
      perform filename_processing.
      perform get_spool.
      perform convert_list_to_pdf.
      if file = 'X'.
        perform write_to_file.
      else.
        perform send_pdf_in_email.
      endif.
    *&      Form  filename_processing
    *       Prepair to conver to the logical file name to a physical name
    *  -->  p1        text
    *  <--  p2        text
    form filename_processing.
      perform get_filename using fileintn file1 physname.
      nameleng = strlen( file1 ).
      physleng = strlen( physname ).
      pathleng = physleng - nameleng.
      if pathleng > 0.
        filepath = physname(pathleng).
      endif.
    endform.                    " filename_processing
    *&      Form  get_filename
    *       Convert the logical file name into a physical file name
    *      -->P_FILEINTN  Input Logical File Name
    *      -->P_FILE1     Filename selected by input
    *      -->P_PHYSNAME  Output Physical File Name
    form get_filename using    p_fileintn
                               p_file1
                               p_physname.
      data: p_file2 like rlgrap-filename.
      clear p_file2.
      move p_file1 to p_file2.
      if date1 = 'X'.
        concatenate p_file2
                    sy-datum
                    into p_file2.
      endif.
      if time1 = 'X'.
        concatenate p_file2
                    sy-uzeit
                    into p_file2.
      endif.
      concatenate p_file2
                  pdf_ext
                  into p_file2.
      call function 'FILE_GET_NAME'
            exporting
              client                        = sy-mandt
              logical_filename              = p_fileintn
              operating_system              = sy-opsys
              parameter_1                   = p_file2
    *     PARAMETER_2                   = ' '
    *     PARAMETER_3                   = ' '
    *     USE_PRESENTATION_SERVER       = ' '
    *     WITH_FILE_EXTENSION           = ' '
    *     USE_BUFFER                    = ' '
            importing
    *     EMERGENCY_FLAG                =
    *     FILE_FORMAT                   =
              file_name                     = p_physname
            exceptions
              file_not_found                = 1
              others                        = 2
      if sy-subrc <> 0.
        message e001(zes_general) with sy-subrc.
      endif.
    endform.                    " get_filename
    *&      Form  write_to_file
    *       TRANSFER PDF DATA TO OUTPUT FILE
    *  -->  p1        text
    *  <--  p2        text
    form write_to_file.
      data: string_out type string.
      describe field objbin length length.
      call function 'Z_E_OPEN_FILE_FOR_OUTPUT_BIN'
           exporting
                filename1 = physname.
      loop at objbin.
        clear string_out.
        move objbin to string_out.
        call function 'Z_E_WRITE_TO_FILE_WITH_LENGTH'
             exporting
                  filename1        = physname
                  length           = length
                  please_open_file = 'NO'
                  string           = string_out.
      endloop.
    endform.                    " write_to_file
    *&      Form  convert_list_to_pdf
    *       Convert to Spool to PDF
    *  -->  p1        text
    *  <--  p2        text
    form convert_list_to_pdf.
      data: spool_id like tsp01-rqident.
      move tbtcp-listident to spool_id.
    ****Is this ABAP List Processing?
      if abap = 'X'.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
          exporting
            src_spoolid                    = spool_id
    *       NO_DIALOG                      =
    *       DST_DEVICE                     =
    *       PDF_DESTINATION                =
    *     IMPORTING
    *       PDF_BYTECOUNT                  =
    *       PDF_SPOOLID                    =
    *       LIST_PAGECOUNT                 =
    *       BTC_JOBNAME                    =
    *       BTC_JOBCOUNT                   =
          tables
            pdf                            = ipdf
         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 i016 with sy-subrc.
        endif.
      else.
    ****Or is this SAPscript?
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
          exporting
            src_spoolid                    = spool_id
    *       NO_DIALOG                      =
    *       DST_DEVICE                     =
    *       PDF_DESTINATION                =
    *     IMPORTING
    *       PDF_BYTECOUNT                  =
    *       PDF_SPOOLID                    =
    *       OTF_PAGECOUNT                  =
    *       BTC_JOBNAME                    =
    *       BTC_JOBCOUNT                   =
          tables
            pdf                            = ipdf
         exceptions
           err_no_otf_spooljob            = 1
           err_no_spooljob                = 2
           err_no_permission              = 3
           err_conv_not_possible          = 4
           err_bad_dstdevice              = 5
           user_cancelled                 = 6
           err_spoolerror                 = 7
           err_temseerror                 = 8
           err_btcjob_open_failed         = 9
           err_btcjob_submit_failed       = 10
           err_btcjob_close_failed        = 11
           others                         = 12.
        if sy-subrc <> 0.
          message i016 with sy-subrc.
        endif.
      endif.
      perform convert_pdf tables ipdf
                                 objbin.
    endform.                    " convert_list_to_pdf
    *&      Form  get_spool
    *   Read the job log to get the spool number for the specified step
    *  -->  p1        text
    *  <--  p2        text
    form get_spool.
      clear jselect.
    *jselect-jobname = '*'.
      jselect-username = '*'.
    ****Have this program get its own Job Name
      call function 'GET_JOB_RUNTIME_INFO'
           importing
    *         EVENTID                 =
    *         EVENTPARM               =
    *         EXTERNAL_PROGRAM_ACTIVE =
              jobcount                = jselect-jobcount
              jobname                 = jselect-jobname
    *         STEPCOUNT               =
           exceptions
                no_runtime_info         = 1
                others                  = 2.
    ****Read the spool number for this job step.
      clear tbtcp.
      select single listident from tbtcp
             into tbtcp-listident
             where jobname   = jselect-jobname
               and jobcount  = jselect-jobcount
               and stepcount = step.
      if tbtcp-listident = 0.
        message i009 with step.
      endif.
    endform.                    " get_spool
    *&      Form  convert_pdf
    *       Take the PDF information returned by the function module
    *       and convert it to a file readable format.  It currently is
    *       in a printable-only format.
    *      -->P_IPDF  PDF Source
    *      -->P_OBJBIN  PDF Destination
    form convert_pdf tables   t_source_tab structure ipdf
                              t_target_tab structure objbin.
      data:  l_hfeld(1600)      type c,
             l_offset           type p,
             l_tabix            like sy-tabix,
             l_max              type i,
             l_linecount_source type i,
             l_length_source    type i,
             l_length_target    type i.
    * Zeilenlänge des Quell-PDF-Files
      describe field t_source_tab length l_length_source.
    * Zeilenlänge der Ziel-Mime-Tabelle
      describe field t_target_tab length l_length_target.
    * Zeilenanzahl des Quell-PDF-Files
      describe table t_source_tab lines l_linecount_source.
    * Die maximale Zielgröße wird durch das Feld l_hfeld begrenzt.
      l_max = l_length_target + l_length_source.
    *  IF L_MAX > 1600.
    *    RAISE CONVERT_NOT_POSSIBLE.
    *  ENDIF.
      refresh t_target_tab.
      loop at t_source_tab.
        l_tabix = sy-tabix.
        move t_source_tab to l_hfeld+l_offset.
    * falls letzte zeile der quelltabelle erreicht
        if l_tabix = l_linecount_source.
          l_length_source = strlen( t_source_tab ).
        endif.
        l_offset = l_offset + l_length_source.
        while l_offset ge l_length_target.
          clear t_target_tab.
          t_target_tab = l_hfeld(l_length_target).
          append t_target_tab.
          shift l_hfeld by l_length_target places.
          l_offset = l_offset - l_length_target.
        endwhile.                          " l_offset ge p_length_target
    * falls letzte zeile der quelltabelle erreicht
        if l_tabix = l_linecount_source.
          if l_offset gt 0.
            clear t_target_tab.
            t_target_tab = l_hfeld(l_offset).
            append t_target_tab.
          endif.                           " l_offset gt 0
        endif.                             " l_tabix = l_linecount_lines
      endloop.                             " p_source_tab
    endform.                    " convert_pdf
    *&      Form  auth_check
    *       Perform Authorization Check
    *  -->  p1        text
    *  <--  p2        text
    form auth_check.
      authority-check object 'Z_ABAP_CHK'
                   id 'BUKRS' dummy
                   id 'ACTVT' dummy
                   id 'WERKS' dummy
                   id 'REPID' field report.
      if sy-subrc ne 0.
        message e024.
      endif.
    endform.                    " auth_check
    *&      Form  send_pdf_in_email
    *       Transfer the PDF file in an E-Mail
    *  -->  p1        text
    *  <--  p2        text
    form send_pdf_in_email.
      data: iaddsmtp type bapiadsmtp occurs 0 with header line.
      data: ireturn type bapiret2 occurs 0 with header line.
      concatenate text-010 jselect-jobname text-011
                  into doc_chng-obj_descr
                  separated by space.
      clear objtxt.
      objtxt = text-012.
      append objtxt.
      clear objtxt.
      objtxt = text-013.
      append objtxt.
      clear objtxt.
      concatenate text-014 jselect-jobname
                  into objtxt
                  separated by space.
      append objtxt.
      clear objtxt.
      objtxt = text-015.
      append objtxt.
      clear objtxt.
      objtxt = text-016.
      append objtxt.
      clear objtxt.
      append objtxt.
      clear objtxt.
      concatenate text-017 kim_ftp
                  into objtxt
                  separated by space.
      append objtxt.
      clear objtxt.
      concatenate text-018 ext_ftp
                into objtxt
                separated by space.
      append objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
      clear objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num   = 0.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = 'RAW'.
      append objpack.
      describe table objbin lines tab_lines.
      concatenate jselect-jobname pdf_ext
                  into objhead.
      append objhead.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num   = 1.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = pdf_type.
      objpack-obj_name   = jselect-jobname.
      concatenate text-019 jselect-jobname
                  into objpack-obj_descr
                  separated by space.
      objpack-doc_size   = tab_lines * 255.
      append objpack.
      if int = 'X'.
        clear iaddsmtp.
        refresh iaddsmtp.
        clear bapiadsmtp.
        call function 'BAPI_USER_GET_DETAIL'
             exporting
                  username = ext_user+0(12)
             tables
                  return   = ireturn
                  addsmtp  = iaddsmtp.
        loop at iaddsmtp where std_no = 'X'.
          clear bapiadsmtp.
          move iaddsmtp to bapiadsmtp.
        endloop.
        if bapiadsmtp-e_mail = ''.
          concatenate ext_user kimball_domain
                    into reclist-receiver.
        else.
          move bapiadsmtp-e_mail to reclist-receiver.
        endif.
        move internet to reclist-rec_type.
      else.
        reclist-receiver = ext_user.
        move dist_list to reclist-rec_type.
      endif.
      append reclist.
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        exporting
          document_data                    = doc_chng
          put_in_outbox                    = 'X'
    *   IMPORTING
    *     SENT_TO_ALL                      =
    *     NEW_OBJECT_ID                    =
        tables
          packing_list                     = objpack
          object_header                    = objhead
          contents_bin                     = objbin
          contents_txt                     = objtxt
    *     CONTENTS_HEX                     =
    *     OBJECT_PARA                      =
    *     OBJECT_PARB                      =
          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                           = 8
      case sy-subrc.
        when 0.
          message i014 with reclist-receiver.
        when 1.
          message i015 with text-027.
        when 2.
          message i015 with text-028.
        when 3.
          message i015 with text-029.
        when 4.
          message i015 with text-030.
        when 5.
          message i015 with text-031.
        when 6.
          message i015 with text-032.
        when 7.
          message i015 with text-033.
        when 8.
          message i015 with text-036.
        when others.
          message i015 with text-036.
      endcase.
    endform.                    " send_pdf_in_email

  • When i click Yahoo mail, firefox is closing, says send error report or close

    The new Yahoo Mail is updated, so when i open yahoo mail, the browser says " firefox encountered... error . Send error report or close". This is the error window dialogue box appear.
    After that, the complete firebox browser closing, how do i open my yahoo mail.
    GMail and other websites is working fine. The problem with only Yahoo mail.
    Please help.
    My important mail has to be read.

    See:
    *https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding
    *http://kb.mozillazine.org/Profile_in_use

  • Error to send a report via mail with BI Publisher

    Hello,
    I am working with BIP 10.1.3.4 over Windows Server 2003 Standard Edition, and I would like to send a report via mail.
    I added one Email server navigation via Admin>Delivery Configuration > Email with the server name and host.
    Then Send report via Email, got error.
    oracle.apps.xdo.service.delivery.DeliveryException: oracle.apps.xdo.delivery.DeliveryException: smtp
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:228)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1190)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:478)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    Caused by: oracle.apps.xdo.delivery.DeliveryException: smtp
         at oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler.submitRequest(Unknown Source)
         at oracle.apps.xdo.delivery.AbstractDeliveryRequest.submit(Unknown Source)
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:222)
         ... 4 more
    Caused by: javax.mail.NoSuchProviderException: smtp
         at javax.mail.Session.getService(Session.java:764)
         at javax.mail.Session.getTransport(Session.java:689)
         at javax.mail.Session.getTransport(Session.java:632)
         at javax.mail.Session.getTransport(Session.java:612)
         ... 7 more
    I have followed this SR, and I applied the solution, but it isn't solved the issue (ID: 1072742.1)
    https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&id=%28%29%29,%28page=KBNavigator&id=%28from=BOOKMARK&viewingMode=1143&bmDocTitle=BI%20Publisher%20With%20JDE%20Fails%20To%20Send%20Email,%20Error:%20javax.mail.NoSuchProviderException:&bmDocID=1072742.1&bmDocType=PROBLEM&bmDocDsrc=KB%29%29
    Regards,
    Mónica.

    Hi Christian.
    You could put the lines of your list in a table of type SOLISTI1 and then use the function module SO_NEW_DOCUMENT_SEND_API1 to send the content of this table. You have to fill the table RECEIVERS with the address you want to send the report to.
    Hope that helps,
    Timo.

  • How to send "SPOOL" on SAP MAil or external mail in background???

    I tried using 'SO_DOCUMENT_REPOSITORY_MANAGER' function but it failed when I run it in background. I learned that it calls a screen at the middle of the process which needs user input to go on with the process.
    Is there other way that I could send spool on SAPMail or external Mail in background??? Any suggesstions will be greatly appreciated.. thanx...

    see below sample function module, you can use in backgroud also
    FUNCTION Z_SEND_MAIL_FOR_SPOOLLIST.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(SPOOLNUMBER) LIKE  SY-SPONO DEFAULT SY-SPONO
    *"             VALUE(MAILNAME) LIKE  SOOD1-OBJNAM DEFAULT 'NOTE'
    *"             VALUE(SUBJECT) LIKE  SOOD1-OBJDES
    *"             VALUE(RECEPIENT) LIKE  SY-UNAME OPTIONAL
    *"             VALUE(DLI) LIKE  SOOS1-DLINAM OPTIONAL
    *"       TABLES
    *"              TEXT STRUCTURE  SOLI OPTIONAL
    *"       EXCEPTIONS
    *"              ERROR
    DATA: OBJECT_HD_CHANGE LIKE SOOD1 OCCURS 0 WITH HEADER LINE,
          OBJPARA          LIKE SELC  OCCURS 0 WITH HEADER LINE,
          RECEIVERS        LIKE SOOS1 OCCURS 0 WITH HEADER LINE.
    OBJECT_HD_CHANGE-OBJLA  = SY-LANGU.
    OBJECT_HD_CHANGE-OBJNAM = MAILNAME.
    OBJECT_HD_CHANGE-OBJDES = SUBJECT.
    OBJECT_HD_CHANGE-OBJSNS = 'F'.
    OBJECT_HD_CHANGE-VMTYP  = 'T'.
    OBJECT_HD_CHANGE-SKIPS  = 'X'.
    OBJECT_HD_CHANGE-ACNAM  = 'SP01'.
    OBJECT_HD_CHANGE-OBJCP  = 'X'.
    RECEIVERS-RCDAT  = SY-DATUM.
    RECEIVERS-RCTIM  = SY-UZEIT.
    IF DLI IS INITIAL.
        RECEIVERS-RECNAM = RECEPIENT.
        RECEIVERS-RTUNAM = RECEPIENT.
    ELSE.
        RECEIVERS-RECNAM = DLI.
        RECEIVERS-ADR_NAME = DLI.
        RECEIVERS-RECESC = 'C'.
    ENDIF.
    RECEIVERS-SNDEX  = 'X'.     " Express-Mail
    APPEND RECEIVERS.
    OBJPARA-NAME = 'SPI'.
    OBJPARA-LOW  = SPOOLNUMBER.
    APPEND OBJPARA.
    CALL FUNCTION 'SO_OBJECT_SEND'
          EXPORTING
               OBJECT_HD_CHANGE           = OBJECT_HD_CHANGE
               OBJECT_TYPE                = 'RAW'
               OWNER                      = SY-UNAME
          TABLES
               OBJCONT                    = TEXT
               OBJPARA                    = OBJPARA
               RECEIVERS                  = RECEIVERS
          EXCEPTIONS
               OTHERS                     = 01.
    IF SY-SUBRC NE 0.
       RAISE ERROR.
    ENDIF.
    ENDFUNCTION.

Maybe you are looking for

  • Is there a way of getting a list of upcoming alerts/alarms and their times?

    I'd like to get a list of alert times, so that I can see if I have any that will be going off in the middle of the night! Many months back, I purged those pesky midnight alerts by scrolling through week by week and looking for the all-day events and

  • How to call  a jar file for the dynamic menu

    hi , I am using JDEV 11.1.2.2.0 version. My problem is this, when dynamic tree populate using java bean class(data come from the table) how can we call a jar files(seperate projects jars) to each link of the tree. plz help... -Harsh-

  • To insert a new row in a table control without affecting the other rows

    Halo experts, I have a Table control TCTRL in a program . The lt_tab contains two cols A and B In change mode of the transaction Col A is in display mode and Col B is in change mode When i press the + button to insert a new blank entry .I need a blan

  • Quick Time won't delete!

    I tryed to remove Quick Time from my computer but it says it can't and I need it off of my computer. Can anyone help?

  • Strange load performance...

    Hi, folks! My SWF-files don´t seem to load the way i want after publication. I usually build in a kind of loading bar to show loading process while loading, it should be visible right away, till the main movie starts playing. But the browser seems to