Smartform to PDF, how to suppres Print/Preview dialog
Hi Experts,
Facing some issues in downloading PDF converted from Smartform.
In the program I am trying directly download a smartform converted into PDF format and save it in local system.
When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.
I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.
Here the entire code is...
REPORT yfr_invoice.
TABLES : t001, bsad, bsid, kna1,sscrfields .
DATA : fm_name TYPE rs38l_fnam.
DATA : it_bsad TYPE STANDARD TABLE OF bsad.
DATA : BEGIN OF it_bseg OCCURS 0,
belnr TYPE belnr_d,
END OF it_bseg.
DATA : error_flag.
DATA:
cont_param TYPE ssfctrlop,
out_param TYPE ssfcompop,
otfdata TYPE ssfcrescl,
t_tline TYPE TABLE OF tline INITIAL SIZE 0,
t_docs TYPE STANDARD TABLE OF docs,
v_filesize TYPE i,
v_name TYPE string,
v_path TYPE string,
v_fullpath TYPE string,
v_filename TYPE string,
v_filter TYPE string.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_bukrs FOR t001-bukrs NO-EXTENSION NO INTERVALS OBLIGATORY.
SELECT-OPTIONS : s_gjahr FOR bsid-gjahr NO-EXTENSION NO INTERVALS OBLIGATORY.
SELECT-OPTIONS : s_rebzg FOR bsid-rebzg OBLIGATORY.
SELECT-OPTIONS : s_kunnr FOR kna1-kunnr.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'YFF_INVOICE'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
cont_param-getotf = 'X'.
cont_param-no_dialog = 'X'.
cont_param-preview = 'X' .
CALL FUNCTION fm_name
EXPORTING
control_parameters = cont_param "Passing getotf = 'X'
IMPORTING
job_output_info = otfdata
TABLES
s_bukrs = s_bukrs[]
s_gjahr = s_gjahr[]
s_rebzg = s_rebzg[]
s_kunnr = s_kunnr[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
ELSE.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = v_filesize
TABLES
otf = otfdata-otfdata
doctab_archive = t_docs
lines = t_tline
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CONCATENATE 'filename' '.pdf' INTO v_name.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
default_extension = 'PDF'
default_file_name = v_name
file_filter = v_filter
CHANGING
filename = v_name
path = v_path
fullpath = v_fullpath.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_filesize
filename = v_fullpath "'C:\Test.pdf'
filetype = 'BIN'
TABLES
data_tab = t_tline
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
The program other wise works absolutly fine .
Please advise.
Thanks
Jahan
Moderator message - Cross post locked
Rob
Similar Messages
-
Download smartform as PDF, suppress Print/Preview dialog
Hi Experts,
Facing some issues in downloading PDF converted from Smartform.
In the program I am trying directly download a smartform converted into PDF format and save it in local system.
When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.
I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.
Here the entire code is...
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
The program other wise works absolutly fine .
Please advise.
Thanks
Jahan
Edited by: Rob Burbank on Apr 8, 2010 11:10 AMHelloo Guyz...
I am exactly trying the same, but the Print Dialog is still coming ...
See here is my code ..
cont_param-getotf = 'X'.
cont_param-no_dialog = 'X'.
cont_param-preview = 'X' .
CALL FUNCTION fm_name
EXPORTING
control_parameters = cont_param
IMPORTING
job_output_info = otfdata
TABLES
s_bukrs = s_bukrs[]
s_gjahr = s_gjahr[]
s_rebzg = s_rebzg[]
s_kunnr = s_kunnr[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
even after this ..during execution the the Print Dialog is coming..
I have no idea what esle I am missing..
Thanks -
How to find print preview for purchase order like what we find in va03
hi guru's
how to find print preview for purchase order like what we find in va03
let me share ur information
thank uHi
You can see the Print Preview/printout etc using the Transaction ME9F for Purchase Order
Execute the ME9F tcode and execute you will get lot of PO's select any Po and press display message
you will see the print preview
Similarly for RFQ output use the Tcode ME9A
for Contrat use ME9K
for GR output use MB90
Reward points for useful Answers
Regards
Anji -
Safari 7.0.6, using Adobe Acrobat 11.0.10, isn't rendering pdf files in the Print Preview screen. Additionally, only a single, blank page prints for a multi-page pdf document. Any ideas?
Figured it out. It had nothing to do with the software levels of Safari or Adobe Acrobat. Here's the fix:
Open Finder/Applications
Search "Internet Plug-Ins"
Move any Adobe plug-ins to the trash
Quit Safari
Launch Safari
Your pdf document should now render in Print Preview and print properly. -
How to enable Print Preview with the Envy 5530
How to enable Print Preview on the Envy 5530
Hi,
A print preview is not offered by the current HP software as older software versions provided.
A preview is only available if the application you are printing from include a such, it is not provided by the printer driver itself.
Shlomi
Say thanks by clicking the Kudos thumb up in the post.
If my post resolve your problem please mark it as an Accepted Solution -
Image looks great in PS- when I go to print, it looks grainy in printer preview dialog box and prints blurry. Why is this happening?
PS CC, Yosemite, Epson 3880 (called espson to make sure it wasn't something with that), saved as a tiff/psdjpg- all files behave the same way. When I open the raw file- and only crop the image- it behaves this way now- with grain and blur when printing. No other files do this in the same shoot. I worked on this image- could something have gotten corrupted along the way such that now even opening the raw file creates this problem. SInce upgrading my computer - a window pops up when I open PS that says I need to update my graphics card?? for 3D- I'm not using 3D- so I don't know if that means anything. I have to leave for about an hour- but greatly appreciate any feedback. I will be in touch. Thank you.
-
Problem with print preview dialog action in CS4
I have a automation plugin for Photoshop that print a image playing a Photoshop print preview dialog.
The script works on CS3 but not in CS4. There is some specific platform tags (Mac uses 'keyPrintSettings' and 'keyPageFormat' that are OpaqueStructPtr and it's not possible to take the size, and Windows uses 'keySystemInfo' and there is no information about this data) and it's not possible to ignore.
I attach a sample functions for CS3 (working) and CS4 (not working).
Some one have information about this problem?Hi, try to implement the note 1116359.
reward if usefull. -
How to show print Preview of an file in java
Hi,
Suppose i have a file like "bina.xls". Now i want to see the print preview of this file from java code. How is this possible? I s there anybody can help me? now i am in serious trouble with this? I can generate an excel file. But i can not show this file with JExcelApi. i can know that this is possible with jasper report, how this is possible with Jasper Report ? if any one help me with sample code then i will be very gratefull to u . Please help me.
With Regards
BinaThis forum is exclusively for Sun Java Studio Creator. Please post your queries on appropriate forums to have better discussions :
e.g.
Java Technology Forums - Java Programming :
http://forum.java.sun.com/forum.jspa?forumID=31 -
I am unable to print anything through FF. I have tried the printer and also to pdf factory. Both result in blank pages being printed and also blank print previews. I am using FF 5.0. I have no problem with IE, Chrome or Safari. In order to print from FF I have to copy the text etc and paste into Word.
'''I have updated to FF 6.0 and this seems to have resolved the problem'''
-
How to realize "print preview" in Flex?
I checked the sample in Flex Help on printing with Flex. How can I realize "preview" function?
Thanks!Many websites offer a "printer friendly" version of a certain page. That IMO is the only way to solve your problem, next to using CSS to use a different style for printer output. Here is a tutorial that covers this:
http://www.alistapart.com/stories/goingtoprint/ -
Dear All,
can any body have any idea about how to view the ARE-1 form print preview
regards
hari kumaru can view by vf03 billing document--issue output to screen and give the req details and display it
Cheers
Shalsa007........ -
How to Sow Print Preview by Presssing a Button
I have a button on a form. When the user click this button he is redirected to a Print Friendly page. He can then print that by using standard internet explorer tools like
File ---- Print Preview ( To preview it)
Or
File------- Print (to Print it)
I want that when the user click this button he directly goes to the print preview of the said page. How is it possible.I would start with Print Button
It has a couple of different suggestions that should get you started in the right direction. -
How to trigger print preview like ME23N ?
Hello,
I got a requirement like in ME23N in the applicatin tool bar Print preview. I have to keep a button in my screen painter and when i click print preview automatically the script has to trigger.
For this i have got the data stored in the table and i have designed the script and its working fine. But my problem is how to call the script automatically when i click prinr preview. Wheather i have to call function 'Transaction' "Txcode" or can any give me the idea for this to achieve?
ThksHi Friend,
Use the function module:
OPEN_FORM for opening form
WRITE_FORM to pass data to script
CLOSE_FORM to close the script
at the time of opening the form pass the printer information.
It will give the print preview.
Regards
Krishnedu -
How to find Print Preview in APP for payment advice.
Hi , Freinds ,
Payment Remittance Advice
My requirement is when Iam running APP , the print program is RPFI_RFFOAVIS_FPAYM and the standard form is F110_IN_AVIS . I could not view the Script output after running vendor payment.
Where should we be able to view the printpreview for this . My requirement is to modify the form based on client requirements..But i could not view the preview...
please reply..
thanks..Hi,
Open the form F110_IN_AVIS in form painter(SE71).
GOTO>Utility>Printing Test
Select Print Preview Button or press F8 key.
This will display the preveiw of form.
Thanks. -
NW2004s Preview ABAP - How to get print preview?
Hi,
does anybody had success in getting a print preview of a WD e. g. ALV-List?
A Weblog of this feature would be pretty cool ...
Greets
Olafdone have okay
IF SY-MSGV1 <> '' OR SY-UCOMM = 'PRNT'.
MESSAGE 'PRINTED' TYPE 'S'.
ELSE.
MESSAGE 'NOT PRINTED' TYPE 'S'.
ENDIF.
Maybe you are looking for
-
IPhoto problem after upgrading to Leopard from Panther
I successfully (more or less) upgraded my 867 MHz G4 to Leopard from Panther earlier in the week. Now I find that every time I try to open iPhoto I get the message 'The application iPhoto quit unexpectedly.' I have repaired permissions, restarted the
-
Is there limit to file creation of file on application ?
Hello Gurus, I have a huge internal table nearly of size 3-4 GB which is being downloaded on application server. using ws_download. Now when this process is going on the program is giving a dump saying the maximum limit is reached. And in the code a
-
Major query performance differnce between oracle 8 and 9
Hello, I have the following query select distinct UPPER(rf.module), ruf.rpt_seq from role_func rf, rd_url_func ruf where role_name = 'ADMIN' and UPPER(rf.module) not in (select UPPER(ruf.module)
-
Hello together, we are using BPM for processing EDI order entries. We have one main process and depending of the destination system different Sub processes. Unfortunately we are running into performance problems with the BPM. From my point of view is
-
Yet another MacBook Pro touchpad driver support thread (regarding KDE)
Hi I recently bought a MBP Retina 13" Late 2013, just because this masterpiece of hardware has the best price-performance ratio in this price segment. OS X sucks, because developing on it in a scientific way is a pain. GTest with c++11 problems, curi