REPORT ZSMARTFORMS_08.
DATA : GT_SFLIGHT LIKE SFLIGHT OCCURS 0 WITH HEADER LINE.
DATA : FORM_NAME TYPE RS38L_FNAM.
DATA: LT_OTFDATA TYPE SSFCRESCL,
CONTROL_PARAMETER TYPE SSFCTRLOP,
LT_PDF_TAB LIKE TLINE OCCURS 0 WITH HEADER LINE,
LT_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
W_FILESIZE TYPE I,
W_BIN_FILESIZE TYPE I.
SELECT * INTO TABLE GT_SFLIGHT
FROM SFLIGHT.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSMARTFORMS_04'
IMPORTING
FM_NAME = FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
* 7-1-2장의 표에서 OTF파라미터를 설명할 때 언급하였던 GETOTF부분이다.
CONTROL_PARAMETER-GETOTF = 'X'.
CALL FUNCTION FORM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL_PARAMETER
IMPORTING
JOB_OUTPUT_INFO = LT_OTFDATA "[= JOB_OUTPUT_INFO 데이터
TABLES
GT_SFLIGHT = GT_SFLIGHT.
LT_OTF[] = LT_OTFDATA-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = W_BIN_FILESIZE
TABLES
OTF = LT_OTF
LINES = LT_PDF_TAB
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_BIN_FILESIZE
FILENAME = 'C:ZSMARTFORMS_04.PDF'
FILETYPE = 'BIN'
TABLES
DATA_TAB = LT_PDF_TAB.