You are on page 1of 9

*&---------------------------------------------------------------------* *& Report ZPROG_7 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT

ZPROG_7.

*-- Definitions to hold user command for subscreens data: ucomm1 like sy-ucomm, ucomm2 like sy-ucomm, ucomm3 like sy-ucomm. *-- Macro to put checkbox on selection screen *-- &1 - checbox parameter name *-- &2 - text element (description) *-- &3 - default value for checkbox define make_checkbox. selection-screen begin of line. parameters: &1 as checkbox default &3. selection-screen comment 3(60) &2. selection-screen end of line. end-of-definition. *-- Macro to put radiobutton on selection screen *-- &1 - radiobutton parameter name *-- &2 - text element (description) *-- &3 - radiobutton group define make_radiobutton. selection-screen begin of line. parameters: &1 radiobutton group &3.

.&2 .Macro to put a dropdown listbox on selection screen *-. *-.text element (description) *-.parameter name *-.selection-screen comment 3(60) &2. selection-screen begin of line.like data element *-.&1 . end-of-definition. *-. selection-screen begin of block file_options with frame. parameters: &1 like &3 default &4. make_parameter p_filein fil_desc rlgrap-filename '/filename.Define subscreen for upload options selection-screen begin of screen 1100 as subscreen. selection-screen end of line.&1 . make_radiobutton rb_unix unx_desc src. *-.default value *-. selection-screen position pos_low. end-of-definition.&3 .text element (description) define make_dropdown. end-of-definition.length of listbox *-.&2 .parameter name *-. selection-screen comment 1(30) &4.default value define make_parameter.&3 .txt'. selection-screen comment 1(30) &2. selection-screen end of line.Macro to put a parameter on selection screen *-. selection-screen begin of line.&4 . selection-screen end of line. parameters: &1 as listbox visible length &2 default &3 obligatory.&4 . selection-screen position pos_low.

Define subscreen for BDC/CT Processing Options selection-screen begin of screen 1200 as subscreen. make_checkbox c_stats sta_desc 'X'. make_parameter p_filety typ_desc rlgrap-filetype 'DAT'. selection-screen begin of block bdc_options with frame. make_radiobutton rb_callt ctr_desc typ.make_radiobutton rb_local dos_desc src. make_dropdown p_uptyp(1) 30 'S' upd_desc. selection-screen end of screen 1100. make_dropdown p_mode(1) 30 'N' mod_desc. selection-screen tab (15) tabs3 user-command ucomm3 default screen 1300. *-. selection-screen begin of block output_opts with frame. selection-screen end of screen 1300. *-. make_checkbox c_detail det_desc ' '. selection-screen end of block bdc_options. *-.Define Main Selection screen that will incorporate the subscreens selection-screen begin of tabbed block tabs for 10 lines. selection-screen end of block tabs. selection-screen end of screen 1200. selection-screen end of block output_opts. selection-screen tab (30) tabs2 user-command ucomm2 default screen 1200. . make_radiobutton rb_bdc bdc_desc typ. make_checkbox c_error err_desc 'X'.Fill the dropdown list boxes before displaying them at selection-screen output.Define subscreen for Output Options selection-screen begin of screen 1300 as subscreen. selection-screen tab (15) tabs1 user-command ucomm1 default screen 1100. selection-screen end of block file_options. *-.

ctr_desc = 'Process in Call Transaction Mode'. unx_desc = 'File is on App Server (unix)'. perform fill_dropdown_list using 'P_UPTYP'. *-. fil_desc = 'Name of File'.perform fill_dropdown_list using 'P_MODE'.Setup descriptions for Selection Screen items err_desc = 'Show Errors (Call Transaction Only)'. tabs1 = 'Upload Options'. and create BDC/Call Transactions *---------------------------------------------------------------------* * FORM fill_dropdown_list * *---------------------------------------------------------------------* * Populate the dropdown list for the parameter provided * *---------------------------------------------------------------------* * --> VALUE(F_PARAMETER) * *---------------------------------------------------------------------* . perform choose_filename using p_filein changing p_filein. mod_desc = 'Transaction Processing Mode'. sta_desc = 'Show statistics on what has been processed'. dos_desc = 'File is on Presentation Server (pc)'. bdc_desc = 'Process in BDC Mode'. *-. tabs2 = 'BDC/Call Transaction Options'. tabs3 = 'Output Options'. *-.. initialization. det_desc = 'Show details on records being processed'. upd_desc = 'Update Type'. typ_desc = 'File Type'. at selection-screen on value-request for p_filein.Open input file or Read data from database tables end-of-selection. start-of-selection.Loop at data.

