Skip to Content
avatar image
Former Member

Unable to Convert the Script into PDF

Hi Friends,

While i am converting the Script into PDF, after entering LP01 in the Printer it is giving a pop up widow with the information " OTF end Command // missing in OTF data.

when i hit enter its going into Dump by giving a short text " Exception Condition "ERP_CONV_NOT_POSSIBLE" raised.

Plz can any one explain me to over come this Dump.

Thanks & Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2009 at 07:06 AM

    Hi Farook,

    Check the parameters are passed to the function module CONVERT_OTF in the driver program.

    Refer this...

    [Sapscript to PDF|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556]

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2009 at 06:58 AM

    Hi,

    Could you paste that part of the code (converting OTF to PDF)

    Regards,

    Pavan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      A part of Code i am placing here.Plz suggest me.

      REPORT zcheque_print.

      DATA: struct TYPE ITCPO.

      DATA: PDFTAB TYPE TABLE OF TLINE WITH HEADER LINE,

      DATAB TYPE TABLE OF ITCOO WITH HEADER LINE.

      DATA: BINFILESIZE TYPE I,

      FILE_NAME TYPE STRING,

      FILE_PATH TYPE STRING,

      FULL_PATH TYPE STRING.

      To specify Printer name

      struct-tddest = 'SAP-HSR'.

      To specify no Print Preview

      struct-tdnoprev = 'X'.

      To access the SAP Script output in OTF format

      struct-tdgetotf = 'X'.

      START-OF-SELECTION.

      PERFORM f_header.

      PERFORM open_form.

      • perform start_form using 'Z_SCRIPTS'.

      PERFORM main_window.

      • perform end_form.

      • perform start_form using 'Z_SCRI_LAND'.

      • perform landscape_format.

      • perform end_form.

      PERFORM close_form.

      **************************CONVERTING OTF DATA TO PDF DATA***************************

      CALL FUNCTION 'CONVERT_OTF'

      EXPORTING

      format = 'PDF'

      • MAX_LINEWIDTH = 132

      • ARCHIVE_INDEX = ' '

      • COPYNUMBER = 0

      • ASCII_BIDI_VIS2LOG = ' '

      • PDF_DELETE_OTFTAB = ' '

      IMPORTING

      bin_filesize = binfilesize

      • BIN_FILE =

      TABLES

      otf = it_item[]

      lines = pdftab[]

      • 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.

      ****************TAKING THE DOWNLOAD FILE PATH AS USER INPUT************************

      CALL METHOD cl_gui_frontend_services=>file_save_dialog

      • EXPORTING

      • WINDOW_TITLE =

      • DEFAULT_EXTENSION =

      • DEFAULT_FILE_NAME =

      • FILE_FILTER =

      • INITIAL_DIRECTORY =

      • WITH_ENCODING =

      • PROMPT_ON_OVERWRITE = 'X'

      CHANGING

      filename = file_name

      path = file_path

      fullpath = full_path

      • USER_ACTION =

      • FILE_ENCODING =

      • EXCEPTIONS

      • CNTL_ERROR = 1

      • ERROR_NO_GUI = 2

      • NOT_SUPPORTED_BY_GUI = 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.

      ***************************DOWNLOADING THE PDF DATA*********************************

      CALL FUNCTION 'GUI_DOWNLOAD'

      EXPORTING

      bin_filesize = binfilesize

      filename = 'D:\cheque-print.pdf'

      filetype = 'BIN'

      • APPEND = ' '

      • WRITE_FIELD_SEPARATOR = ' '

      • HEADER = '00'

      • TRUNC_TRAILING_BLANKS = ' '

      • WRITE_LF = 'X'

      • COL_SELECT = ' '

      • COL_SELECT_MASK = ' '

      • DAT_MODE = ' '

      • CONFIRM_OVERWRITE = ' '

      • NO_AUTH_CHECK = ' '

      • CODEPAGE = ' '

      • IGNORE_CERR = ABAP_TRUE

      • REPLACEMENT = '#'

      • WRITE_BOM = ' '

      • TRUNC_TRAILING_BLANKS_EOL = 'X'

      • WK1_N_FORMAT = ' '

      • WK1_N_SIZE = ' '

      • WK1_T_FORMAT = ' '

      • WK1_T_SIZE = ' '

      • IMPORTING

      • FILELENGTH =

      TABLES

      data_tab = pdftab[]

      • FIELDNAMES =

      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 <> 0.

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

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

      ENDIF.

      Thanks & Regards,

      Farook.

      Edited by: farook shaik on Apr 13, 2009 10:23 AM