Why is it when I print preview smartform output in PDF format, all thai characters printed as funny characters?
My command is as below:
control_parameters-no_dialog = 'X'.
control_parameters-getotf = 'X'.
output_options-tddataset = 'SMART'.
output_options-tdsuffix2 = sy-uname.
output_options-tdimmed = 'X'.
output_options-tddelete = 'X'.
output_options-tdlifetime = '1'.
output_options-tdcopies = '1'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
formname = 'ZMM_VMR_01'
fm_name = lf_fm_name
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION lf_fm_name
user_settings = ' '
control_parameters = control_parameters
output_options = output_options
job_output_info = job_output_info
sitab = t_basic_t
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Is there anything missing? do I have to print to spool and then read from spool to preview via PDF? What user want is to preveiw in PDF and if they are satisfied, they will save the document from PDF.
Edited by: Julimainoe Mohd Noh on Oct 10, 2011 11:29 AM
Some parameters need to be set correctly when calling the smartform function module. Parameter output_options-tddest needs to be set to an output device that is defined with a correct Thai device type like e.g. THSAPWIN. The parameter 'User Settings' should not be filled.
you must install a true type font to your local PC, that has Thai characters inside. Print preview is a Dialogue/Frontend processing method and has nothing to do with the PDF-generation at backend.
To display a pdf preview, you must upload the truetype font with thai characters to the application server.
There is a SAP-note, where you can find a table, which fonts are available for thai.
Thanks for the reply.
I've set output_options-tddest = 'THSAPWIN' but PDF preview display on screen is still the same where Thai characters printed as funny character. Is there anything I have to do for device type THSAPWIN? I've also tried device type 'PDFUC' and the result is the same.
Edited by: Julimainoe Mohd Noh on Oct 11, 2011 5:40 AM
If you use device type THSAPWIN, then you must install the Angsana New fonts under font family THANGSAN via report RSTXPDF2. See SAP note # 339832. Also the language key of the smartform must be TH. i.e. When the application calls the smartform function module, the parameter CONTROL_PARAMETERS-LANGU should be set to '2'. 2 is the short version of TH.
Finally font THANGSAN should be used for Thai characters in the smartform. iIf you use device type PDFUC, then the Angsana New fonts must be installed via report RSTXPDF2UC. See SAP note #999712.