append value to list. append value to list. Only provied if a local file is selected * . value-text = 'Do not display any screens'. call function 'VRM_SET_VALUES' exporting id = name values = list. value-text = 'Display ALL screens'. endform. value-key = 'A'. " For parameter drop down lists *-. type-pools: vrm. value-text = 'Update in Synchronous Mode'." fill_dropdown_list *---------------------------------------------------------------------* * FORM choose_filename * *---------------------------------------------------------------------* * Select a filename. when 'P_MODE'. value-key = 'S'. value-text = 'Update in Asynchronous Mode'. list type vrm_values. append value to list. when 'P_UPTYP'. endcase.form fill_dropdown_list using value(f_parameter). name = f_parameter. append value to list. value-key = 'E'. value-key = 'A'. case f_parameter.Definitions for parameter drop down lists data: name type vrm_id. when others. value-text = 'Only display screens in error'. value-key = 'N'. value like line of list. append value to list.

. * *---------------------------------------------------------------------* * --> F_FILENAME_IN * * <-.. lc_fieldvalue like dynpread-fieldvalue.F_FILENAME_OUT * *---------------------------------------------------------------------* form choose_filename using f_filename_in changing f_filename_out. *-. " User chose a local file perform query_local_filename changing f_filename_out. if lc_fieldvalue = 'X'.Get the value of p_local perform read_value_from_screen using sy-repid sy-dynnr 'RB_LOCAL' changing lc_fieldname lc_fieldvalue. endform....* as the source of the input file. endif.. data: lc_fieldname like dynpread-fieldname.. A * * custom function or routine could be * * written to provide the same functionality * * for unix." get_filename *---------------------------------------------------------------------* * FORM READ_VALUE_FROM_SCREEN * *---------------------------------------------------------------------* * . * *---------------------------------------------------------------------* * --> F_REPID * * --> F_DYNNR * * --> VALUE(F_FIELDNAME_IN) * .

read table ltab_fields index 1. f_fieldvalue = ltab_fields-fieldvalue. data: lc_dynumb like sy-dynnr. lc_dyname = f_repid.F_FIELDNAME_OUT * * <-. append ltab_fields.Read the screen to see if the user has entered a value for WERKS ltab_fields-fieldname = f_fieldname_in. lc_dynumb = f_dynnr.Return the value from the screen if sy-subrc eq 0. data: lc_dyname like sy-repid. *-. endform. endif. *-.* <-. split ltab_fields-fieldname at '-' into lc_dummy f_fieldname_out.F_FIELDVALUE * *---------------------------------------------------------------------* form read_value_from_screen using f_repid f_dynnr value(f_fieldname_in) changing f_fieldname_out f_fieldvalue. . data: ltab_fields like dynpread occurs 0 with header line. call function 'DYNP_VALUES_READ' exporting dyname = lc_dyname dynumb = lc_dynumb tables dynpfields = ltab_fields exceptions others = 01. data: lc_dummy(1) type c.

.All Files (*. data: l_filename like rlgrap-filename.. * Build Filter l_mask = '..*. . if sy-subrc = 0. f_filename_out = l_filename. data: l_mask(80) type c. call function 'WS_FILENAME_GET' exporting def_filename = f_filename_out def_path = 'c:\' mask = l_mask * mode = O or S title = 'Choose input file' importing filename = l_filename exceptions inv_winsys = 01 no_batch = 02 selection_cancel = 03 selection_error = 04.'.*---------------------------------------------------------------------* * FORM query_filename * *---------------------------------------------------------------------* * .*..*).. * *---------------------------------------------------------------------* * --> F_FILENAME_OUT * * --> DATA * * --> : * * --> L_FILENAME * *---------------------------------------------------------------------* form query_local_filename changing f_filename_out like rlgrap-filename...

endform.endif. .