on 12-14-2008 7:15 AM
Hi all.
I am using CONVERT_OTF_2_PDF function to convert smartforms output in PDF format . I can convert it But after saving it does not ask for print preview or print option .
For convert smartforms output in PDF format I am using Following functions :
1. CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
2. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
3. CALL FUNCTION fm_name
4. CALL FUNCTION 'CONVERT_OTF_2_PDF'
5. CALL METHOD V_GUIOBJ->FILE_SAVE_DIALOG
6. CALL FUNCTION 'GUI_DOWNLOAD'
Please help me.
HI,
Refer to this link....
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/convertSmartformtoPDFformat
Information "OTF end command // missing in OTF data...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Pass the blank value to no_dialog while passing the control_parameters structure to the
CALL FUNCTION fm_name. Now you will get the Pop-up for print option. if you pass 'X' the pop for print preview or print option will not be displayed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I passed all three parameters .
ST_OUTPUT_OPTIONS-TDPRINTER = V_E_DEVTYPE.
ST_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ST_CONTROL_PARAMETERS-GETOTF = 'X'.
but i am using below function is this right
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = V_LANGUAGE
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = V_E_DEVTYPE.
please help me..
Hi,
Yes ..what you are doing is right.
One more thing what you can do is .....comment this code ...ST_CONTROL_PARAMETERS-GETOTF = 'X'. and pass space to ST_CONTROL_PARAMETERS-NO_DIALOG ...when you get the Pop-up screen for the Print and print priview ..click on the print privew you get the view window from the menu TEXT->Print. then the spool is generated.
Use this RSTXPDFT4 to convert the spool to PDF. If the there is any error in generating the PDF then the what ever deveice type your getting in this V_E_DEVTYPE is enable to conver to PDF....try check for the any other Device Type and test.
You can find the Device types from Tcode SPAD.
check this code
ls_control_param-getotf = l_c_x. " Chk this to get otf data
call function l_v_fm_name
exporting
control_parameters = l_control_parameters "Smart Forms: Control structure "64417
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender "Structure for Object ID
output_options = ls_composer_param "SAP Smart Forms: Smart Composer (transfer) options
user_settings = ' '
shipment_num = shipment_num "Shipment Number
vttkvb = vttkvb "Shipment Head
tvtk = tvtk "Shipmenttype
tvtkt = tvtkt "Description Shipmenttype
ttds = ttds "Disposition
ttdst = ttdst "Description Disposition
vbpla = vbpla "Packages
num = l_v_num "Master or Individual BOL
nast = nast "Message Status
importing
job_output_info = it_job_output_info "Smart Forms: Return value at end of form printing "mod-001
tables
vttp = xvttp "Shipment Items
trlk = slk "Delivery
trlp = slp "Delivery Item
vtts = xvtts "Shipment Segments
vtsp = xvtsp "Segments/Items
vbpa = xvbpa "Partner
vbadr = xvbadr "Address
vtfa = xvtfa "Flow
vbplk = xvbplk "Shipment Unit Header
vbplp = xvbplp "Shipment Unit
vbpls = xvbpls. "Shipment Unit Sum
Get data in pdf format
it_itcoo = it_job_output_info-otfdata[].
if it_itcoo[] is not initial.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = v_bin_filesize
tables
otf = it_itcoo
lines = it_tline
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3.
if it_tline[] is not initial.
concatenate 'ABC.PDF'
into v_file.
Write the PDF file to above specified path in application server
open dataset v_file for output in binary mode.
if not sy-subrc is initial.
retcode = sy-subrc.
exit.
endif.
loop at it_tline.
transfer it_tline to v_file.
endloop.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.