Sending a form as a pdf via email with the BCS interface
Hi,
I would like to send a sapscript form as a pdf to a mail recipient using the BCS interface.
I started to investigate the BCS.
When using the function - CLOSE_FORM - I get the OTFDATA table - how do I send it as a pdf file with BCS ?
How different is sending an Ms-Word attachment ?
Thanks so much.
Promise to award points...
Ruthie.
Hai
Go through the following Code that will help you
REPORT ZRICH_0003.
DATA: ITCPO LIKE ITCPO,
TAB_LINES LIKE SY-TABIX.
Variables for EMAIL functionality
DATA: MAILDATA LIKE SODOCCHGI1.
DATA: MAILPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: MAILHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: MAILBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILREC LIKE SOMLREC90 OCCURS 0 WITH HEADER LINE.
DATA: SOLISTI1 LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
PERFORM SEND_FORM_VIA_EMAIL.
FORM SEND_FORM_VIA_EMAIL *
FORM SEND_FORM_VIA_EMAIL.
CLEAR: MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
REFRESH: MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
Creation of the document to be sent File Name
MAILDATA-OBJ_NAME = 'TEST'.
Mail Subject
MAILDATA-OBJ_DESCR = 'Subject'.
Mail Contents
MAILTXT-LINE = 'Here is your file'.
APPEND MAILTXT.
Prepare Packing List
PERFORM PREPARE_PACKING_LIST.
Set recipient - email address here!!!
MAILREC-RECEIVER = '[email protected]'.
MAILREC-REC_TYPE = 'U'.
APPEND MAILREC.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = MAILDATA
PUT_IN_OUTBOX = ' '
TABLES
PACKING_LIST = MAILPACK
OBJECT_HEADER = MAILHEAD
CONTENTS_BIN = MAILBIN
CONTENTS_TXT = MAILTXT
RECEIVERS = MAILREC
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
ENDFORM.
Form PREPARE_PACKING_LIST
FORM PREPARE_PACKING_LIST.
CLEAR: MAILPACK, MAILBIN, MAILHEAD.
REFRESH: MAILPACK, MAILBIN, MAILHEAD.
DESCRIBE TABLE MAILTXT LINES TAB_LINES.
READ TABLE MAILTXT INDEX TAB_LINES.
MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
Creation of the entry for the compressed document
CLEAR MAILPACK-TRANSF_BIN.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 0.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'RAW'.
APPEND MAILPACK.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM GET_OTF_CODE.
LOOP AT SOLISTI1.
MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
APPEND MAILBIN.
ENDLOOP.
DESCRIBE TABLE MAILBIN LINES TAB_LINES.
MAILHEAD = 'TEST.OTF'.
APPEND MAILHEAD.
Creation of the entry for the compressed attachment
MAILPACK-TRANSF_BIN = 'X'.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 1.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'OTF'.
MAILPACK-OBJ_NAME = 'TEST'.
MAILPACK-OBJ_DESCR = 'Subject'.
MAILPACK-DOC_SIZE = TAB_LINES * 255.
APPEND MAILPACK.
ENDFORM.
Form GET_OTF_CODE
FORM GET_OTF_CODE.
DATA: BEGIN OF OTF OCCURS 0.
INCLUDE STRUCTURE ITCOO .
DATA: END OF OTF.
DATA: ITCPO LIKE ITCPO.
DATA: ITCPP LIKE ITCPP.
CLEAR ITCPO.
ITCPO-TDGETOTF = 'X'.
Start writing OTF code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZTEST_FORM'
LANGUAGE = SY-LANGU
OPTIONS = ITCPO
DIALOG = ' '
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'START_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
Close up Form and get OTF code
CALL FUNCTION 'END_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
MOVE-CORRESPONDING ITCPO TO ITCPP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = ITCPP
TABLES
OTFDATA = OTF
EXCEPTIONS
OTHERS = 1.
Move OTF code to structure SOLI form email
CLEAR SOLISTI1. REFRESH SOLISTI1.
LOOP AT OTF.
SOLISTI1-LINE = OTF.
APPEND SOLISTI1.
ENDLOOP.
ENDFORM.
Regards
Sreeni
Similar Messages
-
Deny user's sending pdf via email, so the option is not available
HI,
i have some sensitve data that i would like to create a variaty of PDFs for and have them availabe on my company intranet, i need users to be able to open and read these documents, but not edit them in any way, eg, no printing/ saving/ emailing/ editing of the content,/ screen shots/ or highlighting the content and pasting it into another document, all i want them to be able to do is "READ ONLY"
is Adobe Acrobat Pro the solution that i can use to do this with and HOW,
please respond ASAP
ToddEast LT is trying to limit 'scraping' for a user who already has the file open - even with DRM that's simply a case of PrintScreen > Create PDF > From Image > OCR.
'Clean rooms' are actually very simple to implement, and many small organizations do it in preference to the investments required for DRM. You just need to put a computer in a locked office, make sure it's unplugged from the Internet and have a supervisor stand behind the person as they use it. We've had systems like that running on construction sites to prevent people 'borrowing' the plans - in which case it was a laptop chained to the wall in the security guard's cabin. The guard is already there so it cost nothing.
LCDRM is all well and good, but we must be honest - unless Adobe re-open the Document Center service, it's beyond the budgets of anyone other than enterprise-class customers. -
Hi,
How can i send an created bill as pdf via email?
Can anybody suggest if there is any BADI/User Exit/Configuration exists in order to email Billing document as a PDF attachment while saving from VF01 or VF02?
ThanksHi Marcus,
Did you try using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1 '.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = xs_gd_doc_data
put_in_outbox = lc_true
commit_work = lc_true
IMPORTING
sent_to_all = lv_sent_all
TABLES
packing_list = xt_packing_list
contents_txt = xt_message
receivers = xt_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.
IF sy-subrc 0.
*Do Nothing
ENDIF.
Hope it resolves your query.
Regards,
Manish -
I cannot send a Pages document, Word via email if the doc contains a picture. If I email a Pages doc without a pic in Word format or pdf with a pic it with go through to sender? Not sure why Pages won't send Word doc with a picture in it. I check the security on the email recipient and the email doesn't get blocked or throw in the junk box?
thanks,
drainguy41If you have upgraded to Mountain Lion, Save As… has returned to the File menu when you hold down the Option/alt key. But you don't really "save" as other file types, you translate & export as Word or RTF or text or PDF & that is easily done by going to File > Export or Share > Export.
Also, please do us all a favor & don't use all capitals in your posts, either the body of the post or the title. All caps is the internet equivalent of shouting & is very hard to read. -
Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email. the button did not work and i looked online and saw where you could change it to a regular button and enter the email for it to go. it worked, but only for those with adobe pro. i could not get it to work with reader. is there a way i can make it work for reader?
Noted.
The LiveCycle user to user forum is across town at:
Adobe LiveCycle
Be well... -
Send spool id output (sap script) via email in PDF format
Dear friends,
Looking for sample program to send spool id output of sapscript via email in PDF format.
Regards,
Praveen LoboHi,
Try this code..
* Parameters.
PARAMETERS: p_email(50) LOWER CASE.
PARAMETERS: p_spool LIKE tsp01-rqident.
* Data declarations.
DATA: plist LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: document_data LIKE sodocchgi1.
DATA: so_ali LIKE soli OCCURS 100 WITH HEADER LINE.
DATA: real_type LIKE soodk-objtp.
DATA: sp_lang LIKE tst01-dlang.
DATA: line_size TYPE i VALUE 255.
DATA: v_name LIKE soextreci1-receiver.
DATA rec_tab LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
* Get the spool data.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = p_spool
first_line = 1
last_line = 0
desired_type = ' '
IMPORTING
real_type = real_type
sp_lang = sp_lang
TABLES
buffer = so_ali
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
* Check the return code.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'Error'.
LEAVE LIST-PROCESSING.
ENDIF.
* Prepare the data.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 0.
plist-body_num = 0.
plist-doc_type = 'RAW'.
plist-obj_descr = 'Spool data'.
APPEND plist.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 1.
DESCRIBE TABLE so_ali LINES plist-body_num.
plist-doc_type = real_type.
* Get the size.
READ TABLE so_ali INDEX plist-body_num.
plist-doc_size = ( plist-body_num - 1 ) * line_size
+ STRLEN( so_ali ).
APPEND plist.
* Move the receiver address.
MOVE: p_email TO rec_tab-receiver,
'U' TO rec_tab-rec_type.
APPEND rec_tab.
IF NOT sp_lang IS INITIAL.
document_data-obj_langu = sp_lang.
ELSE.
document_data-obj_langu = sy-langu.
ENDIF.
v_name = sy-uname.
* Subject.
document_data-obj_descr = 'Spool attached'.
* Send the email.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
sender_address = v_name
sender_address_type = 'B'
TABLES
packing_list = plist
contents_bin = so_ali
receivers = rec_tab
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE e208(00) WITH 'Error in sending email'.
ENDIF.
COMMIT WORK.
* Send the email immediately.
SUBMIT rsconn01
WITH mode = 'INT'
AND RETURN.
* Success message.
MESSAGE s208(00) WITH 'Email sent'.
Thanks
Naren -
How can i reduce the pdf file size? I need to send via email, at the moment its at 10mb
How can i reduce the pdf file size? I need to send via email, at the moment its at 10mb
Reducing PDF file size or Optimizing PDF is the feature that is supported only by Acrobat Pro (desktop app that is not free).
Optimizing PDFs (Acrobat Pro)
Free Adobe Reader products (Reader XI desktop, Reader for iOS, Reader for Android, Reader Touch for Windows 8, etc) do not offer the capability. -
I used to be able to send document as a PDF or Word Document via email using the toolbar.
I used to be able to send Pages documents as a PDF or Word Document via email using the Pages toolbar (not the iWork feature). Lately, it hasn't been working at all. No email pops up; just nothing. Is anyone else having this problem? Any solutions? I'm running Pages '09 version 4.1.
This Apple Express Helper is a dumb one.
File names with # and $ are perfectly treated by the share to Mail feature.
What is rejected is the slash (/) and it's perfectly normal.
Since the delivery of the first version of OS X, slash is an illegal character in file names.
Apple thought that it would be fair to build a piece of code taking care of such chars because they were valid ones in the older operating systems.
But they expected that users will drop these chars. Alas they didn't and users like you are continuing to play with matches.
At last, OS X 10.7 removed the extraneous code and now, hosanna, iWork refuse to export files whose name contain the infamous slash.
Yvan KOENIG (VALLAURIS, France) lundi 9 avril 2012
iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k -
Goodreader will allow me to send a PDF via email but my notes wont go?
I do apologize as I am very new to this. I did just download goodreader onto my iPad 2. It is very simple to use but I do have an issue. I was forwarding a PDF via email. I attached a note along with it, just above my signature. The email did go to a PC and the attachment was their, but the note and signature was attached as another attachment as a .txt file. The odd thing is, if I copy the email to myself it shows the note and signature? I hope i explained this situation so that it is understandable and thanks for any advise. Really am a big fan of the Apple products, even have a new iPhone 4 being delivered tomorrow.
GYes, but selecting the icon only gives me the option to print.
-
Submitting a PDF via email through Acrobat
What im looking to do is have a submit button, which i have created, and have that "submit button" either directly email the person it's supposed to go to or bring up a blank email with the persons email to whom it is supposed to go to already in the address line.
Lost is submission landWhat are you opening it in> if Apple Preview its DOA (and I am a Mac User).
Also maybe you need to keep a Copy on your computer and on the other machine have the info sent as a FDF and have it fill in the Pdf on the receiving end If you've go to send by email. Most people here think using email for submittion is silly and Dangerous. They everyone wanting to do so has access to a server and need a web expert set it up to run on wbsite.
I know I did a submitt a PDF application form for an assciation years agoit was a Bear to get working found out a copy of the blank for had to be on the other end with the exact same name. But once I got it working it worked well. -
please help!!!!!! i filled out a job application using adobe reader but i cannot send the file back via email because the file is protected with a lock. how do i unlock this file to send it?!!!!!!!!!
Hi kevinv1987,
It doesn't sound like the PDF was password protected (or Adobe Reader would prompt you for a password). Instead, it sounds like that file may be marked locked by your operating system. Are you on Mac OS or Windows? In either case, here are instructions for removing the lock icon from the file:
Remove the Lock Icon from a Folder in Windows 7 (check Microsoft's website if you have a different version of Windows)
On Mac OS, select the file in the Finder, and choose File > Get Info. Then, just deselect the Lock checkbox.
Please let us know how it goes.
Best,
Sara -
How can I automatically email the completed form as a pdf for signing to the respondent?
how can I automatically email the completed form as a pdf for signing to the respondent?
Have your husband text the word "stop" to 48369. This should take his number out of the iMessage system.
Go into your settings under messaging and make sure the box to send as an SMS if iMessage is unavailable is checked.
Hopefully this will get your messages sending/receiving to each other. -
i work for a retailer who sends out e-receipts as pdf attachements. When the email arrives on any apple product, i see the email with the paperclip icon showing that there is an attachment but i cannot ever see or find the actual attachment. Any ideas?
i have scrolled left, right, up and down on iphone4, iphone5 and ipad and the attachment simply does not exist. It has to be something with the apple mail client setup because for any mail client, if they go to the webemail thru safari, the attachment is there and it can be viewed without issue.
I know there are plenty of people out there with this issue with the mail clients set up that you access thru the email icon on the iphone and ipad but i cannot find anyone with a resolution. I cannot find any settings in the mail client setup that has anything to do with attachments or for what attachments can or cannot be read or seen.
Hopefully someone out there has figured something out because this is an odd one. -
Sharing PDF via email in Pages 09
This has not been a problem. However I just upgraded to Yosemite and now I cannot share as PDF via email; no problem with word or pages but this function seems to be lost
Since Apple has retired all Pages applications prior to v5, they have no concern about backwards compatibility, or the effect of new operating systems, or newer applications on those retired applications. There is no guarantee that any point release to Yosemite, or subsequent OS X release would enable Pages ’09 functional continuity. It simply is not an Apple agenda item.
For those who remain attached to Pages ’09, and do not have their documents duplicated in MS Word documents — and backed up — a sudden failure of Pages ’09 would mean opening those Pages ’09 documents in Pages v5, and risk loss of content due to unsupported features. -
How do I send a page via email in the body of the mail and not as an attachment?
I wish to send a page via email in the body of the mail. The only option to send a page appears to be to save it first and then attatch to the mail.
When you are in the Plan View, right click on the icon for the page that you want to omit from the menu. Near the bottom, you'll see Menu Options, click on that and you'll have the choice to Exclude Page from Menus.
Maybe you are looking for
-
Can i use my ipad mini while charging? Would it be affect he battery life span?
Can i use my ipad mini while charging? Would it be affect he battery life span?
-
ColorSnyc 4.6 Calculator Magnifing Glass Not Working
I'm on a macbook pro. 10.6.2. Colorsync 4.6.2 When I use colorsync calculator, the magnification glass which is supposed to take a spot sample of a color and then tell you the what the color calculations are doesn't work. I get a circle with the whol
-
Error message "there is a problem with the printer turn the printer off than on again"
I have a new HP 7525 HP photosmart printer, went to use it to find all lights flashing with an error message on screen " There is a problem with the printer. turn the printer off than on again" this does not resolve the problem.. unable to clear th
-
Good Morning Everyone, We got the message: Unable to run report to the Paper Design. REP 1219: B-1 has no size -- length or width is zero.We founded B_A http://1.bp.blogspot.com/_jHOjXtHYkXM/TJtOiq_Ro_I/AAAAAAAAADs/OC-coL_aYco/s1600/REP1219AB_1.JPG I
-
Own an N100 wife had machine away in a hotel recently and according to her she answered ano to some question that appeared as she connected to internet. Anyway machine arives home and all of a sudden does not connect. Followed all options presented