04-08-2010 3:52 PM
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 AM
04-08-2010 4:05 PM
Hi Jaif,
Try this code:-
DATA: T_SSFCTRLOP TYPE SSFCTRLOP. "FOR SMART FORMS
DATA: FNAME(30).
DATA: T_SSFCRESCL TYPE SSFCRESCL. "FOR SMART FORMS AFTER PRINTING DATA TO CONVERT IN PDF FORMAT
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YFF_INVOICE'
IMPORTING
FM_NAME = FNAME.
****Pass this three parameters
T_SSFCTRLOP-NO_DIALOG = 'X'.
T_SSFCTRLOP-GETOTF = 'X'.
T_SSFCTRLOP-LANGU = 'E'.
CALL FUNCTION FNAME
EXPORTING
CONTROL_PARAMETERS = T_SSFCTRLOP
IMPORTING
JOB_OUTPUT_INFO = T_SSFCRESCL
TABLES
T_FORMDATA = T_FORMDATA.
CALL FUNCTION 'HR_EFI_SHOW_PDF_FORM'
EXPORTING
TOP_EDGE = 0
LEFT_EDGE = 0
TABLES
OTF_TABLE = T_SSFCRESCL-OTFDATA.
Thanks,
Rahul Ghosh
04-08-2010 4:05 PM
Hi Jaif,
Try this code:-
DATA: T_SSFCTRLOP TYPE SSFCTRLOP. "FOR SMART FORMS
DATA: FNAME(30).
DATA: T_SSFCRESCL TYPE SSFCRESCL. "FOR SMART FORMS AFTER PRINTING DATA TO CONVERT IN PDF FORMAT
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YFF_INVOICE'
IMPORTING
FM_NAME = FNAME.
****Pass this three parameters
T_SSFCTRLOP-NO_DIALOG = 'X'.
T_SSFCTRLOP-GETOTF = 'X'.
T_SSFCTRLOP-LANGU = 'E'.
CALL FUNCTION FNAME
EXPORTING
CONTROL_PARAMETERS = T_SSFCTRLOP
IMPORTING
JOB_OUTPUT_INFO = T_SSFCRESCL
TABLES
T_FORMDATA = T_FORMDATA.
CALL FUNCTION 'HR_EFI_SHOW_PDF_FORM'
EXPORTING
TOP_EDGE = 0
LEFT_EDGE = 0
TABLES
OTF_TABLE = T_SSFCRESCL-OTFDATA.
Thanks,
Rahul Ghosh
04-09-2010 11:54 AM
Thanks Rahul...
This solution worked I coud directly save in PDF format from previw.
04-09-2010 7:09 AM
Hai
To convert Smartforms output To PDF format , we can use the SAP Program "RSTXPDFT4"
04-09-2010 7:17 AM
I think the problem is the print preview is not supressed. Pass the NO_DIALOG field in CONTROL_PARAMETERS of the FM as 'X'. This will supress the print preview dialog.
04-09-2010 7:36 AM
Hi JAIF ,
For the below control parameter pass value as X.
CONTROL_PARAMETERS-getotf
CONTROL_PARAMETERS-no_dialog
CONTROL_PARAMETERS-PREVIEW
04-09-2010 8:16 AM
Helloo 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
04-09-2010 8:32 AM
04-09-2010 8:35 AM
set:
cont_param-getotf = 'X'.
cont_param-device = 'PRINTER'.
cont_param-preview = ''.
cont_param-no_dialog = 'X'.
cont_param-tddest = 'LP01'.
04-09-2010 9:27 AM
Hello Guyz ..
It really didnt work ..after all these parameters..
I tried using same parameters and run the standalone smartform FM,
But its still showing the print dialog
Some thing we all are missing ..
04-09-2010 11:27 AM
pass parameter TDNOPREV = 'X' in OUTPUT_OPTIONS PARAMETER and try. It should work now.
04-09-2010 8:50 AM
Yes....I missed it in earlier post.....The PREVIEW parameter should be set to blank as well as told by abapuser.