Skip to Content

The extended Computer Aided Test Tool (eCATT) stores its scripts in the table ecscr_line. Here an ABAP report which downloads the whole set of all eCATT scripts of an SAP system to the frontend server. Each script is stored in a single file. Nothing exciting but sometimes quite useful.

"-Begin-----------------------------------------------------------------
REPORT Z_GET_ALL_ECATT_SCRIPTS.

  DATA:
    lt_line TYPE STANDARD TABLE OF ecscr_line,
    ls_line TYPE ecscr_line,
    ls_ec_line TYPE ecscr_line,
    lt_ec_line TYPE STANDARD TABLE OF ecscr_line-XML_LINE,
    lv_filename TYPE string
    .

  SELECT *
    FROM ecscr_line
    INTO TABLE lt_line
    ORDER BY name version xml_lnr.

  LOOP AT lt_line INTO ls_line GROUP BY ( 
    name = ls_line-name version = ls_line-version
  ).
    CLEAR lt_ec_line.
    LOOP AT GROUP ls_line INTO ls_ec_line.
      APPEND ls_ec_line-xml_line TO lt_ec_line.
    ENDLOOP.
    lv_filename = ls_line-name.
    REPLACE ALL OCCURRENCES OF '/' IN lv_filename WITH '_'.
    cl_gui_frontend_services=>gui_download(
      EXPORTING
        filename = 'C:\Dummy\eCATT\' && lv_filename && '_' && 
          ls_line-version
      CHANGING
        data_tab = lt_ec_line
      EXCEPTIONS
        others   = 1
    ).
    IF sy-subrc <> 0.

    ENDIF.
  ENDLOOP.

"-End-------------------------------------------------------------------

Enjoy it.

Cheers
Stefan

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