SO_NEW_DOCUMENT_ATT_SEND_API1 SEND PDF
We use SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with atached pdf
document. The pdf document is <b>digitaly signed</b>. After sending the mail
with the pdf digital signature document the signature is invalid
when verifing with acrobat reader 6.0.
We use SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with atached pdf
document. The pdf document is <b>digitaly signed</b>. After sending the mail
with the pdf digital signature document the signature is invalid
when verifing with acrobat reader 6.0.
Similar Messages
-
Hi Experts,
Im using the fm SO_NEW_DOCUMENT_ATT_SEND_API1 to send out a pdf (into sap office box). But when I open it
I get totally wrong special characters (Chinese for instance, and ' is replaced by #).
I have already applied the note 1430123 but it didnt resolve the issue.
Can anybody help on this?
Help will highly appreciated.
HubertYes. This is very much possible.
gv_xstring contains the pdf data in XSTRING format.
Check the code :
* ---------- create persistent send request ----------------------
send_request = cl_bcs=>create_persistent( ).
* ---------- Create document ----------------------------------------
* get PDF xstring and convert it to BCS format
lp_pdf_size = XSTRLEN( gv_xstring ).
pdf_content = cl_document_bcs=>xstring_to_solix(
ip_xstring = gv_xstring ).
* Create Mail Body
CLEAR ls_body.
CONCATENATE 'Dear' gv_name1 ',' INTO ls_body SEPARATED BY space .
APPEND ls_body TO lt_body.
CLEAR ls_body.
APPEND ls_body TO lt_body.
CLEAR ls_body.
ls_body = 'Warm greetings '.
APPEND ls_body TO lt_body.
CLEAR ls_body.
ls_body = 'Manager'.
APPEND ls_body TO lt_body.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_body
* i_length = '12'
i_subject = 'Letter' ).
** Add Attachment to send request
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Letter'
i_att_content_hex = pdf_content.
* add document to send request
CALL METHOD send_request->set_document( document ).
* ---------- add recipient (e-mail address) ----------------------
IF gv_adrnr IS INITIAL.
SELECT SINGLE adrnr
FROM kna1
INTO gv_adrnr
WHERE kunnr EQ gv_kunrg.
ENDIF.
SELECT SINGLE smtp_addr
INTO lv_email
FROM adr6
WHERE addrnumber EQ gv_adrnr.
recipient = cl_cam_address_bcs=>create_internet_address(
i_address_string = lv_email ).
* add recipient to send request
send_request->add_recipient( i_recipient = recipient ).
* ---------- send document ---------------------------------------
sent_to_all = send_request->send(
i_with_error_screen = 'X' ).
IF sent_to_all = 'X'.
* MESSAGE i022(so).
gv_emailflag = 'X'.
ENDIF.
* ---------- explicit 'commit work' is mandatory! ----------------
COMMIT WORK. -
How to send pdf attachment SO_NEW_DOCUMENT_ATT_SEND_API1?
Dear All,
I am using SO_NEW_DOCUMENT_ATT_SEND_API1 to send PDF attachment with some text in the body.
How to di it plz help me.
Regards,
Raj...Hi,
Refer below link
http://http://scn.sap.com/thread/3160549
http://http://scn.sap.com/community/abap/blog/2014/05/09/sending-email-with-pdf-attachment -
Sending PDF attachment in mail
My requirement is to send PDF as attachment in mail. Also require to password protect it. I've searced a lot in the forums and found many threads, but no solid solution... Has anyone worked on it lately, and found any solution? Thanks in advance.
Hi,
use this FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'. and pass the required values.
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.
Edited by: katigiri linganna on Jul 31, 2009 8:56 AM -
Sending PDF attachment through EMAIL Triggering
Hi,
Could you plaese let me know How to send Pdf Attachments
through Email in SAP.
Using Function Module SO_NEW_DOCUMENT_ATT_SEND_API1.
Regards
BhuvanaHi,
GP does not involve any sort of coding.
Just like workflow, GP has a flow desgined in a process.
Each step has a callable object associated with it.
Check [this|http://help.sap.com/saphelp_nw04s/helpdata/en/0f/619fd378a641b29386063019c24fc4/frameset.htm] link for details
-Ashutosh -
I have an iPad 2, and I am sending PDF files to my iPad, via a Hotmail account. But, the PDF arrives to the iPad Mail account already opened at the bottom of the email. Is there a way to prevent this auto-opening of the PDF. I've seen screen shots with the box, and PDF listed inside the box, but mine open automatically. I want to get them into iBooks...?
I am having the same problem and it is even bigger.
When opening a 1-page PDF in iBooks and sending it via mail it is sent inline as preview, but the recipient cannot open the file anymore. Also on iPad and iPhone there is no "open in" possible.
Somehow the mail app does destroy the file. What is going wrong? -
Not able to send pdf file as attachment in my apple mail.
Hi, I was easily able to attach pdf files to my apple mail. infact I could just open a pdf file and then send it as attachment in the email earlier. but after downloading and upgrading to os X Mountain lion, I am neither being able to attach and send pdf files in my apple mail, nor can I send PDF file as an attachment.
Is there any issue with OS X Mountain Lion.
Issue 1. I compose Email , then click attach > Browse > select pdf file > click attach > it shows in my Email body either as an icon or as first page of the pdf document > I send it. >>> But when the receipient opens the Email, that pdf attachment is missing. In fact When I put a cc to my self and I open the Email, the attachment is mssing in the incoming E amil.
Issue 2. I open the PDF document > Click on File > send as attachment in E-Mail > on right, a menu appears where I select the File and click attach> I get a message
The SendMail doesnot know how to talk to your default mail client. Please select a different mail application to use. Attaching a screen shot.
I never had these issues earlier with my Lion OS . but since the time I have upgraded to mountain Lion OS, I am having these issues.
Are these the Mountain Lion issues, how to fix these please.I believe, the software team forgot to put a button for send or share as an attachment to preview.
-
How to Sender PDF file as attachment in Payload?
Hi Experts,
After I done some of PI scenarios, I'm stuck with one of my requirement... In requirement, "Web service" will send request to "SAP ECC 6" in order to get PO document print out in PDF file by call smartform or any form printing as usual.
In my understand, I'm using SOAP adapter as sender and RFC adapter in receiver side, in RFC function, I will call form and generate PDF file by using normal ABAP function, but here, how can I send PDF file as response message of SYNC call from web service.
I try to search and read some of document and blog, some said I can attach file as Payload attachment, but no clear solution or guide to do so.
Here is example blog that I found, I really useful
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
Please suggest me in my case,
Thanks in advance...
Cheers,
TerryHi,
>>In my understand, I'm using SOAP adapter as sender and RFC adapter in receiver side, in RFC function, I will call form and generate PDF file by using normal ABAP function, but here, how can I send PDF file as response message of SYNC call from web service.
as per my blog you can attach PDF to a message only if you use abap proxy on ECC and not RFC
the code is just copy and paste from my blog:
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
so there is nothing spectacular there
Regards,
Michal Krawczyk -
.pdf file changed into .tmp when trying to send pdf file as attachment
Dears,
A few days now, .pdf files are exported as .tmp files if we try to send them as attachment directly from the adobe reader plug-in in internet explorer 8.
Unfortunatly Outlook interprets .tmp files as harmfull, so we are no longer able to send pdf files directly.
(screenshot in attachment)
Is there any chance we can configure this so, pdf files are exported as .pdf instead of .tmp
More details:
OS : Win XP SP3
browser : ie 8
plug in : Adobe PDF Link Helper (not sure this is the one that provides us the pdf reader functionallity dough)I cannot reproduce that (Adobe Reader 11.0.3, IE8, Win XP-SP3). In fact, I cannot even see the Attach to Email option, but the file name is correct.
-
Can't send PDF as a mail attachment from iPad to a Lotus Notes account
Hello, I have some problems sending PDF documents as email attachments from my iPad. Using the adobe reader app for iOS, I create an email with the file attached. Sending this to e.g. a hotmail account works fine. However, if I send it to any address at my company, where Lotus Notes is the standard, the attachment seems to be converted into a text file. Is this a known issue with the reader for iPad, or should I rather be looking to IT support at my company for help?
Download QuickOffice, which Google is now making available for free:
https://itunes.apple.com/us/artist/quickoffice-inc./id294258240?mt=8
You can open the XLS attachment in that app, then transfer the document to your Mac via the USB cable. You can then print from the Mac.
Printing from your iPad doesn't work via Bluetooth either, by the way.
Regards. -
Sending pdf attachments via e-mail in BSP
Hi all,
i have written a code for sending email to a given mailid with some text but
can anyone tell me step to step procedure for sending pdf attchments to mailid.
Thanks and Regards,
Sneha Puppala.Hi ravikiran,
This is my code for sending email with attach:
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="bsp" prefix="bsp"%>
<htmlb:content id="content" design="classicdesign2002design2003" controlRendering="sap"
rtlAutoSwitch = "true">
<htmlb:page title = "BSP Extension: HTMLB / Element: fileUpload">
<htmlb:form method = "post" encodingType = "multipart/form-data">
<head>
<link rel="stylesheet" href="../../sap/public/bc/bsp/styles/sapbsp.css">
<title>mail to </title>
</head>
<bsp:testSuite id="testSuite" name = "<fileUpload>" key = "<%=content->design%>">
<% IF NOT %_testSuite->id_list IS INITIAL.%>
<bsp:testCase nr="DATA" text = "Data Handling"/>
<table border="1px" cellpadding="1px" cellspacing="0px" style="font:normal 10pt Arial">
<tr> <th>id</th> <th>File Name</th> <th>Content Type</th> <th>Length</th> </tr>
<%-- Notice: It's recommended to do input processing in onInputProcessing
event block, not in onLayout block like in this case. --%>
<% DO.
DATA: fu TYPE REF TO CL_HTMLB_FILEUPLOAD,
next_id TYPE STRING.
next_id = %_testSuite->next_restore_id( ).
IF next_id IS INITIAL. EXIT. ENDIF.
fu ?= CL_HTMLB_MANAGER=>GET_DATA( request = request id = next_id name = 'fileUpload' ).
%>
<tr>
<td><%=next_id%></td>
<td><%= cl_http_utility=>escape_html( fu->file_name ) %> </td>
<td><%=fu->file_content_type%> </td>
<td><%=fu->file_length%></td>
</tr>
<% ENDDO. %>
</table>
<% ENDIF. %>
<%----
%>
<%
DATA: event TYPE REF TO if_htmlb_data,
fileUpload_event TYPE REF TO CL_HTMLB_FILEUPLOAD.
event = cl_htmlb_manager=>get_event_ex( request ).
IF event IS NOT INITIAL AND event->event_name = htmlb_events=>fileupload.
fileUpload_event ?= event.
%>
<table border="1px" cellpadding="1px" cellspacing="0px" style="font:normal 10pt Arial">
<tr> <td>Event-Class</td> <td><%= event->event_class%> </td> </tr>
<tr> <td>Event-ID</td> <td><%= event->event_id%> </td> </tr>
<tr> <td>Event-Name</td> <td><%= event->event_name%> </td> </tr>
<tr> <td>Event-Type</td> <td><%= event->event_type%> </td> </tr>
<tr> <td>Event-Server Name</td> <td><%= event->event_server_name%> </td> </tr>
<tr> <td>Event-Defined</td> <td><%= event->event_defined%> </td> </tr>
<tr> <td>FileUpload-Name</td> <td><%= fileUpload_event->file_name%> </td> </tr>
<tr> <td>FileUpload-Content_Type</td> <td><%= fileUpload_event->file_content_type%> </td> </tr>
<tr> <td>FileUpload-Length</td> <td><%= fileUpload_event->file_length%> </td> </tr>
</table>
<%
ENDIF.
%>
<%----
%>
<bsp:testCase text = "upload attachment" />
<htmlb:fileUpload id = "<%= %_testSuite->seq_nr( )%>" />
<htmlb:button id = "submitButton"
text = "Upload"
onClick = "HandleUpload" />
<%----
%>
<html>
<body class="bspBody1">
<H1 class="bspH1"> Consultation-Service </H1>
<form method = "post" action="<%=page->get_page_url( )%>">
<table class="bspTbvStd" cellpadding="4">
<tr>
<td class="bspTbvHdrStd" colspan="2" align="center"><font size="4">Address</font></td>
</tr>
<tr class="bspTbvCellStd">
<td>Name</td>
<td><input type="text" name="name"
value="<% page->write( value = name ). %>" size="40" ></td>
</tr>
<tr class="bspTbvCellStd">
<td>Mail address1</td>
<td><input type="text" name="mail_address1"
value="<% page->write( value = mail_address1 ). %>" size="40"></td>
</tr>
<tr class="bspTbvCellStd">
<td>Mail address2</td>
<td><input type="text" name="mail_address2"
value="<% page->write( value = mail_address2 ). %>" size="40"></td>
</tr>
</table>
</bsp:testSuite>
</htmlb:form>
</htmlb:page>
</htmlb:content>
</form>
</body>
</html>
On Input Processing:
if page->messages->num_messages( ) eq 0.
if mail_address1 is not initial and mail_address2 is not initial.
call method application->send
exporting mail_address = mail_address1
changing messages = page->messages .
call method application->send
exporting mail_address = mail_address2
changing messages = page->messages .
if page->messages->num_messages( ) eq 0.
data text type string.
text = application->get_text( ).
navigation->set_parameter( name = 'mailtext' value = text ).
navigation->next_page( 'show' ).
endif.
else.
navigation->next_page( 'no_address' ).
endif.
endif.
"method send in defined class":
method SEND.
CLASS cl_bcs DEFINITION LOAD.
DATA:
lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
lo_send_request = cl_bcs=>create_persistent( ).
Message body and subject
DATA:
lt_message_body TYPE bcsy_text VALUE IS INITIAL,
lt_att_content_hex type solix_tab,
lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
APPEND 'Dear Vendor,' TO lt_message_body.
append ' ' to lt_message_body.
APPEND 'Please find the attached report.'
TO lt_message_body.
append ' ' to lt_message_body.
APPEND 'Thank You,' TO lt_message_body.
lo_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_message_body
i_subject = 'Visit report' ).
data: data_tab type solix_tab,
p_data type XSTRING.
call function 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = p_data
TABLES
binary_tab = data_tab.
DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Visit Report'
I_ATTACHMENT_SIZE =
I_ATTACHMENT_LANGUAGE = SPACE
I_ATT_CONTENT_TEXT =
I_ATTACHMENT_HEADER =
i_att_content_hex = data_tab ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
Add attachment
Pass the document to send request
lo_send_request->set_document( lo_document ).
Create sender
DATA:
lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
l_send type ADR6-SMTP_ADDR value '[email protected]'.
lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).
Set sender
lo_send_request->set_sender(
EXPORTING
i_sender = lo_sender ).
Create recipient
DATA:
lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
Set recipient
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient
i_express = 'X' ).
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient
i_express = 'X' ).
Send email
DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
lo_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
COMMIT WORK.
message 'The visit report has been sent' type 'I'.
Thanks and Regards,
Sneha Puppala. -
I have Adobe Reader XI with the package that allows me to send pdfs and convert pdfs to Word. When I open a pdf and try to search the search shows no matches even though the word I am searching for is in the document. Any suggestions how to search?
Once again, my thanks for your assistance. If I may impose on your generosity one more time, if I understand you correctly if I create a document on Word or WordPerfect, print it and scan it to create a pdf, the search function will not work. But, if I create the pdf document in Word the search function will work. Unfortunately, I am not sure how I create a pdf document in Word other than by printing it and scanning it. Could you please explain.
William B. Kohn, Esq.
General Counsel
Paul V. Profeta & Associates, Inc.
769 Northfield Avenue
Suite 250
West Orange, New Jersey 07052
(973) 325 - 1300
(973) 325 - 0376 (Facsimile)
[email protected]<mailto:[email protected]> -
Hello,
I try to send pdf file as attachments file to mail with XI.
I use with this blog
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
My problems is:
1. to all mails that I send have another e file Untiteld.doc, how I can avoid this file?
2. When I received the pdf file I not succeed to open it I received the message:
Adobe reader could not open 'elad.pdf' because it is either not supported
File type or because the file has been damaged (for example, it was sent as an
Email attachment and wasn't correctly decoded)
Regards
Elad Peleghi
ref this
Receiver Mail Adapter message with PDF attachment
PDF attachment in mail adapter
File adapter with attachment to mail
File with attachment to mail scenario
File To Mail Scenario With An Attachment -
Unable to send PDFs as email attachments
I have become unable to send PDFs as email attachments when using Firefox.
Depending on the PDF, I either get the message “There was an error opening this document. The file is damaged and could not be repaired.” or it opens as a blank document. This occus when opening the file with both Adobe Reader and Acrobat Pro. The problem seems to be isolated to PDFs. (I am able to send Word files. If a PDF is zipped before attaching, it can be opened without problem.) This occurs on both an institutional email account and personal (Yahoo) email account. This problem is isolated to Firefox (does not happen in Chrome).
I have reset Firefox to default settings, as well as reinstalling.
Thank you.Update Adobe® Acrobat® Plug-in for Web Browsers, Version 10.1.13 to version 11.
Also please update all of your plugins and try again.
Does this happen when you open the pdf in pdf.js, it is possible to change the default viewer by:
* [[How to disable the built-in PDF viewer and use another viewer]] -
hai gurus ,
my problem is i am sending pdf as email its working fine
but when i go and check the pdf file in scot transaction the file is not getting opened
plz help me
thanks in advance
anji.
Moderator message: please search for available information/documentation before asking, provide more technical details about errors when posting again.
Edited by: Thomas Zloch on Oct 28, 2010 10:58 AMHi,
Check this link [http://wiki.sdn.sap.com/wiki/display/Snippets/ConvertsspoolrequestintoPDFdocumentand+emails]
BR,
Lokeswari.
Moderator message: please do not post just links without any further explanations.
Edited by: Thomas Zloch on Oct 28, 2010 10:58 AM
Maybe you are looking for
-
ADF application to access WLS data source .
Hi, I have developed an ADF application in Jdeveloper 10.3.3 and deployed on Weblogic server. Now I want my application to access the data from data source created in WLS. I have created a data source (ds_demo) using the WebLoigc server option Servic
-
Connect iMac to Samsung flat screen
I have an imac with the intel chip and I just got a new samsung tv and i want to hook up my computer to my tv. I dont really know what i need to do to get it connect to the tv to watch stuff from the computer to my tv. So far I think i need this... h
-
Hi, my safari keeps unexpectedly quiting.
my safari keeps quiting and this pops up in the details page. Any help will be really great Process: Safari [1792] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier: com.apple.Safari Version: 7.0 (9537.71) Build Info: W
-
Extending Material to new plants - Legal Control
Hi All. I am extending a material to new plants by copying the data froma particular plant. Whats happening is for some plants the LEGAL CONTROIL data (Foreign Trade Import view) is automatically getting copied and populated but for some plants it is
-
Spry tabbed panels: Shows everything when it shouldn't
I have a spry tabbed panel with 2 tabs. In design view, this correctly shows me the contect of each of the tabs (a different table in each) when I click on the tab. When I run it in live view or the browser however, it displays both tabs TOGETHER, (i