2008 May 15 4:38 AM
Hi,
I am working on smartform.My requirement is whenevr im executing the form at the same that form has to be downloaded & also i have to see the print preview . Its downloading but only 0 bytes is transfered. why is it so?
please help me.
Hi,
I am working on smartform.My requirement is whenevr im executing the form at the same that form has to be downloaded & also i have to see the print preview . Its downloading but only 0 bytes is transfered. why is it so?
please help me.
2008 May 15 4:50 AM
Hi,
In the print program's smartforms function module call, you need to tell the function module to get OTF data. Use function module CONVERT_OTF_2_PDF to convert OTF to PDF and download in BIN format.
Cheers.
..Reward if useful.
2008 May 15 4:52 AM
hi,
do u have program with u. Same program only i have used. but its not working.
2008 May 15 4:57 AM
Hima,
to get the print preview
DATA device TYPE ssfctrlop.
*Logic to display print preview popup
IF NOT p_pv IS INITIAL.
device-no_dialog = ' '.
ENDIF.
CALL FUNCTION ws_form_fname
EXPORTING
control_parameters = device
IMPORTING
job_output_info = ls_output_info
TABLES
i_final_ap = i_final_ap.
Pl.s reward if useful...
2008 May 15 5:05 AM
Hi jwong,
i have used that convert_otf_2_pdf function module but its throwing one error OTF end command // missing in OTF data. What is that error. Please help me.
2008 May 15 5:11 AM
Hima,
Pls. go through the program..
this is the code i got executed for convertion to PDF.I think this help full for you.
bye.
REPORT ZMY_SF61.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: WA_CTRLOP TYPE SSFCTRLOP, "Smartform control structure
WA_OUTOPT TYPE SSFCOMPOP, "Smart Composer Options
T_OTFDATA TYPE SSFCRESCL, "Return value at end of form printing
T_PDF_TAB LIKE TLINE OCCURS 0 WITH HEADER LINE. "SAP Acripts: Text lines
DATA: T_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE, "OTF Structure
W_FILESIZE TYPE I,
W_BIN_FILESIZE TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZMY_FORM6'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_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'. "Return of OTF Table.No printing,display,or faxing
WA_CTRLOP-NO_DIALOG = 'X'. "SAP Smartform: General indicator
WA_OUTOPT-TDNOPREV = 'X'. "No print preview
CALL FUNCTION FM_NAME " '/1BCDWB/SF00000699'
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'
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 = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_BIN_FILESIZE
BIN_FILE =
TABLES
OTF = T_OTF
LINES = T_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 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_BIN_FILESIZE
CODEPAGE = ' '
FILENAME = 'D:\TEST11.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
NO_AUTHORITY = 10
OTHERS = 11
.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
WRITE:/ 'THE PDF FILE IS SUCCESSFULLY CONVERTED'.
ENDIF.
Don,'t forget to reward if useful...
2008 May 15 5:38 AM
Hi murali,
I have tried that program but it is saving in desktop. But i am not able to open the PDF file.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |