Skip to Content
0
Former Member
Nov 16, 2006 at 12:58 PM

smartform and acrobat output

17 Views

Hi ,

I am facing problem whenever iam trying to execute : the report using fn module obtained from the smartform .I have to convert the output of smartform to acrobat.

But there are errors here .

I have done the coding this way but iam not able to get the data into : ws_opinfo for JOB_OUTPUT_INFO PARAMETER

and also facing the error with fn mod 'CONVERT_OTF_2_PDF' in the tables parameter OTF :

This is my code :

if not i_output[] is initial.

If smart = 'X' .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZHR_INCOMETAX'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = formname

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

data : ws_ctrlpara type SSFCTRLOP ,

ws_opoption type SSFCOMPOP ,

  • ws_opinfo type SSFCRESCL occurs 0 with header line .

ws_opinfo TYPE SSFCRESCL OCCURS 0 WITH HEADER LINE

  • ws_opoption = 'MAIL' .

ws_ctrlpara-langu = sy-langu.

ws_ctrlpara-no_dialog = 'X'.

ws_ctrlpara-getotf = 'X'.

CALL FUNCTION formname

EXPORTING

CONTROL_PARAMETERS = ws_ctrlpara

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS = ws_opoption

USER_SETTINGS = 'X'

IMPORTING

JOB_OUTPUT_INFO = ws_opinfo

TABLES

i_output = i_output

i_output_all = i_output_all

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

data : WI_MTAB_PDF LIKE tline OCCURS 0 WITH HEADER LINE ,

wl_filesize type XSTRING ,

LT_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE .

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

USE_OTF_MC_CMD = 'X'

IMPORTING

BIN_FILESIZE = wl_filesize

TABLES

otf = ws_opinfo

  • doctab_archive = wi_docs

lines = WI_MTAB_PDF

  • EXCEPTIONS

  • ERR_CONV_NOT_POSSIBLE = 1

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

*

*

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = wl_filesize

filename = 'D:\Documents and Settings\sju\Desktop\mnr.pdf'

FILETYPE = 'PDF'

  • IMPORTING

  • FILELENGTH =

tables

data_tab = WI_MTAB_PDF[]

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

Regards

Santosh!!!