REPORT zsrt_config_support_new.
""global type for report
TYPES: BEGIN OF typ_final,
host TYPE sy-SYSID,
name TYPE c LENGTH 32,
description TYPE c LENGTH 120,
dt_object TYPE c LENGTH 30,
wsdl_url TYPE string,
endpoint TYPE string,
END OF typ_final.
DATA :
gt_final TYPE STANDARD TABLE OF typ_final,
gwa_final TYPE typ_final,
popup_answer TYPE char1.
* global attributes
INCLUDE srt_config_support_glob.
* definition - classes for ui (abstract classes, main class)
INCLUDE SRT_CONFIG_SUPPORT_LCL_DEF.
* definition - sub classes for ui
INCLUDE srt_config_support_lcl_def_sub.
* implementation - classes for ui (abstract classes, main class)
**INCLUDE SRT_CONFIG_SUPPORT_LCL_IMPL.
INCLUDE zsrt_config_support_lcl_impl.
* implementation - sub classes for ui
INCLUDE srt_config_support_lcl_imp_sub.
* start building ui
INCLUDE srt_config_support_pbo.
* eventing
INCLUDE SRT_CONFIG_SUPPORT_PAI.
* start gui
START-OF-SELECTION.
CALL SCREEN 100.
METHOD on_node_double_click.
DATA : lr_data_out TYPE REF TO lcl_control_filter_tree=>gtp_s_data_out,
lt_string TYPE STANDARD TABLE OF string,
lwa_string TYPE string.
PERFORM open_popup_for_sel USING
'Save all config/Display node'
'Do you want to save all data or display single entry?'.
IF popup_answer = '1'.
CLEAR :
gwa_final,
gt_final.
gwa_final-host = 'SID'.
gwa_final-name = 'Name'.
gwa_final-description = 'Description'.
gwa_final-dt_object = 'Tech Object'.
gwa_final-wsdl_url = 'WSDL URL'.
gwa_final-endpoint = 'End point'.
APPEND gwa_final TO gt_final.
LOOP AT gt_outtab REFERENCE INTO lr_data_out.
lr_data_out->o_detail = lcl_control_data_detail=>get_instance(
"io_filter_tree = me
ir_data_out = lr_data_out ).
CALL METHOD prepare_detail_screen_show( lr_data_out->o_detail ).
CALL METHOD lr_data_out->o_detail->display( ).
MOVE-CORRESPONDING: lr_data_out->* TO gwa_final.
gwa_final-host = sy-sysid.
IF gwa_final-wsdl_url IS NOT INITIAL.
if gwa_final-endpoint IS NOT INITIAL.
SPLIT gwa_final-wsdl_url AT '/sap/bc/srt/wsdl' INTO TABLE lt_string.
IF sy-subrc = 0.
READ TABLE lt_string INTO lwa_string INDEX 1.
CONCATENATE lwa_string gwa_final-endpoint INTO gwa_final-endpoint.
ENDIF.
ENDIF.
ENDIF.
APPEND gwa_final TO gt_final.
ENDLOOP.
IF gt_final IS NOT INITIAL. "///load alv
PERFORM load_alv_report.
ENDIF.
ELSE.
READ TABLE gt_outtab REFERENCE INTO lr_data_out WITH KEY node_key = node_key.
* WITH TABLE KEY sortkey_node_key
* COMPONENTS node_key = node_key.
CHECK lr_data_out->if_click_not_allowed NE abap_true.
**********************************************************************
* get details, if not bound
**********************************************************************
IF lr_data_out->o_detail IS NOT BOUND.
lr_data_out->o_detail = lcl_control_data_detail=>get_instance(
"io_filter_tree = me
ir_data_out = lr_data_out ).
ENDIF.
IF go_detail_on_screen NE lr_data_out->o_detail.
CALL METHOD prepare_detail_screen_show( lr_data_out->o_detail ).
CALL METHOD lr_data_out->o_detail->display( ).
go_detail_on_screen = lr_data_out->o_detail.
ELSEIF go_detail_on_screen->lif_control_display~gf_is_on_display EQ abap_false.
CALL METHOD prepare_detail_screen_show( go_detail_on_screen ).
ENDIF.
ENDIF.
ENDMETHOD. "on_node_double_click
FORM open_popup_for_sel USING
msg1 TYPE string
msg2 TYPE string.
"Call FM to Open Popup
CLEAR popup_answer.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = msg1
text_question = msg2
text_button_1 = 'Save file'
text_button_2 = 'Single node'
default_button = '1'
display_cancel_button = ''
start_column = 15
start_row = 10
iv_quickinfo_button_1 = 'Download all'
iv_quickinfo_button_2 = 'Display single node'
IMPORTING
answer = popup_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 DISPLAY LIKE 'E'.
ENDIF.
ENDFORM.
FORM load_alv_report .
DATA:
lv_file TYPE fpfile,
lv_filename TYPE string.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title = 'Local Directory for saving file'
CHANGING
selected_folder = lv_file
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
DISPLAY LIKE 'E'.
LEAVE TO TRANSACTION sy-tcode.
ENDIF.
CHECK lv_file IS NOT INITIAL.
CONCATENATE 'WSDL LIST_' sy-datum sy-uzeit '.xls' INTO lv_filename.
CONCATENATE lv_file lv_filename INTO lv_filename SEPARATED BY '\'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_filename
write_field_separator = 'X'
TABLES
data_tab = gt_final
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
LEAVE TO TRANSACTION 'SESSION_MANAGER'.
ENDFORM. " LOAD_ALV_REPORT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |