Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class YCLITC_PRINTED_FORM_TEMPLATE definition
- public
- create public .
- *"* public components of class YCLITC_PRINTED_FORM_TEMPLATE
- *"* do not include other source files here!!!
- public section.
- methods CONSTRUCTOR
- importing
- value(I_FILE_SOURCE) type STRING optional
- value(I_SOURCE_TYPE) type YEITC_FILE_SOURCE_TYPE default 'WWW'
- !IT_VALUES type YTTITC_PRINTED_FORM_VALUES
- !IT_FILES type YTTITC_PRINTED_FORM_FILES optional .
- methods RUN
- final
- exceptions
- FILE_NOT_FOUND
- PRINT_CANCEL .
- methods SET_USER_CLASS
- final
- importing
- !IO_USER_CLASS type ref to OBJECT .
- methods SET_PARAMETERS
- importing
- value(I_FORM_NAME) type YSITC_PRINTED_FORM_PARAMS-FORM_NAME optional
- value(I_FILE_NAME) type YSITC_PRINTED_FORM_PARAMS-FILE_NAME optional
- value(I_FILE_LOCATION) type C optional
- value(I_PRINTDIALOG) type C optional
- value(I_PROTECT) type C optional
- value(I_OPTIMIZE) type YSITC_PRINTED_FORM_PARAMS-OPTIMIZE optional
- value(I_DEBUG_MODE) type C optional
- value(I_DECIMAL_SEPARATOR) type C optional
- value(I_CLOSE_FORM) type C optional
- value(I_DELETE_FILE) type C optional
- value(I_WITHOUT_OLE) type C optional
- value(I_USE_JAR) type C optional
- value(I_USE_UNICODE) type C optional
- value(I_FORM_TYPE) type CHAR30 optional .
- methods GET_DEFAULT_PARAMETERS
- returning
- value(RS_PARAMETERS) type YSITC_PRINTED_FORM_PARAMS .
- protected section.
- *"* protected components of class YCLITC_PRINTED_FORM_TEMPLATE
- *"* do not include other source files here!!!
- types T_EXT type CHAR255 .
- types T_FILETYPE type CHAR50 .
- data G_FILE_SOURCE type STRING .
- data G_SOURCE_TYPE type YEITC_FILE_SOURCE_TYPE .
- data GO_UTILS type ref to YCLITC_UTILITIES .
- data GO_UTIL_FILES type ref to YCLITC_UTIL_FILES .
- methods READ_TEMPLATE
- importing
- !IS_PARAMETERS type YSITC_PRINTED_FORM_PARAMS
- exporting
- !ES_DATA type YSITC_PRINTED_FORM_DATA
- exceptions
- FILE_NOT_FOUND .
- private section.
- *"* private components of class YCLITC_PRINTED_FORM_TEMPLATE
- *"* do not include other source files here!!!
- data GS_PARAMETERS type YSITC_PRINTED_FORM_PARAMS .
- data GT_VALUES type YTTITC_PRINTED_FORM_VALUES .
- data GT_FILES type YTTITC_PRINTED_FORM_FILES .
- data GO_USER_CLASS type ref to OBJECT .
- ENDCLASS.
- CLASS YCLITC_PRINTED_FORM_TEMPLATE IMPLEMENTATION.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Public Method YCLITC_PRINTED_FORM_TEMPLATE->CONSTRUCTOR
- * +-------------------------------------------------------------------------------------------------+
- * | [--->] I_FILE_SOURCE TYPE STRING(optional)
- * | [--->] I_SOURCE_TYPE TYPE YEITC_FILE_SOURCE_TYPE (default ='WWW')
- * | [--->] IT_VALUES TYPE YTTITC_PRINTED_FORM_VALUES
- * | [--->] IT_FILES TYPE YTTITC_PRINTED_FORM_FILES(optional)
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method CONSTRUCTOR.
- Data:
- l_FileName type string,
- l_Name type string,
- l_Ext type string.
- * Call method SUPER->Constructor.
- Create object GO_UTILS.
- Create object go_Util_Files.
- GS_PARAMETERS = GET_DEFAULT_PARAMETERS( ).
- * GS_PARAMETERS = IS_PARAMETERS.
- G_FILE_SOURCE = I_FILE_SOURCE.
- G_SOURCE_TYPE = I_SOURCE_TYPE.
- GT_VALUES = IT_VALUES.
- GT_FILES = IT_FILES.
- If not I_FILE_SOURCE is initial.
- Call method GO_UTILS->SPLIT_FILE_AND_PATH
- EXPORTING
- I_FULL_NAME = I_FILE_SOURCE
- IMPORTING
- E_FILE_NAME = l_FileName.
- Call method GO_UTILS->SPLIT_FILE_AND_EXT
- EXPORTING
- I_FILE_NAME = l_FileName
- IMPORTING
- E_NAME = l_Name
- E_EXT = l_Ext.
- Translate l_Name to upper case.
- Call method Set_Parameters
- EXPORTING
- I_FORM_NAME = l_Name.
- EndIf.
- endmethod.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Public Method YCLITC_PRINTED_FORM_TEMPLATE->GET_DEFAULT_PARAMETERS
- * +-------------------------------------------------------------------------------------------------+
- * | [<-()] RS_PARAMETERS TYPE YSITC_PRINTED_FORM_PARAMS
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method GET_DEFAULT_PARAMETERS.
- RS_PARAMETERS-FILE_NAME = ''.
- RS_PARAMETERS-FILE_LOCATION = ''.
- RS_PARAMETERS-PRINTDIALOG = ''.
- RS_PARAMETERS-PROTECT = 'X'.
- RS_PARAMETERS-OPTIMIZE = 100.
- RS_PARAMETERS-DEBUG_MODE = ''.
- RS_PARAMETERS-DECIMAL_SEPARATOR = '.'.
- RS_PARAMETERS-CLOSE_FORM = ''.
- RS_PARAMETERS-DELETE_FILE = 'X'.
- RS_PARAMETERS-WITHOUT_OLE = ''.
- RS_PARAMETERS-USE_JAR = ''.
- RS_PARAMETERS-USE_UNICODE = ''.
- endmethod.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Protected Method YCLITC_PRINTED_FORM_TEMPLATE->READ_TEMPLATE
- * +-------------------------------------------------------------------------------------------------+
- * | [--->] IS_PARAMETERS TYPE YSITC_PRINTED_FORM_PARAMS
- * | [<---] ES_DATA TYPE YSITC_PRINTED_FORM_DATA
- * | [EXC!] FILE_NOT_FOUND
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method READ_TEMPLATE.
- Data:
- l_FileName type string,
- l_Ext type string,
- ls_FileInfo type YSITC_CATALOG_LIST.
- If not G_FILE_SOURCE is initial and
- not G_SOURCE_TYPE is initial.
- Call method go_Util_Files->File_Load
- EXPORTING
- I_FILE_NAME = G_FILE_SOURCE
- I_SOURCE_TYPE = G_SOURCE_TYPE
- IMPORTING
- E_FILE_DATA = ES_DATA-FILE_TEMPLATE
- ES_FILE_INFO = ls_FileInfo
- EXCEPTIONS
- others = 99.
- * Call method GO_UTILS->Split_File_and_Path
- * EXPORTING
- * I_FULL_NAME = G_FILE_SOURCE
- * IMPORTING
- * E_FILE_NAME = l_FileName.
- * Call method GO_UTILS->Split_File_and_Ext
- * EXPORTING
- * I_FILE_NAME = l_FileName
- * IMPORTING
- * E_EXT = l_Ext.
- * Translate l_Ext to upper case.
- l_Ext = ls_FileInfo-Extension.
- Concatenate '.' l_Ext into ES_DATA-FILE_TEMPLATE_EXT.
- EndIf.
- endmethod.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Public Method YCLITC_PRINTED_FORM_TEMPLATE->RUN
- * +-------------------------------------------------------------------------------------------------+
- * | [EXC!] FILE_NOT_FOUND
- * | [EXC!] PRINT_CANCEL
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method RUN.
- Data:
- ls_Data type YSITC_PRINTED_FORM_DATA.
- Call method READ_TEMPLATE
- EXPORTING
- IS_PARAMETERS = GS_PARAMETERS
- IMPORTING
- ES_DATA = ls_Data
- exceptions
- FILE_NOT_FOUND = 1.
- Case sy-subrc.
- when 0.
- when 1.
- Message E800(YITC_PRINTED_FORM) raising FILE_NOT_FOUND.
- when others.
- EndCase.
- Call method YCLITC_PRINTED_FORM=>MAIN
- EXPORTING
- IS_PARAMETERS = GS_PARAMETERS
- IT_FILES = GT_FILES
- IO_USER_CLASS = GO_USER_CLASS
- CHANGING
- CS_DATA = ls_Data
- CT_VALUES = GT_VALUES
- EXCEPTIONS
- PRINT_CANCEL = 1.
- Case sy-subrc.
- when 1.
- Raise PRINT_CANCEL.
- EndCase.
- endmethod.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Public Method YCLITC_PRINTED_FORM_TEMPLATE->SET_PARAMETERS
- * +-------------------------------------------------------------------------------------------------+
- * | [--->] I_FORM_NAME TYPE YSITC_PRINTED_FORM_PARAMS-FORM_NAME(optional)
- * | [--->] I_FILE_NAME TYPE YSITC_PRINTED_FORM_PARAMS-FILE_NAME(optional)
- * | [--->] I_FILE_LOCATION TYPE C(optional)
- * | [--->] I_PRINTDIALOG TYPE C(optional)
- * | [--->] I_PROTECT TYPE C(optional)
- * | [--->] I_OPTIMIZE TYPE YSITC_PRINTED_FORM_PARAMS-OPTIMIZE(optional)
- * | [--->] I_DEBUG_MODE TYPE C(optional)
- * | [--->] I_DECIMAL_SEPARATOR TYPE C(optional)
- * | [--->] I_CLOSE_FORM TYPE C(optional)
- * | [--->] I_DELETE_FILE TYPE C(optional)
- * | [--->] I_WITHOUT_OLE TYPE C(optional)
- * | [--->] I_USE_JAR TYPE C(optional)
- * | [--->] I_USE_UNICODE TYPE C(optional)
- * | [--->] I_FORM_TYPE TYPE CHAR30(optional)
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method SET_PARAMETERS.
- Data:
- ls_Parameters type YSITC_PRINTED_FORM_PARAMS.
- If i_Form_Name is supplied.
- gs_Parameters-Form_Name = i_Form_Name.
- EndIf.
- If i_File_Name is supplied.
- gs_Parameters-File_Name = i_File_Name.
- Shift gs_Parameters-File_Name left deleting leading Space.
- EndIf.
- If i_File_Location is supplied.
- gs_Parameters-File_Location = i_File_Location.
- EndIf.
- If i_PrintDialog is supplied.
- gs_Parameters-PrintDialog = i_PrintDialog.
- EndIf.
- If i_Protect is supplied.
- gs_Parameters-Protect = i_Protect.
- EndIf.
- If i_Optimize is supplied.
- gs_Parameters-Optimize = i_Optimize.
- EndIf.
- If i_Debug_Mode is supplied.
- gs_Parameters-Debug_Mode = i_Debug_Mode.
- EndIf.
- If i_Decimal_Separator is supplied.
- gs_Parameters-Decimal_Separator = i_Decimal_Separator.
- EndIf.
- If i_Close_Form is supplied.
- gs_Parameters-Close_Form = i_Close_Form.
- EndIf.
- If i_Delete_File is supplied.
- gs_Parameters-Delete_File = i_Delete_File.
- EndIf.
- If i_Without_Ole is supplied.
- gs_Parameters-Without_Ole = i_Without_Ole.
- EndIf.
- If i_Use_Jar is supplied.
- gs_Parameters-Use_Jar = i_Use_Jar.
- EndIf.
- If i_Use_Unicode is supplied.
- gs_Parameters-Use_Unicode = i_Use_Unicode.
- EndIf.
- If i_Form_Type is supplied.
- gs_Parameters-Form_Type = i_Form_Type.
- EndIf.
- endmethod.
- * <SIGNATURE>---------------------------------------------------------------------------------------+
- * | Instance Public Method YCLITC_PRINTED_FORM_TEMPLATE->SET_USER_CLASS
- * +-------------------------------------------------------------------------------------------------+
- * | [--->] IO_USER_CLASS TYPE REF TO OBJECT
- * +--------------------------------------------------------------------------------------</SIGNATURE>
- method SET_USER_CLASS.
- GO_USER_CLASS = IO_USER_CLASS.
- endmethod.
- ENDCLASS.
Add Comment
Please, Sign In to add comment