Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZSOFTCOPY_ADD                                    *
3
*&                                                                     *
4
*&---------------------------------------------------------------------*
5
*&                                                                     *
6
*& This file is part of ZSOFTCOPY.                                     *
7
*&                                                                     *
8
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
9
*& it under the terms of the GNU General Public License as published   *
10
*& by the Free Software Foundation, either version 3 of the License,   *
11
*& or any later version.                                               *
12
*&                                                                     *
13
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
14
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16
*& GNU General Public License for more details.                        *
17
*&                                                                     *
18
*& You should have received a copy of the GNU General Public License   *
19
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
20
*&                                                                     *
21
*&---------------------------------------------------------------------*
22
*&                                                                     *
23
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
24
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
25
*&                                                                     *
26
*&---------------------------------------------------------------------*
27
 
28
 
29
*-----------------------------------------------------------------------
30
* add_report_sourceCode
31
*-----------------------------------------------------------------------
32
FORM add_report_sourcecode
33
  USING
34
    value(i_progname)
35
    value(i_filename)
36
    value(i_extension)
37
    value(i_add_no_includes)
38
    value(is_ztadir) TYPE st_ztadir
39
    value(i_id)
40
    value(i_on) TYPE flag
41
  CHANGING
42
    ct_html TYPE it_string.
43
 
44
  DATA:
45
  lt_initial TYPE it_string,
46
  lt_src TYPE it_string,
47
  lt_src_compressed TYPE it_string,
48
  lt_src_no_includes TYPE it_string,
49
  l_lines TYPE i,
50
  l_lines_no_includes TYPE i,
51
  l_filename TYPE string,
52
  l_filename_compressed TYPE string,
53
  l_filename_no_includes TYPE string.
54
 
55
  PERFORM try_read_report
56
    USING i_progname
57
    CHANGING lt_src.
58
  IF g_add_sourcecode = abap_true.
59
    l_filename = i_filename.
60
    PERFORM download
61
      USING
62
        lt_src
63
        is_ztadir-pgmid
64
        is_ztadir-object
65
        l_filename
66
        i_extension
67
        abap_false.
68
    IF i_add_no_includes = abap_true.
69
      PERFORM try_create_src_no_includes
70
        USING
71
          lt_initial
72
          i_progname
73
          i_progname
74
        CHANGING
75
          lt_src_no_includes.
76
      DESCRIBE TABLE lt_src LINES l_lines.
77
      DESCRIBE TABLE lt_src_no_includes LINES l_lines_no_includes.
78
      IF l_lines < l_lines_no_includes.
79
        CONCATENATE l_filename '.complete'
80
            INTO l_filename_no_includes.
81
        PERFORM download
82
          USING
83
            lt_src_no_includes
84
            is_ztadir-pgmid
85
            is_ztadir-object
86
            l_filename_no_includes
87
            i_extension
88
            abap_false.
89
      ENDIF.
90
      IF gc_src_max_rows < l_lines_no_includes.
91
        CONCATENATE l_filename '.compressed'
92
            INTO l_filename_compressed.
93
        PERFORM get_src_compressed
94
          USING lt_src_no_includes abap_false
95
          CHANGING lt_src_compressed.
96
        PERFORM download
97
          USING
98
            lt_src_compressed
99
            is_ztadir-pgmid
100
            is_ztadir-object
101
            l_filename_compressed
102
            i_extension
103
            abap_false.
104
      ENDIF.
105
    ENDIF.
106
  ENDIF.
107
  PERFORM html_add_sourcecode
108
    USING
109
      lt_src
110
      l_filename
111
      l_filename_no_includes
112
      l_filename_compressed
113
      i_extension
114
      i_id
115
      i_on
116
    CHANGING
117
      ct_html.
118
ENDFORM.                    "addReportSrc