Skip to Content
author's profile photo Former Member
Former Member

smartforms-urgent plz

Hi,

i have one invoice smartform.so i am extracting the data from the smartform and converting the data into pdf file and we should get this as o/p return from the fm.that fm is already created by someone.so when we execute that fm and if we save that file by using gui_download,we are getting correct invoice.

the problem is when we opened that o/p table directly after executing the fm ,it is showing some different characters like chinese and japanese characters.my requiement is it should show some pdf string there in o/p table.

so what may be the reason....why it is showing that type of diff characters.hw to get the pdf string.it's urgent plz.........

regards,

rakesh....

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 04:21 AM

    and onemore thing is what is the output of the fm convert_otf.i think it is in pdf format.so it will be in english only r any diff characters will be there.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 11, 2007 at 04:29 AM

    Hi,

    Try this code.It can help you.

    DATA: form_name TYPE rs38l_fnam.

    DATA: wa_ctrlop TYPE ssfctrlop,

    wa_outopt TYPE ssfcompop.

    DATA: t_otfdata TYPE ssfcrescl,

    t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.

    DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.

    DATA: w_filesize TYPE i.

    DATA: w_bin_filesize TYPE i.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'ZSMARTFORM_SWAR'

    • VARIANT = ' '

    • DIRECT_CALL = ' '

    IMPORTING

    fm_name = form_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.

    wa_ctrlop-getotf = 'X'.

    wa_ctrlop-no_dialog = 'X'.

    wa_outopt-tdnoprev = 'X'.

    CALL FUNCTION form_name

    EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    control_parameters = wa_ctrlop

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    output_options = wa_outopt

    user_settings = 'X'

    mydate = p_date

    reason = p_rea

    IMPORTING

    • DOCUMENT_OUTPUT_INFO =

    job_output_info = t_otfdata

    • JOB_OUTPUT_OPTIONS =

    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_otfdata-otfdata[].

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    format = 'PDF'

    max_linewidth = 132

    • ARCHIVE_INDEX = ' '

    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

    OTHERS = 4

    .

    IF sy-subrc <> 0.

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

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

    ENDIF.

    CALL FUNCTION 'WS_DOWNLOAD'

    EXPORTING

    bin_filesize = w_bin_filesize

    • CODEPAGE = ' '

    filename = 'd:\test.PDF'

    filetype = 'BIN'

    • MODE = ' '

    • WK1_N_FORMAT = ' '

    • WK1_N_SIZE = ' '

    • WK1_T_FORMAT = ' '

    • WK1_T_SIZE = ' '

    • COL_SELECT = ' '

    • COL_SELECTMASK = ' '

    • NO_AUTH_CHECK = ' '

    IMPORTING

    filelength = w_filesize

    TABLES

    data_tab = t_pdf_tab

    • FIELDNAMES =

    EXCEPTIONS

    file_open_error = 1

    file_write_error = 2

    invalid_filesize = 3

    invalid_type = 4

    no_batch = 5

    unknown_error = 6

    invalid_table_width = 7

    gui_refuse_filetransfer = 8

    customer_error = 9

    OTHERS = 10

    .

    IF sy-subrc <> 0.

    MESSAGE i003(z00) WITH 'File not downloaded succesfully'.

    ELSE.

    MESSAGE i003(z00) WITH 'File Test.pdf downloaded succesfully '

    'under D drive'.

    ENDIF

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2007 at 03:35 PM

    Hi rakesh,

    was your problem regarding the junk raw data characters solved?. if yes, can you show me the solution.. Thanks

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi troy,

      it was solved.my client want that pdf file in string format.String format means when we try to open the pdf file in notepad,we will get that string.so i tried to save the data into the application server through datasets in binary mode.So that the junk data was geting converted into string format.Again i retrieved the saved data from the appln server....so like that my problem was solved....

      Regards,

      Rakesh...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.