*&---------------------------------------------------------------------*
*&  Include           ZSOFTCOPY__TRY_UNKNOWN                           *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*& This file is part of ZSOFTCOPY.                                     *
*&                                                                     *
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
*& it under the terms of the GNU General Public License as published   *
*& by the Free Software Foundation, either version 3 of the License,   *
*& or any later version.                                               *
*&                                                                     *
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
*& GNU General Public License for more details.                        *
*&                                                                     *
*& You should have received a copy of the GNU General Public License   *
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
*&                                                                     *
*&---------------------------------------------------------------------*


*-----------------------------------------------------------------------
* try_create_src_no_includes
*-----------------------------------------------------------------------
FORM try_create_src_no_includes
  USING
    it_src TYPE it_string
    value(i_src_name)
    value(i_progname)
  CHANGING
    ct_src_no_includes TYPE it_string.

  DATA:
  lt_abap TYPE abapsource OCCURS 0,
  lt_abap_no_includes TYPE abapsource OCCURS 0,
  ls_abap LIKE LINE OF lt_abap,
  ls_src TYPE string.

  REFRESH ct_src_no_includes.

  LOOP AT it_src INTO ls_src.
    ls_abap-line = ls_src.
    APPEND ls_abap TO lt_abap.
  ENDLOOP.

  CALL FUNCTION 'CREATE_SOURCE_WITHOUT_INCLUDES'
    EXPORTING
      source_i         = lt_abap
      source_name      = i_src_name
      global_check     = abap_true
      global_program   = i_progname
      replacing_source = space
    IMPORTING
      source_o         = lt_abap_no_includes
    EXCEPTIONS
      OTHERS           = 1.

  LOOP AT lt_abap_no_includes INTO ls_abap.
    ls_src = ls_abap-line.
    APPEND ls_src TO ct_src_no_includes.
  ENDLOOP.
ENDFORM.                    "try_create_src_no_includes


*-----------------------------------------------------------------------
* try_read_report
*-----------------------------------------------------------------------
FORM try_read_report
  USING
    value(i_progname)
  CHANGING
    ct_src TYPE it_string.

  TYPES:
  t_abap(72) TYPE c.

  DATA:
  lt_abap TYPE STANDARD TABLE OF t_abap WITH HEADER LINE,
  ls_abap TYPE t_abap,
  ls_src TYPE string.

  REFRESH ct_src.

  READ REPORT i_progname INTO lt_abap STATE 'A'.
  LOOP AT lt_abap INTO ls_abap.
    ls_src = ls_abap.
    APPEND ls_src TO ct_src.
  ENDLOOP.
ENDFORM.                    "try_read_report
