2010年8月6日

Smartform下載PDF

DATA: I_OTF LIKE ITCOO OCCURS 100 WITH HEADER LINE,
I_PDF
LIKE TLINE OCCURS 100 WITH HEADER LINE.

DATA: OP_OPTION TYPE SSFCTRLOP,
JOB_OUTPUT
TYPE SSFCRESCL,
BIN_FILESIZE
TYPE I.

OP_OPTION-GETOTF = 'X'.
OP_OPTION-PREVIEW =
'X'.
OP_OPTION-NO_DIALOG =
'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
......

CALL FUNCTION GV_FUNC_MOD_NAME
EXPORTING
CONTROL_PARAMETERS = OP_OPTION
......
IMPORTING
JOB_OUTPUT_INFO = JOB_OUTPUT
TABLES
......

CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = BIN_FILESIZE
TABLES
OTF = JOB_OUTPUT-OTFDATA
LINES = I_PDF
EXCEPTIONS
ERR_MAX_LINEWIDTH =
1
ERR_FORMAT =
2
ERR_CONV_NOT_POSSIBLE =
3
ERR_BAD_OTF =
4
OTHERS = 5.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
FILENAME = LV_FILE
FILETYPE =
'BIN'
TABLES
DATA_TAB = I_PDF.

沒有留言:

張貼留言