Skip to Content

We often have requirements to submit/view ABAP webservice WSDL URLs, and most of the ABAPers uses SOAMANAGER application and get WSDLs for references.

But where we have huge number of webservices and need of creating repository / submitting list for WSDLs list. The conventional approach for getting WSDLs will become tedious task.

 

I have faced the same situation and created a simple SAP report which will solve this issue with ease and way lesser time.

 

Step 1:

SAP offers report called SRT_CONFIG_SUPPORT, Extended Display of Service Configurations in Current Client

 

Step 2: 

You can search your webservice and view WSDLs one by one navigating through list, At attribute name as WSDL_URL and Endpoint string will be at Calculated Access URL:

 

Step 3:

You can use this report for viewing WSDLs but getting mass WSDLs and Endpoint URLs are not feasible with it, and enhancement to given report is not allowed by SAP.

 

Step 4:

I have created new custom report as a copy of SRT_CONFIG_SUPPORT and added functionality for downloading Excel file with all WSDLs and Endpoint URLs in one GO.

You can do the same, refer below steps.

 

Step 5:

Copy SRT_CONFIG_SUPPORT and make it ZSRT_CONFIG_SUPPORT_NEW.

!!! Do not copy all Includes as it is not needed,Only copy below include(s) and make it Z ( custom ).

Include to be copied = SRT_CONFIG_SUPPORT_LCL_IMPL

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.

 

Step 6:

Add code for downloading mass list,

Go to Include (SE38) ->ZSRT_CONFIG_SUPPORT_LCL_IMPL and change method on_node_double_click code as given below.

  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

 

Code for Perform OPEN_POPUP_FOR_SEL:

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. 

 

Code for Perform LOAD_ALV_REPORT:

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

 

Step 7:  Activate program and include, Execute F8, Search your webservice ( e.g. Z*Get* ) and double click on any node.

 

Step 8: User will get new prompt for selection as Save file OR Display single node,

Select Save File-> Choose local folder path -> Save.

 

DONE!!!!

 

Output file sample with dummy data:

*Tech Object would be Function module/Proxy/etc. from definition of webservice.

 

Cheers.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply