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: 

smartform and acrobat output

Former Member
0 Kudos

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!!!

1 ACCEPTED SOLUTION

messier31
Active Contributor
0 Kudos

Hi Santosh,

There is one mistake in ur code which is creating prob..

In function module CONVERT_OTF_2_PDF you have to pass OTF data table of WS_OPINFO i.e WS_OPINFO-OTFDATA.

Hence following changes..

DATA : wi_otfdata TYPE tsfotf.

<b>MOVE ws_opinfo-otfdata[] TO wi_otfdata[].</b>

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

use_otf_mc_cmd = 'X'

IMPORTING

bin_filesize = wl_filesize

TABLES

<b> otf = wi_otfdata</b>

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.

this will solve ur prob...

Enjoy SAP.

Pankaj Singh.

4 REPLIES 4

Former Member
0 Kudos

Hi

U have to transfer only the otf data:

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

USE_OTF_MC_CMD = 'X'

IMPORTING

BIN_FILESIZE = wl_filesize

TABLES

<b>*otf = ws_opinfo</b>

otf = ws_opinfo-OTFDATA[]

  • doctab_archive = wi_docs

lines = WI_MTAB_PDF

Max

0 Kudos

Hi ,

But in the Structure ITCOO there is no field with OTFDATA..

wht shld I pass..

Regards

Santosh

messier31
Active Contributor
0 Kudos

Hi Santosh,

There is one mistake in ur code which is creating prob..

In function module CONVERT_OTF_2_PDF you have to pass OTF data table of WS_OPINFO i.e WS_OPINFO-OTFDATA.

Hence following changes..

DATA : wi_otfdata TYPE tsfotf.

<b>MOVE ws_opinfo-otfdata[] TO wi_otfdata[].</b>

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

use_otf_mc_cmd = 'X'

IMPORTING

bin_filesize = wl_filesize

TABLES

<b> otf = wi_otfdata</b>

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.

this will solve ur prob...

Enjoy SAP.

Pankaj Singh.

Former Member
0 Kudos

HI

good

go through this and use accordingly.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

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

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

endif.

call function FM_NAME

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

GS_MKPF = INT_MKPF

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.

thanks

mrutyun^