cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with conversion of smartform into PDF

Former Member
0 Kudos

Hi experts

I am going to convert my smartfrom into PDF..But i am getting blank PDF with out data...

Can anybody plz check my code..

FORM GET_GC .

GV_INVNO = SO_INVNO-LOW.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZQMIN_GC_SF'

IMPORTING

FM_NAME = GS_FMNAME.

CALL FUNCTION GS_FMNAME

EXPORTING

CONTROL_PARAMETERS = ls_control_param

GV_INVNO = GV_INVNO.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

text_question = 'Do You Want to Create the PDF'

IMPORTING

answer = lv_ucomm.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • Check for PDF Conversion

IF lv_ucomm EQ '1'.

ls_control_param-getotf = 'X'.

CALL FUNCTION GS_FMNAME

EXPORTING

ARCHIVE_INDEX = toa_dara

ARCHIVE_PARAMETERS = arc_params

CONTROL_PARAMETERS = ls_control_param

GV_INVNO = GV_INVNO.

endif.

lt_otf = lt_job_output_info-otfdata.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = 0

text = 'Generating the PDF file'.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = lv_bin_filesize

TABLES

otf = lt_otf

lines = lt_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

  • endif.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = '*.pdf'

  • mask = ',Text files (.txt),.txt.'

mode = 'O'

title = 'Down load file'

IMPORTING

filename = lv_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

lv_full_path = lv_file .

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = lv_bin_filesize

filename = lv_full_path

filetype = 'BIN'

confirm_overwrite = 'X'

TABLES

data_tab = lt_pdf_tab

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " GET_GC

THanks and regrads,

Veena

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Answered