How to email PDF form as attachment?
Hi All,
I have developed online interactive form app(dynamic).
When user clicks the submit button after entered the data,
I want to email the PDF form as an attachment to some users.
Could anyone please explain the steps or give me some sample code?
Thanks
Sundar
Hi Sundar,
I suggest you to see<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491">this.</a>
Regards,
Ram.
Similar Messages
-
How to email PDF form as an attachment?
Hi All,
I have developed online interactive form app(dynamic).
When user clicks the submit button after entered the data,
I want to email the PDF form as an attachment to some users.
Could anyone please explain the steps or give me some sample code?
Thanks
SundarI found this in one of the forums dont remember which, here is the code
public boolean EmailForm( java.lang.String pernr, java.lang.String toEmail, java.lang.String fromEmail )
//@@begin EmailForm()
boolean flag = true;
try {
String host = "exchangerelay.yourserver.com";
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getDefaultInstance (props, null);
// Define message
MimeMessage message = new MimeMessage(session);
byte[] b = wdContext.currentContextElement().getPdfSource();
//Attachment
ByteArrayInputStream ba = new ByteArrayInputStream(b);
String filename ="Filename.pdf";
//This will create a file on the server under folder "server0"
File file = new File(filename);
FileOutputStream fos = new FileOutputStream(file);
int i = 0;
for (i = 0; i < b.length; i++) {
fos.write(b<i>);
fos.close();
DataSource source = new FileDataSource(file);
BodyPart messageBodyPart = new MimeBodyPart();
message.setFrom(new InternetAddress(fromEmail));
message.addRecipient(
Message.RecipientType.TO,
new InternetAddress(toEmail));
message.setSubject ("Subject : ");
message.setText(
"This is a confirmation receipt.");
Multipart multipart = new MimeMultipart();
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setHeader("Content-Type", "application/pdf");
messageBodyPart.setFileName(filename);
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport transport = session.getTransport("smtp");
transport.connect(host, "username", "password");
transport.sendMessage(message, message.getAllRecipients());
transport.close();
flag = true;
//delete file if you want to here
file.delete();
} catch (FileNotFoundException e) {
flag = false;
wdComponentAPI.getMessageManager().reportException(
"FileNotFoundException : " + e.getMessage(),
false);
} catch (IOException e) {
flag = false;
wdComponentAPI.getMessageManager ().reportException(
"IOException : " + e.getMessage(),
false);
} catch (MessagingException e) {
flag = false;
wdComponentAPI.getMessageManager().reportException(
"MessagingException : " + e.getMessage(),
false);
return flag;
//@@end
thanks,
Sanketh -
Can you email completed PDF form as attachment by clicking on hyperlink you create?
Can you email completed PDF form as attachment by clicking on hyperlink you create?
This is not something we currently support but you can add or vote on feature ideas:
http://forums.adobe.com/community/formscentral?view=idea
If you need to add a new idea click "Create an idea" under "Actions" in the top right.
Thanks,
Josh -
Start process from emailed pdf form
I've set up a process with an email endpoint that has two steps:
1. set value (which does nothing)
2. User task which sends a pdf form to a user.
the idea is that when a pdf form is mailed to the specified mail account the process starts and sends the pdf to the correct user which then is supposed to review the form and approve it or decline it.
The process starts correctly on receiving the mail, and the pdf form is attached to the task but it doesn't contain the data that the user had entered before submission, it's empty.
I've tried submitting the form in all possible formats xml,xdp,pdf, and I've tried changing the type of the process variable, from xfaForm to Document Form, to Document, but I either end up with an empty form, or I get an error when trying to open the form associated with the process task.
does anyone has a simple example of how to accomplish this?
I know I am probably making some stupid mistake but for the life of me I can't figure out where the problem is.
thanks in advance for any help.
Aldo.Thanks a lot for your reply! At them oment i'm having problems with the server on which livecycle is installed. As soon as i get iu back up and running i will mail you the process.
Tahnks again.
Aldo. -
I am having a problem with getting my form to submit as an attachment once the submit button is clicked.
What I envision happening is , a form is completed on line from my website, the user click the SUBMIT button,
the email box opens , receipent address is automatically prefilled , the form is attached and is sent.
I created the SUBMIT button and selected "PDF the complete dcoument" option in the Submit Form Selections properties.
When I tested it the PDF form doesnot attach.
Can anyone enlighten me on what I am missing.
ThanksDo not use the PDF complete document for a web form. You are under license restrictions when you do that and web forms often will lead to a violation of those restrictions. The restriction comes because you have to activate User Rights on the form so folks with Reader can save the form for submission. The save process is not needed if the data is submitted and you are typically submitting a much smaller file. The data file can be imported to the original form and so you will have the same results as the customer.
Be careful with email submission for both client problems with e-mail submission (you have no control over this) and the lack of security if sensitive data is included. You should definitely not include credit card numbers or related info. -
How to email report ouput as attachment
Hi,
Can anybody tell me how to email report ouput as attachment.
Regards,
Soumya.Hi
check this
Refer this link:
FORM send_mail_2 USING msgid msgno msgv1.
mailuser oder Gruppe like sy-uname default 'Ruckerk'.
DATA: express_hold_time LIKE sovaltime.
DATA: text LIKE sotxtinfo.
DATA: receiver LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
MESSAGE ZF100 (FTP an UDB fehlgeschlagen)
text-msgid = msgid.
text-msgno = msgno.
text-msgv1 = msgv1.
text-msgv2 = ' '.
text-msgv3 = ' '.
text-msgv4 = ' '.
express_hold_time
express_hold_time-days = 01.
express_hold_time-h_min_sec = 240000.
receiver
receiver-receiver = mreceivr.
Gruppe von Empfängern
receiver-rec_type = 'C'.
und Expressmeldung ausgeben
receiver-express = 'X'.
APPEND receiver.
CALL FUNCTION 'MESSAGE_SEND_AS_MAIL'
EXPORTING
msgid = text-msgid
msgno = text-msgno
msgv1 = text-msgv1
msgv2 = text-msgv2
msgv3 = text-msgv3
TABLES
receivers = receiver.
IF sy-subrc <> 0.
WRITE:/ 'hat nicht geklappt', 'SY-SUBRC =', sy-subrc.
ENDIF.
PERFORM print_error_report.
Fehlermeldung zum Abbrechen des Report's ausgeben.
MESSAGE e398 WITH 'Jobabbruch' msgv1.
ENDFORM. " SEND_MAIL_2
Another Program:
*& Report ZSENDEMAIL *
*& Example of sending external email via SAPCONNECT *
REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Hello',
p_email(40) type c default '[email protected]' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
Adds text to email text table
form populate_message_table.
Append 'Email line 1' to it_message.
Append 'Email line 2' to it_message.
Append 'Email line 3' to it_message.
Append 'Email line 4' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
Send email message
form send_email_message.
Fill the document data.
gd_doc_data-doc_size = 1.
Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_receivers
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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
Regards
Anji -
How to email a .zip file attachment from PC
Hi,
Please, let me know how to email a .zip file attachment from Presentation Server.
Thanks,
Madhuri.Hi,
try fm SO_DOCUMENT_SEND_API1
it's well documented (look with SE37)
and look here:
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
regards Andreas -
How to save Pdf form localy without internet
How to save Pdf form localy without internet?
I thought in the beginning about advanced user rights and pure saving them on adobe reader but i saw legal notes about 500 user who can legaly save it localy and answer to me (bu they can`t answer to my client who paid me for doing this form).
Other thing is to do Air Application which would collect data from Pdf Form and save it (localy without internet) to use it later.
I thought about that second possibility but i can`t find any clue to do it myself.
Any help will be appreciated...Hi,
Are you downloading responses as PDF forms after forms are submitted? If so, FormsCentral doesn't provide an option to exclude empty fields and you won't be able to save PDF forms without empty fields.
You can use this form to "vote" on popular feature requests, or to add a new one of your own:
https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
Thanks,
Wenlan -
How to find the form name attached to AR Open item list
How to find the form name attached to AR Open item list
FBL5N -> Correspondance
Thanks
GaneshYou can find out in SPRO.
Go to tcode SPRO
Financial Accounting (New)
Financial Accounting Basic Settings (New)
Correspondence
Define Form Name for Correspondence Print
Here you will find the form attached to the program.
To find the attached program to the Correspondence type.
Go to tcode SPRO
Financial Accounting (New)
Financial Accounting Basic Settings (New)
Correspondence
Assign programs for the Correspondence Types
Regards,
Naimesh Patel -
How to create pdf forms in wda
how to create pdf forms in wda
hi,
check these links
https://www.sdn.sap.com/irj/sdn/adobe
https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning
http://help.sap.com/saphelp_nw2004s/helpdata/en/37/47a2be350c4ac8afe36b691203971f/frameset.htm
The following links contain all the detailed information (PDF & PPT docs) on Adobe Interactive Form with examples which wil make u'r learning easier:
https://www.sdn.sap.com/irj/sdn/adobe
Improving the Performance of Adobe® LiveCycleu2122 Designer Forms(scripting)
http://www.adobe.com/devnet/livecycle/articles/lc_designer_perf_guidelines.pdf
Interactive Forms Based on Adobe Software: Overview
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e635e290-0201-0010-a9be-9e8e4ce04770
Adobe Interactive Forms
http://www.saplounge.be/Files/media/pdf/Huberland-Interactive-Forms-2007.10.10.pdf
Taking interactive forms to next level
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8c103c36-0301-0010-cda8-f6b381bedb6e
Introduction to Adobe PDF Library SDK(PDFL SDK)(Simply scroll the document)
http://partners.adobe.com/public/developer/en/webseminars/PDFL_WebSeminar.pdf
Creating Interactive forms in webdynpro for java
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
PDF-Based Print Forms/SAP Interactive Forms by Adobe
http://help.sap.com/saphelp_nw04s/helpdata/en/c8/4adf7ba13c4ac1b4600d4df15f8b84/frameset.htm
Date Objects in Adobe Designer
http://help.sap.com/saphelp_nw04/helpdata/en/dd/60694fddb74ad88cdb7d2a094f3dd2/frameset.htm
Checking and Testing a PDF-Based Print Form
http://help.sap.com/saphelp_nw04s/helpdata/en/c2/1fe9aa4d7b413e8515f90b73729e97/frameset.htm
Architecture
http://help.sap.com/saphelp_nw04/helpdata/en/f2/21021b911f4c0cae11459a4ce0bc62/frameset.htm
http://www.nl4b.com/Adobe/Invitation_SAPBrussels_Q407.pdf
Yogesh N -
How to do pdf form from doc in Formscentral
Hi,
I would like to know how to make pdf form in formscentral with doc fileYou will have to use Acrobat to convert from doc to PDF, add the fields in Acrobat, and upload to the FormsCentral service. If you don't know how to do any of this, post again and let us know which steps you need more help with.
-
I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?
I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?
Chrome uses its own (incompatible) PDF viewer.
Download the PDF to your local disk, then fill it from there with Adobe Reader. Or use a browser that uses the Adobe PDF plugin. -
How to make PDF forms work in DreamWeaver
How to make PDF forms work in Dreamweaver
Look at DW's starter pages called "liquid" (FILE | New > Blank Page > "2 column, liquid" etc., or Google "liquid layouts".
-
How to save PDF form without empty fields ?
Hello,
I try to find how to save PDF forms after a school registration but without empty fields because i have lots of relation in my Form but i haven't.
Is it possible and how ?
ThanksHi,
Are you downloading responses as PDF forms after forms are submitted? If so, FormsCentral doesn't provide an option to exclude empty fields and you won't be able to save PDF forms without empty fields.
You can use this form to "vote" on popular feature requests, or to add a new one of your own:
https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
Thanks,
Wenlan -
How send a Print Form as attachment PDF?
Hi everybody,
I have created an Interactive Forms where I can input any new data.
When I click on the button for save the new data, I must also convert my Interactive Form in PDF for send it as attachment to email. When I have groped to convert the interactive form in a PDF file, I lost the data that I have inserted.
So I have created a Print Form through transaction SFP.
I recall the print form in background mode and gets the form of Interactive Data and requiring as import table OTF, but the OTF table is returned to me is different from that of a smartform and so I can not use the function module u2018CONVERT_OTFu2019.
Carryover in the code, you know give me directions?
With the code I'm used to create the PDF file and attach it to email, but the files that I receive by email can not I open it, probably because of an error in formatting during its creation.
I look forward to your advice,
Davide.Dear sirs, I can provide this program schema to send PDF print form as an email attachment. Hope it will help a bit.
FUNCTION ZPDF_MAIL_SEND.
""Lokální rozhraní:
*" IMPORTING
*" VALUE(PDF) TYPE FPCONTENT
*" VALUE(EMAIL) TYPE AD_SMTPADR
DATA lt_att_content_hex TYPE solix_tab.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = pdf
TABLES
binary_tab = lt_att_content_hex.
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,
lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
CALL FUNCTION 'ZREC_MAIL_GET_BODY'
IMPORTING
message_body = lt_message_body.
Message document
lo_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_message_body
i_subject = 'Úloha: vyplňte prosím následující formulář' ).
Add attachment
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 = 'Formulář'
I_ATTACHMENT_SIZE =
I_ATTACHMENT_LANGUAGE = SPACE
I_ATT_CONTENT_TEXT =
I_ATTACHMENT_HEADER =
i_att_content_hex = lt_att_content_hex ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
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.
lo_sender = cl_cam_address_bcs=>create_internet_address( email ).
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.
TRY.
lo_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all
EXCEPTIONS
OTHERS = 1 ).
CATCH cx_send_req_bcs. .
CLEANUP.
ENDTRY.
COMMIT WORK.
MESSAGE 'Formulář byl odeslán' TYPE 'I'.
ENDFUNCTION.
Maybe you are looking for
-
Loyalty Management - Redemption Process
Dear Experts, I'm a bit confused with the Loyalty Management redemption process with Partnership. Would appreciate if you could clear my thoughts. We have this process where currently, when a customer buys a product from a retail partner, the custome
-
Our BBM group was hacked, Admins lost there admin rights and all data and pictures within the group were lost. Is there a way to prevent this from happening in the future?
-
SOA 11.1.1.5 installation Windows W7 64 bit Error
Env: W7 - 64 bit Oracle DB 11.2.0.1 (Enterprise Ed) installed JDK 1.6_0.30 installed WLS 10.3.5 generic version installed using JDK 1.6_0.30. RCU 11.1.1.5.0 (installed) SOA 11.1.1.5.0 generic (error installing) I am getting compability error. Is JDK
-
How to Dispose/Remove/Clear/Delete Rectangleshape created on Form by button click
Hi Guys, I have a windows form where there are few textboxses and buttons. One of the button when clicked creates few rectangles to depict sort of design(its working) Now my problem is that I want to clear the form for the user to enter again. I am a
-
What is the successor to the 6600i slide?
I very much like the physical design and shape of this phone, but the voice quality, microphone placement and screen are all horrible. What is the 6600i slide's successor? I want to check it out to see if it's any better; if it is, I will upgrade, bu