Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

sth about Chinese language when convert smartform to pdf file

Former Member
0 Kudos

the sf name 'X', original language is Chinese,and my login language is Chinese too

i didnot give any value to SSFCTRLOP-langu

when i call func to print the sf, the content in Chinese is right

but when i call func CONVERT_OTF & gui_download to get the pdf file

the content in Chinese become '#' or sth like this which i cannot recognize

what really wired is coming

i login the qas system, call sf 'X' ,everything is ok

so i Download this sf, and upload it into the dev name as ‘a1’, i call 'a1' in dev ,Chinese content cannot be recognized

and then login dev system, call sf 'X', everything not ok

so i Download the sf 'X', upload it into the qas name as 'a2', i call a2 in qas, Chinese content can be recognized

and then.

i create another sf ‘Y' in dev system , i just using the same program, and in debug mode, when call SSF_FUNCTION_MODULE_NAME  i changed formname from 'X' TO 'Y', everything is ok Chinese content can be recognized

i checked spad about the output device, dev' & qas' are the same

any one help! thanks~

10 REPLIES 10

Former Member
0 Kudos

Check if my earlier response to similar problem helps...

Error in Transaction ME23N

In case you don't find the above I have pasted my communication below

Is your device type Unicode enabled, try with Unicode enable (Device Type PDFUC). You also require Chinese support language packs for Adobe, which needs to be installed on your system separately.

Hope this helps or gives you a direction to go forward.

Regards

Abhijit

0 Kudos

Thanks Abhijit.

the device type in dev and qas both are 'CNSAPWIN'

Former Member
0 Kudos

Hi Timothy,

You can check with your basis. Is there Chinese language pack for Adobe.

IF not, the character of Chinese will be display as messy codes.

Regards,

Yawa

0 Kudos

Thanks Yawa.

yes i am sure there is Chinese language pack for abode

just as i said, when i create another sf with some text in Chinese,it is ok

0 Kudos

You mean some characters are correct. some characters are displayed as messy code.

or all the Chinese texts are displayed as messy code in your PDF file.

0 Kudos

in the dev system,there are some smartforms ,all the Chinese texts are displayed as messy code in your PDF file, and when i download the smartform from dev system, upload into the qas, all the Chinese texts are displayed as normal instead of messy code

in the dev system, there are also some smartforms, all the Chinese texts are displayed displayed as normal instead of messy code

0 Kudos


Please show your source code of how to convert to PDF file part.

0 Kudos

FORM print_pdf_it USING pv_filename.

  w_form_name = 'ZSALE_ORDN_IT'.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname                 = w_form_name

    IMPORTING

     fm_name                   = w_fmodule

  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.

* Calling the SMARTFORM using the function module retrieved above

* GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF

* format of the output

  w_cparam-no_dialog = 'X'.

*w_cparam-preview = space. " Suppressing the dialog box

  w_cparam-getotf = 'X'.   

* Printer name to be used is provided in the export parameter

* OUTPUT_OPTIONS

  w_outoptions-tddest = 'LP01'. "device type is cnsapwin

  CALL FUNCTION w_fmodule

    EXPORTING

      control_parameters = w_cparam

      output_options = w_outoptions

    IMPORTING

      job_output_info = t_otf_from_fm

    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.

  ENDIF.

  t_otf[] = t_otf_from_fm-otfdata[].

* Function Module CONVERT_OTF is used to convert the OTF format to PDF

  CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

      format = 'PDF'

      max_linewidth = 132

    IMPORTING

      bin_filesize = w_bin_filesize

    TABLES

      otf = t_otf

      lines = t_pdf_tab

    EXCEPTIONS

      err_max_linewidth = 1

      err_format = 2

      err_conv_not_possible = 3

      err_bad_otf = 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.

  ENDIF.

* Use the FM GUI_DOWNLOAD to download the generated PDF file onto the

* presentation server

  CONCATENATE 'C:\SAP\' pv_filename INTO w_full_path.

**************  end tiancz 20140724  ***************************

  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

      bin_filesize = w_bin_filesize

      filename     = w_full_path

      filetype     = 'BIN'

    TABLES

      data_tab     = t_pdf_tab

  .

  IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ENDIF.

ENDFORM.                    " PRINT_PDF_IT

0 Kudos

when using preview, is it correct displayed or not?

also you can preview the form. then input 'PDF!' in the command field where input the TCODE place.

check the Characters are correct or messy code.

0 Kudos

l am sorry, maybe i donot exactly understand what you say

there are three self-designed function key , one for print,one for download pdf, and one for auto-email

when i click the 'print' to preview the printing file, also messy code, just the same as pdf file.

美女我看你像是中国人吧,我这英语实在是太菜了,让你看笑话了。

这个ALV报表工具栏上加了三个功能,一个打印,一个下载pdf文件到本机,一个以附件的形式发送pdf文件,在这三个功能里,打印预览,下载PDF,附件PDF,中文都是乱码