SENDING 2 DIFFERENT SPOOLS IN SINGLE MAIL
Hi Frineds,
i am writing a report for 2 Spools(PDF FILES )
and sending into the mails sucessfully.
problem is :
when i am sending MAIL 2 SPOOLS to One person they ARE COMING ONE BY ONE INTO MAIL.
BUT MY REQUIREMENT IS WHEN I AM EXECUTING THE REPORT THE SPOOLS ARE COME INTO MAIL AT A TIME NOT TWICE.
THE ATTCHMENTS (2 SPOOLS ) ARE COME INTO MAIL IN A SINGLE SHOT.
regards,
Venu
You define the number of you attachment in the table PACKING_LIST of the function module SO_OBJECT_SEND.
For example
zbstart = 1. "first attachment
loop at <table that contains list of spool numbers>
perform convert_otf_pdf. "converts to pdf
describe table pdf lines zlines.
pack_list-transf_bin = 'X'.
pack_list-head_start = zbstart.
pack_list-head_num = 0.
pack_list-body_start = zbstart.
pack_list-body_num = zlines.
pack_list-file_ext = 'PDF'.
pack_list-objnam = <attachment name>
pack_list-objdes = <attachment description>
pack_list-objlen = zlines * 255.
append zpack_list.
zbstart = zlines + 1. "start of next attachment
endloop.
Of course your OBJCONT table MUST have ALL you converted data.
Edited by: Vyerah Yende on Mar 10, 2008 6:20 PM
Similar Messages
-
How to send multiple attachements in single mail
Hi All,
Currently i am using this function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with only one attachment.
But now i need to send multiple attachments to a single mail.
Can any one please tell me as how to send multiple attachments in single mail.
Thanks in advance.Hi
See this and do accordingly
Mailing with Attachment by ABAP Coding
Refer this link:
Mail with attachment.
FORM send_list_to_basis .
DATA: w_path LIKE rlgrap OCCURS 0 WITH HEADER LINE,
lt_index TYPE sy-tabix,
doc_type(3) TYPE c,
descr LIKE it_objpack_basis-obj_descr,
temp_data LIKE w_path,
temp1 TYPE string,
tab_lines TYPE i,
langu(15) TYPE c,
expirydate TYPE so_obj_edt,
L_FILE1(100).
CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
W_PATH-FILENAME = L_FILE1.
APPEND w_path.
CLEAR w_path.
wa_doc_chng-obj_descr = 'User List not logged on for 180 days'.
wa_doc_chng-obj_langu = 'E'.
wa_doc_chng-obj_expdat = sy-datum.
CLEAR w_subject.
CONCATENATE 'Please find attached document with list of users'
'not logged on for 180 days for client' sy-mandt
INTO w_subject SEPARATED BY space.
it_objtxt_basis-line = w_subject.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
it_objtxt_basis-line = text-004.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
CLEAR w_tab_line.
DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
READ TABLE it_objtxt_basis INDEX w_tab_line INTO l_cline.
wa_doc_chng-doc_size =
( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
CLEAR it_objpack_basis-transf_bin.
it_objpack_basis-head_start = 1.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = 1.
it_objpack_basis-body_num = w_tab_line.
it_objpack_basis-doc_type = 'RAW'.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
LOOP AT w_path.
temp1 = w_path.
descr = w_path.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '\'
string = descr
IMPORTING
head = descr
tail = temp_data.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '.'
string = descr
IMPORTING
head = temp_data
tail = doc_type.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = temp1
filetype = 'BIN'
header_length = 0
read_by_line = 'X'
replacement = '#'
TABLES
data_tab = it_upload.
DESCRIBE TABLE it_upload LINES tab_lines.
DESCRIBE TABLE it_objbin_basis LINES lt_index.
lt_index = lt_index + 1.
LOOP AT it_upload.
wa_objbin_basis-line = it_upload-line.
APPEND wa_objbin_basis TO it_objbin_basis.
CLEAR wa_objbin_basis.
ENDLOOP.
it_objpack_basis-transf_bin = 'X'.
it_objpack_basis-head_start = 0.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = lt_index.
it_objpack_basis-body_num = tab_lines.
it_objpack_basis-doc_type = doc_type.
it_objpack_basis-obj_descr = descr.
it_objpack_basis-doc_size = tab_lines * 255.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
ENDLOOP.
it_reclist_basis-receiver = '[email protected]'.
it_reclist_basis-rec_type = 'U'.
APPEND it_reclist_basis.
CLEAR it_reclist_basis.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack_basis
contents_txt = it_objtxt_basis
contents_bin = it_objbin_basis
receivers = it_reclist_basis
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc EQ 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
ENDFORM. " send_list_to_basis
<b>Reward points for useful Answers</b>
Regards
Anji -
How to send multiple attachment in single mail
i am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending mail.
pls guide me how can i modify my code so that i can send multiple attachmentsHi Manish,
Check out the links below.
E-mail multiple PDF attachments
Send a Single Mail with Multiple Attachment
Hope it helps.
Regards,
Amit
*Always reward points for helpful answers
Message was edited by:
Amit Kumar -
Send collective invoice via (Single mail)email in pdf format
Hi All,
Please suggest me the solution option for the below requirement.
The requirement is to send collective invoice to the customer via email in PDF format in a single email at the end of the day.ie they like to have a tool where they
can enter the output type,date and other relavant info and the program should collect all the invoice and convert it to PDF and send it in single mail to customer.
Please let me know i can use any Standard tool for this purpose.ALso is it possible to write a Zprogram reprocess the output type by using any FM?
Also suggest if you have any feasible solutions.
Regards
RajaHi All,
thanks for your comments. Sorry its my mistake that i have asked in general.
I am looking for the following options.
1. Any stanard program which can be used partially for my requirement?
2. If i have to go for a new tool, then i should write a code for reprocess the output types and then convert in to one single PDF and then send it to customer in one single email.
Here i am struck how to write an program to reprocess the ouput types? i hope the next steps can be easily implemented evenhough some watch outs are there like 'how to make a single PDF file' and some technical constraints like max size that can be send.
Thanks and let me know your inputs.
Regards,
Raja -
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 KanthHow 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. -
How to send generated Spool file through e-mail
Hi,
We have a ABAP report which generates a spool file. Now there is a requirement to send this spool file to our clients external mail boxes.
Also we would like to automate this so that whenever a spool file is generated, the system should automatically send it as an attachment to user mail inboxes.
Any idea how I can achieve this. Thanks is advance!
Regards,
Vikrant.Hi Vikrant,
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.
Regards,
Santosh -
Merge Different Spools containing a Single PDF page into a Single PDF file.
Greetings,
I am developing a custom object where in i need to read PDF file from many different Spools(Range given on Input Screen), where each spool has a single PDF page in it. I need to combine all these PDF Pages into a single PDF file & either create a new Spool or save it on an Application Server.
At present i have developed the code where in i am able to read the PDF files from different spools & convert them into Binary but i am not able to generate it back to PDF file.
Kindly find my code for your reference.
CODE:-
START-OF-SELECTION.
PERFORM f_get_spool_1000 .
PERFORM g_conv_pdf_to_bin_2000 .
*& Form F_GET_SPOOL_1000
text
FORM f_get_spool_1000 .
SELECT * FROM tsp01
INTO TABLE gt_tsp01
WHERE rqident IN s_spool
ORDER BY rqcretime DESCENDING.
IF sy-subrc = 0.
SORT gt_tsp01 BY rqident .
ENDIF.
ENDFORM.
*& Form G_CONV_PDF_TO_OTF_2000
text
DATA: lv_filename_out TYPE string,
lv_len TYPE i,
lt_tab TYPE tsfixml .
DATA: lwa_print_parms LIKE pri_params,
lv_valid(1) TYPE c .
DATA: lv_linsz LIKE sy-linsz VALUE 132, " Line size
lv_paart LIKE sy-paart VALUE 'X_65_132'. " Paper Format
DATA : lt_tsp01 TYPE STANDARD TABLE OF tsp01 ,
lwa_tsp01 TYPE tsp01 .
CLEAR : gv_pdf, gwa_tsp01, gv_renderpagecount .
LOOP AT gt_tsp01 INTO gwa_tsp01.
CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
EXPORTING
i_spoolid = gwa_tsp01-rqident
i_partnum = 1
IMPORTING
e_pdf = gv_pdf
e_renderpagecount = gv_renderpagecount
e_pdf_file = gv_pdf_file
EXCEPTIONS
ads_error = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR lv_len .
REFRESH gt_bin .
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = gv_pdf
IMPORTING
output_length = lv_len
TABLES
binary_tab = gt_bin.
CLEAR gwa_bin .
LOOP AT gt_bin INTO gwa_bin.
APPEND gwa_bin TO gt_listout.
CLEAR gwa_bin .
ENDLOOP.
ENDLOOP.
Get FP reference
DATA: lo_fp TYPE REF TO if_fp VALUE IS INITIAL,
lo_pdfobj TYPE REF TO if_fp_pdf_object VALUE IS INITIAL,
lo_exc TYPE REF TO cx_root,
lv_xslt_message TYPE string .
lo_fp = cl_fp=>get_reference( ).
For handling exceptions
DATA: lo_fpex TYPE REF TO cx_fp_runtime VALUE IS INITIAL.
TRY.
lo_pdfobj = lo_fp->create_pdf_object( connection = 'ADS' ).
Set document
lo_pdfobj->set_document(
EXPORTING
pdfdata = gt_listout ).
Tell PDF object to extract data
lo_pdfobj->set_extractdata( ).
Execute the call to ADS
lo_pdfobj->execute( ).
CATCH cx_root INTO lo_exc.
lv_xslt_message = lo_exc->get_text( ).
ENDTRY.
Your quick reply would be of great help.
Regards.Thank Your for your concern, there are many replies & posts but all of them points only to Try what they have said. As being said that trying to convert PDF to binary & appending many PDF similarly would not let you generate a single PDF again.
Your Kind guidance would be really appreciable.
Regards. -
Need to send CSV attachments in a single mail to the Rcvr
Hi All,
Currently we are using 7.1 release of PI system. The scenario is from IDOC to ANSI Format. All the files recieved from IDOC should be sent as an attachment in CSV format in a single mail .Could anyone please let me know how to proceed with this. If there is any javamapping needed for this? If yes, could you please provide the code for the same,
Regards,
PavithraHi Pavithra,
How to Guide for sending mails:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992
Use StrictXML2PlainBean in the module processor to convert the data to CSV:
/people/pooja.pandey/blog/2009/02/23/xml-to-text-conversion-made-easy-by-strictxml2plainbean
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm
Regards,
Aravind -
Multiple PDF Sending via single mail
Hi Experts,
I have a requirement in which when the user runs a report, he could get many invoices. We need to send all the invoices in the list converted to PDF and sent all the PDF(Multiple) to the sold to party mail ID.
If the Size of the PDF attachment exceeds we need to send as multiple mails.
I have only the invoice number and output type from the report. ITs not a print program there is no Close_form to get otf_data.
Is there any function module to convert a invoice to OTF then to PDF. ?
Is there any function module to send Mutiple PDF(MIN of 10) attached in a single mail ?
Regards,
Venkatesh.Hi
USe this link.
http://forums.sdn.sap.com/search.jspa?threadID=&q=multiplePDFinSinglemail&objID=f231&dateRange=all&numResults=15&rankBy=10001
Regards
Azeez -
in my ipad email address which I am using for sending mail is appearing differently in the receipents mail box ! how to resolve that
while sending a email in my ipad it is showing the correct email address([email protected]) in the ""from"" field but in receipients inbox ""from"" field it is showing another email id ([email protected])
-
Send different mails on different days automatically-Auto Responder
I need to develop an Auto Responder application where my application has to send different mails to different types of Auto Responder customers.These mails should be sent to these customers every x days after their subscription i.e., once a customer has subscribed for this Auto Responder he will be recieving a mail 3rd day after subscription,then 7 days after subscription and then 10 days after subscription.This will vary on the particular auto responder to which the client has subscribed.
I got the suggestion that using timer and timer task classes in the java mail will be helpful.But can anyone tell me how to use these methods to send different mails to different customers on different days. I need it urgent.I need to develop an Auto Responder application where my application has to send different mails to different types of Auto Responder customers.These mails should be sent to these customers every x days after their subscription i.e., once a customer has subscribed for this Auto Responder he will be recieving a mail 3rd day after subscription,then 7 days after subscription and then 10 days after subscription.This will vary on the particular auto responder to which the client has subscribed.
I got the suggestion that using timer and timer task classes in the java mail will be helpful.But can anyone tell me how to use these methods to send different mails to different customers on different days. I need it urgent. -
Send different mails automatically on different days-Auto Responder
I need to develop an Auto Responder application where my application has to send different mails to different types of Auto Responder customers.These mails should be sent to these customers every x days after their subscription i.e., once a customer has subscribed for this Auto Responder he will be recieving a mail 3rd day after subscription,then 7 days after subscription and then 10 days after subscription.This will vary on the particular auto responder to which the client has subscribed.
I got the suggestion that using timer and timer task classes in the java mail will be helpful.But can anyone tell me how to use these methods to send different mails to different customers on different days. I need it urgent.Hi
in the last reply, i mentioned using of timer and timertask classes to send mails.
I got ur problem. I believe the Days X is fixed for each auto responder. I mean for auto responder1 days are 3,7,10 , for autoresponder2 days are 5,8,10 ... etc
R u using any database, if yes follow Soultion 1 otherwise follow Solution2
1)
Create two tables in database
table a is autoresponders table
schema
Autoresponderid
AutoResponderDescription
AutoResponderMailFormat
AutoResponderDays(comma deliminated numbers ex: 1,3,5,10.. ) ( i belive Days x is fixed and with varying difference, if it is fixed difference ie 1, 5, 9 with a diff of 4 then we need autoresponderinterval instead of autoresponderDays )
Table b is CustomerTable
CustomerID
Customer Name
AutoResponderID(Foreign key to autorespondertable)
Fill out appropriate responders data and customer data
Now almost the problem is solved.
I am focusing on main task sending mail
I have explained already how to send mail in JSP forum for your question. Please refer that.
Suppose we assume autorespondertable contains 5 rows.
and customertable contains 10 rows(10 customers)
Now the logic is
Create a common TimerTask which has attributes same as autoresponder row.
Create a Thread(TimerTask in this case), for each row in autoresponder table(in our case 5 TimerTask 's are created)
Follow these steps(Implement the logic in run method of TimerTask).
1) Read rows of all customers whose autoresponder is this id
2) Notice there subscription date, do some work on that date and compare with autoresponderdays data. (suppose if customer subscribtion date is 20/07/2005, todays date is 23/07/2005, if autoresponder day is 3 , take the diff between two dates and compare with autoresponder date) if yes
Read MailFormat for that autoresponder and add customer name, blah blah, use JavaMail Mail api and send it . and
3) Important this TimerTask must be scheduled for every day
i,e. Please have a look to my reply in JSP forum. It should be
INTERVAL=1000*60*60*24 (1 day)
4) it checks every day all the autoresponders
If u want me to write the code, i can provide that
cheers
Rajendra Bandi -
Multiple attachments in single mail using XML publisher bursting
Hi all
I am sending the PDF generated to a particular mail recipient using the bursting options.
There is requirement in which I have to attach two different PDF's to the mail. These multiple attachments should go in a single mail. Please let me know how we can achieve this.
Thanks in adv,
Srini
Edited by: 796646 on Mar 4, 2011 2:35 PMSuresh,
just copy your question and paste it in search box.. press enter
there are too many posts already on this.
still a little help for you, with explanation:
[code snipet with documentation|http://wiki.sdn.sap.com/wiki/display/Snippets/MultipleAttachmentsExplanation] -
Multiple Mail attachment (PDF and Excel) in a single mail
Please help me to send the PDF and Excel attachment in the single mail. I am using the FM for PDF is 'SO_NEW_DOCUMENT_ATT_SEND_API1' and for Excel 'SO_DOCUMENT_SEND_API1'. Currently the program sends 2 different attachments for PDF and Excel.
Thanks in Advance.Hi,
If you want to send multiple attachments in a single mail then i would suggest to use
CL_BCS for achieving it.
Look at standard program BCS_EXAMPLE_6 for more clarity.
There you find this statement of code
document1 = cl_document_bcs=>create_document
After creating one document using this you can use the same statement again and create another document.
document2 = cl_document_bcs=>create_document
Both documents should have different name.
Then use
send_request->set_document( document1 ).
send_request->set_document( document2 ).
This will attach both the documents to a single email.
Hope this helps.
Regards,
-Sandeep -
Output message type External send - Suppress spool number in SOST title
Dear all,
Using an external send output type, we send order confirmation from by mail.
Depending of printer we use, we have different behaviors :
With a normal printer, the mail title we get in SOST is exactly the content of field <NAST-TDTITLE>.
This field can be changed in the print program, so we can set exactly the title we want.
With a PDF2MAIL printer (printer defined in SPAD with property host spool access method : M (Email to Receiver/Owner), the mail title we get in SOST is the following : <SystemID><Spool Number><NAST-TDCOVTITLE>.
Do you know whether it is possible to suppress standard information <SystemID><Spool Number>
and therefore have only <NAST-TDCOVTITLE>.
Setting both fields <NAST-TDCOVTITLE> and <NAST-TDTITLE> using print program, the goal is to have allways same title in SOST ...
Can you help me ?
J.C.Hi,
I am not got your reuirement clearly, but i feel your reuirement is close to this thread:
RLB_INVOICE program for sending mail to muliple mail's Id's
I have used the Cl_BCS class to send mail to muliplte vendor mail id's
If needed code will be send.
Hope this will help.
Maybe you are looking for
-
Hi friend, Please could u tell me how can i make a multiple Column in a JList without using JTable. It would be better if u send me a complete code for that. Thanks u very much in Advance. Khaled Mahmud
-
I have a video clip of a guy in front of a white screen (originally it was a green screen but I replaced the background with a white wall). I want to add a graphic behind him and I am not sure which blend mode to use. The graphic is also based on a w
-
Problem opening multiple pictures in Photoshop
Problem opening multiple pictures in Photoshop. OldBob1957 has given me some suggestions on how to overcome this problem. I tried to Edit.Purge>All, Reset Preferences, Delete the Adobe Photoshop x Prefs.psp folders and Ctrl+Alt+Shift on Photoshop s
-
The left side of my home button is screen is kinda feel like hollow when I tap it and it makes a sound too. It is bulge,a little. I thought every ipad is hard to touch but why mine is not? Help please,what should I do? Please I need your help.
-
Preinstalled Final Cut Express HD
Hey All, I ordered a new Macbook Pro with FCE preinstalled and I had a question about that. Do you still get the same install discs that you would get if you bought the retail version? Or is everything bundled into the apple install disc/s? Usually w