Properties | SourceCde
Title | SoftCopy - pack |
Original language | DE | Englisch
Created | 03.01.2013 |  | CREYTZ |
Last changed by | 23.02.2021 |  | CREYTZ |
Status | Active |
Attributes
Type | INCLUDE program |
Status | Customer production program |
Application |  |
Authorization Group |  |
Package | ZSOFTCOPY | SoftCopy
| Editor lock
txt
    1
    *&---------------------------------------------------------------------*
    2
    *&  Include           ZSOFTCOPY_PACK                                   *
    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
    * pack
    31
    *-----------------------------------------------------------------------
    32
    FORM pack.
    33
    *DEVCLASS
    34
      PERFORM pack_r3tr_devc.
    35
    36
    ENDFORM.                    "pack
    37
    38
    39
    *-----------------------------------------------------------------------
    40
    * pack_r3tr_devc                                Devclass
    41
    *-----------------------------------------------------------------------
    42
    FORM pack_r3tr_devc.
    43
    44
      DATA:
    45
      lo_package TYPE REF TO if_package,
    46
      l_as4text TYPE as4text,
    47
      ls_attributes TYPE st_attributes,
    48
      ls_ti TYPE st_textinput,
    49
      lt_package_properties TYPE it_textinput,
    50
      lt_transport_attributes TYPE it_textinput,
    51
      l_intf_system TYPE srcsystem,
    52
      l_pack_system TYPE srcsystem,
    53
      lt_ref_interface TYPE tpak_package_interface_list,
    54
      ls_ref_interface TYPE tpak_package_interface_ref,
    55
      lt_interface TYPE it_pack_intf,
    56
      ls_interface TYPE st_pack_intf,
    57
      lt_ref_perm TYPE tpak_permission_to_use_list,
    58
      ls_ref_perm TYPE tpak_permission_to_use_ref_typ,
    59
      lt_perm TYPE it_pack_perm,
    60
      ls_perm TYPE st_pack_perm,
    61
      lt_ref_sub TYPE scompaklis,
    62
      ls_ref_sub TYPE REF TO if_package,
    63
      lt_sub TYPE it_pack_sub,
    64
      ls_sub TYPE st_pack_sub,
    65
      lt_tabstrip TYPE it_tabstrip,
    66
      lt_html TYPE it_string.
    67
    68
      FIELD-SYMBOLS:
    69
      <ls_tabstrip> TYPE st_tabstrip,
    70
      <l_srv_check> TYPE ANY,
    71
      <l_cli_check> TYPE ANY,
    72
      <l_deleted_in_memory> TYPE ANY.
    73
    74
      CALL METHOD cl_package_factory=>load_package
    75
        EXPORTING
    76
          i_package_name = gs_tdevc-devclass
    77
        IMPORTING
    78
          e_package      = lo_package.
    79
    80
    *general attributes
    81
      PERFORM get_devclass
    82
        USING
    83
          gs_tdevc-devclass
    84
        CHANGING
    85
          l_as4text.
    86
      ls_attributes-descript = l_as4text.
    87
      ls_attributes-person_responsible = gs_tdevc-as4user.
    88
      PERFORM get_user
    89
        USING
    90
          gs_tdevc-as4user
    91
        CHANGING
    92
          ls_attributes-person_responsible_text.
    93
      ls_attributes-author = gs_tdevc-created_by.
    94
      PERFORM get_user
    95
        USING
    96
          gs_tdevc-created_by
    97
        CHANGING
    98
          ls_attributes-author_text.
    99
      PERFORM get_date
    100
        USING
    101
          gs_tdevc-created_on
    102
        CHANGING
    103
          ls_attributes-date_created.
    104
      ls_attributes-bname = gs_tdevc-changed_by.
    105
      PERFORM get_user
    106
        USING
    107
          gs_tdevc-changed_by
    108
        CHANGING
    109
          ls_attributes-name_text.
    110
      PERFORM get_date
    111
        USING
    112
          gs_tdevc-changed_on
    113
        CHANGING
    114
          ls_attributes-date_last_changed.
    115
      ls_attributes-application_component = gs_tdevc-component.
    116
    *package properties
    117
      CLEAR ls_ti.
    118
      ls_ti-name = txt_main_package.
    119
      ls_ti-flag = abap_true.
    120
      IF gs_tdevc-mainpack = 'X'.
    121
        ls_ti-value = abap_true.
    122
      ENDIF.
    123
      APPEND ls_ti TO lt_package_properties.
    124
      CLEAR ls_ti.
    125
      ls_ti-name = txt_surrounding_package.
    126
      ls_ti-input = abap_true.
    127
      ls_ti-value = gs_tdevc-parentcl.
    128
      APPEND ls_ti TO lt_package_properties.
    129
      ls_ti-name = txt_allowed_object_types.
    130
      ls_ti-input = abap_true.
    131
      PERFORM get_dom_value_text
    132
        USING
    133
          'PACKTYPE'
    134
          gs_tdevc-packtype
    135
        CHANGING
    136
          ls_ti-value.
    137
      APPEND ls_ti TO lt_package_properties.
    138
      CLEAR ls_ti.
    139
      ls_ti-name = txt_package_not_extendable.
    140
      ls_ti-flag = abap_true.
    141
      ls_ti-value = gs_tdevc-restricted.
    142
      APPEND ls_ti TO lt_package_properties.
    143
      ASSIGN COMPONENT 'SRV_CHECK' OF STRUCTURE gs_tdevc TO <l_srv_check>.
    144
      IF <l_srv_check> IS ASSIGNED.
    145
        CLEAR ls_ti.
    146
        ls_ti-name = txt_package_check_as_server.
    147
        ls_ti-flag = abap_true.
    148
        ls_ti-value = <l_srv_check>.
    149
        APPEND ls_ti TO lt_package_properties.
    150
        UNASSIGN <l_srv_check>.
    151
      ENDIF.
    152
      ASSIGN COMPONENT 'CLI_CHECK' OF STRUCTURE gs_tdevc TO <l_cli_check>.
    153
      IF <l_cli_check> IS ASSIGNED.
    154
        CLEAR ls_ti.
    155
        ls_ti-name = txt_package_check_as_client.
    156
        ls_ti-flag = abap_true.
    157
        ls_ti-value = <l_cli_check>.
    158
        APPEND ls_ti TO lt_package_properties.
    159
        UNASSIGN <l_cli_check>.
    160
      ENDIF.
    161
    162
    *transport attributes
    163
      CLEAR ls_ti.
    164
      ls_ti-name = txt_transport_layer.
    165
      ls_ti-input = abap_true.
    166
      ls_ti-value = gs_tdevc-pdevclass.
    167
      APPEND ls_ti TO lt_transport_attributes.
    168
      CLEAR ls_ti.
    169
      ls_ti-name = txt_software_component.
    170
      ls_ti-input = abap_true.
    171
      ls_ti-value_double_length = abap_true.
    172
      ls_ti-value = gs_tdevc-dlvunit.
    173
      APPEND ls_ti TO lt_transport_attributes.
    174
      CLEAR ls_ti.
    175
      ls_ti-name = txt_changes_are_recorded.
    176
      ls_ti-flag = abap_true.
    177
      ls_ti-value = gs_tdevc-korrflag.
    178
      APPEND ls_ti TO lt_transport_attributes.
    179
    180
    *package interfaces
    181
      CALL METHOD lo_package->get_origin_system
    182
        IMPORTING
    183
          e_origin_system = l_pack_system
    184
        EXCEPTIONS
    185
          OTHERS          = 1.
    186
    187
      CALL METHOD lo_package->get_interfaces
    188
        IMPORTING
    189
          e_package_interfaces = lt_ref_interface
    190
        EXCEPTIONS
    191
          OTHERS               = 1.
    192
      LOOP AT lt_ref_interface INTO ls_ref_interface.
    193
        UNASSIGN <l_deleted_in_memory>.
    194
        ASSIGN COMPONENT 'DELETED_IN_MEMORY' OF STRUCTURE
    195
          ls_ref_interface TO <l_deleted_in_memory>.
    196
        IF <l_deleted_in_memory> IS ASSIGNED
    197
        AND <l_deleted_in_memory> = abap_true.
    198
          CONTINUE.
    199
        ENDIF.
    200
        CLEAR ls_interface.
    201
        ls_interface-intf_name = ls_ref_interface->interface_name.
    202
        ls_interface-descript = ls_ref_interface->short_text.
    203
    204
        CALL METHOD ls_ref_interface->get_origin_system
    205
          IMPORTING
    206
            e_origin_system = l_intf_system
    207
          EXCEPTIONS
    208
            OTHERS          = 1.
    209
        IF l_pack_system <> l_intf_system.
    210
          ls_interface-forsys = txt_foreign_source_system.
    211
        ENDIF.
    212
        APPEND ls_interface TO lt_interface.
    213
      ENDLOOP.
    214
    215
    *use access
    216
      CALL METHOD lo_package->get_permissions_to_use
    217
        IMPORTING
    218
          e_permissions = lt_ref_perm
    219
        EXCEPTIONS
    220
          OTHERS        = 1.
    221
      LOOP AT lt_ref_perm INTO ls_ref_perm.
    222
        UNASSIGN <l_deleted_in_memory>.
    223
        ASSIGN COMPONENT 'DELETED_IN_MEMORY' OF STRUCTURE ls_ref_perm
    224
          TO <l_deleted_in_memory>.
    225
        IF <l_deleted_in_memory> IS ASSIGNED
    226
        AND <l_deleted_in_memory> = abap_true.
    227
          CONTINUE.
    228
        ENDIF.
    229
        CLEAR ls_perm.
    230
        ls_perm-pack_name = ls_ref_perm->publisher_package_name.
    231
        ls_perm-intf_name = ls_ref_perm->package_interface_name.
    232
        PERFORM get_dom_value_text
    233
          USING
    234
            'ERRSEVRTY'
    235
            ls_ref_perm->error_severity
    236
          CHANGING
    237
            ls_perm-err_sever.
    238
        APPEND ls_perm TO lt_perm.
    239
      ENDLOOP.
    240
    241
    *packages included
    242
      CALL METHOD lo_package->get_sub_packages
    243
        IMPORTING
    244
          e_sub_packages = lt_ref_sub
    245
        EXCEPTIONS
    246
          OTHERS         = 1.
    247
      LOOP AT lt_ref_sub INTO ls_ref_sub.
    248
        UNASSIGN <l_deleted_in_memory>.
    249
        ASSIGN COMPONENT 'DELETED_IN_MEMORY' OF STRUCTURE ls_ref_sub
    250
          TO <l_deleted_in_memory>.
    251
        IF <l_deleted_in_memory> IS ASSIGNED
    252
        AND <l_deleted_in_memory> = abap_true.
    253
          CONTINUE.
    254
        ENDIF.
    255
        CLEAR ls_sub.
    256
        ls_sub-devclass = ls_ref_sub->package_name.
    257
        ls_sub-ctext = ls_ref_sub->short_text.
    258
        APPEND ls_sub TO lt_sub.
    259
      ENDLOOP.
    260
    261
    *tabstrip
    262
      PERFORM get_tabstrip
    263
        USING 'PACK_DEVC' space
    264
        CHANGING lt_tabstrip.
    265
      LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    266
        <ls_tabstrip>-empty = abap_false.
    267
        CASE <ls_tabstrip>-id.
    268
          WHEN 'INTERFACE'.
    269
            IF lt_interface IS INITIAL.
    270
              <ls_tabstrip>-empty = abap_true.
    271
            ENDIF.
    272
          WHEN 'PERM'.
    273
            IF lt_perm IS INITIAL.
    274
              <ls_tabstrip>-empty = abap_true.
    275
            ENDIF.
    276
          WHEN 'SUB'.
    277
            IF lt_sub IS INITIAL.
    278
              <ls_tabstrip>-empty = abap_true.
    279
            ENDIF.
    280
        ENDCASE.
    281
      ENDLOOP.
    282
    283
    **HTML
    284
      PERFORM html_main_header
    285
        USING
    286
          tpt_pack_devc
    287
          txt_package
    288
          gs_tdevc-devclass
    289
          txt_saved
    290
          space
    291
          space
    292
          space  " 'makeDivSize(''SOURCECODE'');'
    293
          lt_tabstrip
    294
          gt_link
    295
        CHANGING
    296
          lt_html.
    297
    298
    * attributes
    299
      PERFORM html_add_attributes_4
    300
        USING
    301
          ls_attributes
    302
          txt_package_properties
    303
          lt_package_properties
    304
          txt_transport_attributes
    305
          lt_transport_attributes
    306
          'ATTRIBUTES'
    307
          abap_true
    308
        CHANGING
    309
          lt_html.
    310
    * interface
    311
      IF NOT lt_interface IS INITIAL
    312
      OR g_empty_tab = gc_empty_tab_display.
    313
        PERFORM html_add_table
    314
          USING
    315
            'DEVC_INTF'
    316
            lt_interface
    317
            lt_interface
    318
            'INTERFACE'
    319
            abap_false
    320
          CHANGING
    321
            lt_html.
    322
      ENDIF.
    323
    * perm
    324
      IF NOT lt_perm IS INITIAL
    325
      OR g_empty_tab = gc_empty_tab_display.
    326
        PERFORM html_add_table
    327
          USING
    328
            'DEVC_PERM'
    329
            lt_perm
    330
            lt_perm
    331
            'PERM'
    332
            abap_false
    333
          CHANGING
    334
            lt_html.
    335
      ENDIF.
    336
    * sub
    337
      IF NOT lt_sub IS INITIAL
    338
      OR g_empty_tab = gc_empty_tab_display.
    339
        PERFORM html_add_table
    340
          USING
    341
            'DEVC_SUB'
    342
            lt_sub
    343
            lt_sub
    344
            'SUB'
    345
            abap_false
    346
          CHANGING
    347
            lt_html.
    348
      ENDIF.
    349
    *
    350
      PERFORM html_main_footer
    351
        USING
    352
          lt_html.
    353
    354
      PERFORM download
    355
        USING
    356
          lt_html
    357
          'R3TR'
    358
          'DEVC'
    359
          gs_tdevc-devclass
    360
          gc_extension_htm
    361
          abap_false.
    362
    363
    ENDFORM.                                                    "r3tr_devc