Eigenschaften | Quelltext
Titel | SoftCopy - select |
Originalsprache | DE | Deutsch
Erstellt | 04.01.2013 |  | CREYTZ |
Letzte Änderung | 01.03.2021 |  | CREYTZ |
Status | aktiv |
Attribute
Typ | Include-Programm |
Status | Produktives Kundenprogramm |
Anwendung |  |
Berechtigungsgruppe |  |
Paket | ZSOFTCOPY | SoftCopy
| Editorsperre
txt
    1
    *&---------------------------------------------------------------------*
    2
    *&  Include           ZSOFTCOPY_SELECT                                 *
    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
    * select
    31
    *-----------------------------------------------------------------------
    32
    FORM select.
    33
    34
      DATA:
    35
      lt_tadir TYPE STANDARD TABLE OF tadir.
    36
    37
      SELECT * FROM tadir INTO TABLE lt_tadir
    38
          WHERE devclass = g_pack.
    39
    40
      PERFORM select_obj TABLES lt_tadir.
    41
    42
      DESCRIBE TABLE gt_ztadir LINES g_cnt_elems.
    43
    44
    ENDFORM.                    "select
    45
    46
    47
    *-----------------------------------------------------------------------
    48
    * select_obj
    49
    *-----------------------------------------------------------------------
    50
    FORM select_obj
    51
      TABLES
    52
        tt_tadir STRUCTURE tadir.
    53
    54
      DATA:
    55
      l_where TYPE string,
    56
      ls_ztadir TYPE st_ztadir,
    57
      l_last_pgmid TYPE pgmid,
    58
      l_last_object TYPE trobjtype.
    59
    60
      FIELD-SYMBOLS:
    61
      <ls_tadir> TYPE tadir.
    62
    63
    64
      SORT tt_tadir BY pgmid object.
    65
    66
      LOOP AT tt_tadir ASSIGNING <ls_tadir>.
    67
        CLEAR ls_ztadir.
    68
        MOVE-CORRESPONDING <ls_tadir> TO ls_ztadir.
    69
    70
        CASE <ls_tadir>-pgmid.
    71
          WHEN 'R3TR'.
    72
            CASE <ls_tadir>-object.
    73
              WHEN 'CLAS'.  PERFORM select_seoclass   CHANGING ls_ztadir.
    74
              WHEN 'DOMA'.  PERFORM select_dd01       CHANGING ls_ztadir.
    75
              WHEN 'DTEL'.  PERFORM select_dd04       CHANGING ls_ztadir.
    76
              WHEN 'ENQU'.  PERFORM select_dd25       CHANGING ls_ztadir.
    77
              WHEN 'FUGR'.  PERFORM select_fdir       CHANGING ls_ztadir.
    78
              WHEN 'INTF'.  PERFORM select_seoclass   CHANGING ls_ztadir.
    79
              WHEN 'MSAG'.  PERFORM select_t100       CHANGING ls_ztadir.
    80
              WHEN 'PARA'.  PERFORM select_tpara      CHANGING ls_ztadir.
    81
              WHEN 'PROG'.  PERFORM select_trdir      CHANGING ls_ztadir.
    82
              WHEN 'SHLP'.  PERFORM select_dd30       CHANGING ls_ztadir.
    83
              WHEN 'SUSO'.  PERFORM select_tobj       CHANGING ls_ztadir.
    84
              WHEN 'TABL'.  PERFORM select_dd02       CHANGING ls_ztadir.
    85
              WHEN 'TRAN'.  PERFORM select_tstc       CHANGING ls_ztadir.
    86
              WHEN 'TTYP'.  PERFORM select_dd40       CHANGING ls_ztadir.
    87
              WHEN 'TYPE'.  PERFORM select_ddtypet    CHANGING ls_ztadir.
    88
              WHEN 'VIEW'.  PERFORM select_dd25       CHANGING ls_ztadir.
    89
              WHEN 'WAPA'.  PERFORM select_o2_appl    CHANGING ls_ztadir.
    90
              WHEN 'WTAG'.  PERFORM select_o2_taglib  CHANGING ls_ztadir.
    91
              WHEN 'XSLT'.  PERFORM select_o2_xslt    CHANGING ls_ztadir.
    92
              WHEN OTHERS.  ls_ztadir-subrc = gc_subrc_not_found.
    93
            ENDCASE.
    94
          WHEN OTHERS.
    95
            ls_ztadir-subrc = gc_subrc_not_found.
    96
        ENDCASE.
    97
    98
        IF ls_ztadir-subrc = 0.
    99
          APPEND ls_ztadir TO gt_ztadir.
    100
        ENDIF.
    101
      ENDLOOP.
    102
    103
      SORT gt_ztadir BY obj_name.
    104
    105
    ENDFORM.                    "selectObj
    106
    107
    108
    *-----------------------------------------------------------------------
    109
    * select_dd01                                    Domaenen
    110
    *-----------------------------------------------------------------------
    111
    FORM select_dd01
    112
      CHANGING
    113
        cs_ztadir TYPE st_ztadir.
    114
    115
      DATA:
    116
      l_ddtext TYPE as4text,
    117
      l_domname TYPE domname.
    118
    119
      IF g_add_elem_doma = abap_false.
    120
        cs_ztadir-subrc = gc_subrc_deselected.
    121
      ELSE.
    122
        SELECT SINGLE ddtext FROM dd01t INTO l_ddtext
    123
            WHERE domname = cs_ztadir-obj_name
    124
            AND ddlanguage = sy-langu
    125
            AND as4local = 'A'.
    126
        IF sy-subrc = 0.
    127
          cs_ztadir-descript = l_ddtext.
    128
        ELSE.
    129
          SELECT SINGLE domname FROM dd01l INTO l_domname
    130
              WHERE domname = cs_ztadir-obj_name
    131
              AND as4local = 'A'.
    132
          IF sy-subrc = 0.
    133
            cs_ztadir-obj_name = l_domname.
    134
          ELSE.
    135
            cs_ztadir-subrc = gc_subrc_not_found.
    136
          ENDIF.
    137
        ENDIF.
    138
      ENDIF.
    139
    ENDFORM.                    "select_dd01
    140
    141
    142
    *-----------------------------------------------------------------------
    143
    * select_dd02                                    SAP-Tabellen
    144
    *-----------------------------------------------------------------------
    145
    FORM select_dd02
    146
      CHANGING
    147
        cs_ztadir TYPE st_ztadir.
    148
    149
      DATA:
    150
      l_ddtext TYPE as4text,
    151
      l_tabname TYPE tabname.
    152
    153
    154
      l_tabname = cs_ztadir-obj_name.
    155
      SELECT SINGLE tabclass FROM dd02l INTO cs_ztadir-tabclass
    156
          WHERE tabname = l_tabname
    157
          AND as4local = 'A'.
    158
      IF sy-subrc = 0.
    159
        IF ( cs_ztadir-tabclass = 'INTTAB'
    160
          OR cs_ztadir-tabclass = 'VIEW'
    161
          OR cs_ztadir-tabclass = 'APPEND' )
    162
        AND g_add_elem_struc = abap_false.
    163
          cs_ztadir-subrc = gc_subrc_deselected.
    164
        ELSEIF ( cs_ztadir-tabclass = 'CLUSTER'
    165
          OR cs_ztadir-tabclass = 'POOL'
    166
          OR cs_ztadir-tabclass = 'TRANSP' )
    167
        AND g_add_elem_tabl = abap_false.
    168
          cs_ztadir-subrc = gc_subrc_deselected.
    169
        ELSE.
    170
          SELECT SINGLE ddtext FROM dd02t INTO l_ddtext
    171
              WHERE tabname = l_tabname
    172
              AND ddlanguage = sy-langu
    173
              AND as4local = 'A'.
    174
          IF sy-subrc = 0.
    175
            cs_ztadir-descript = l_ddtext.
    176
          ENDIF.
    177
        ENDIF.
    178
      ELSE.
    179
        cs_ztadir-subrc = gc_subrc_not_found.
    180
      ENDIF.
    181
    ENDFORM.                    "select_dd02
    182
    183
    184
    *-----------------------------------------------------------------------
    185
    * select_dd04                                    Datenelemente
    186
    *-----------------------------------------------------------------------
    187
    FORM select_dd04
    188
      CHANGING
    189
        cs_ztadir TYPE st_ztadir.
    190
    191
      DATA:
    192
      l_ddtext TYPE as4text,
    193
      l_rollname TYPE rollname.
    194
    195
      IF g_add_elem_dtel = abap_false.
    196
        cs_ztadir-subrc = gc_subrc_deselected.
    197
      ELSE.
    198
        l_rollname = cs_ztadir-obj_name.
    199
        SELECT SINGLE ddtext FROM dd04t INTO l_ddtext
    200
            WHERE rollname = l_rollname
    201
            AND ddlanguage = sy-langu
    202
            AND as4local = 'A'.
    203
        IF sy-subrc = 0.
    204
          cs_ztadir-descript = l_ddtext.
    205
        ELSE.
    206
          SELECT SINGLE rollname FROM dd04l INTO l_rollname
    207
              WHERE rollname = l_rollname
    208
              AND as4local = 'A'.
    209
          IF sy-subrc <> 0.
    210
            cs_ztadir-subrc = gc_subrc_not_found.
    211
          ENDIF.
    212
        ENDIF.
    213
      ENDIF.
    214
    ENDFORM.                    "select_dd04
    215
    216
    217
    *-----------------------------------------------------------------------
    218
    * links_dd25                                     Aggregat-Header
    219
    *                               (Views, Matchcode-Objekte, Sperrobjekte)
    220
    *-----------------------------------------------------------------------
    221
    FORM select_dd25
    222
      CHANGING
    223
        cs_ztadir TYPE st_ztadir.
    224
    225
      DATA:
    226
      l_ddtext TYPE ddtext,
    227
      l_viewname TYPE viewname.
    228
    229
      IF ( cs_ztadir-object = 'ENQU' AND g_add_elem_enqu = abap_false )
    230
      OR ( cs_ztadir-object = 'VIEW' AND g_add_elem_view = abap_false ).
    231
        cs_ztadir-subrc = gc_subrc_deselected.
    232
      ELSE.
    233
        l_viewname = cs_ztadir-obj_name.
    234
        SELECT SINGLE aggtype FROM dd25l INTO cs_ztadir-aggtype
    235
            WHERE viewname = l_viewname
    236
            AND as4local = 'A'.
    237
        IF sy-subrc = 0.
    238
          SELECT SINGLE ddtext FROM dd25t INTO l_ddtext
    239
              WHERE viewname = l_viewname
    240
              AND ddlanguage = sy-langu
    241
              AND as4local = 'A'.
    242
          IF sy-subrc = 0.
    243
            cs_ztadir-descript = l_ddtext.
    244
          ENDIF.
    245
        ELSE.
    246
          cs_ztadir-subrc = gc_subrc_not_found.
    247
        ENDIF.
    248
      ENDIF.
    249
    ENDFORM.                    "select_dd25
    250
    251
    252
    *-----------------------------------------------------------------------
    253
    * select_dd30                                    Suchhilfen
    254
    *-----------------------------------------------------------------------
    255
    FORM select_dd30
    256
      CHANGING
    257
        cs_ztadir TYPE st_ztadir.
    258
    259
      DATA:
    260
      l_ddtext TYPE ddtext,
    261
      l_shlpname TYPE shlpname.
    262
    263
      IF g_add_elem_shlp = abap_false.
    264
        cs_ztadir-subrc = gc_subrc_deselected.
    265
      ELSE.
    266
        l_shlpname = cs_ztadir-obj_name.
    267
        SELECT SINGLE ddtext FROM dd30t INTO l_ddtext
    268
            WHERE shlpname = l_shlpname
    269
            AND ddlanguage = sy-langu
    270
            AND as4local = 'A'.
    271
        IF sy-subrc = 0.
    272
          cs_ztadir-descript = l_ddtext.
    273
        ELSE.
    274
          SELECT SINGLE shlpname FROM dd30l INTO l_shlpname
    275
              WHERE shlpname = l_shlpname
    276
              AND as4local = 'A'.
    277
          IF sy-subrc <> 0.
    278
            cs_ztadir-subrc = gc_subrc_not_found.
    279
          ENDIF.
    280
        ENDIF.
    281
      ENDIF.
    282
    ENDFORM.                    "select_dd30
    283
    284
    285
    *-----------------------------------------------------------------------
    286
    * links_dd40                                     Tabellentypen
    287
    *                                    (im DD definierte interne Tabellen)
    288
    *-----------------------------------------------------------------------
    289
    FORM select_dd40
    290
      CHANGING
    291
        cs_ztadir TYPE st_ztadir.
    292
    293
      DATA:
    294
      l_ddtext TYPE ddtext,
    295
      l_typename TYPE typename.
    296
    297
      IF g_add_elem_ttyp = abap_false.
    298
        cs_ztadir-subrc = gc_subrc_deselected.
    299
      ELSE.
    300
        l_typename = cs_ztadir-obj_name.
    301
        SELECT SINGLE ddtext FROM dd40t INTO l_ddtext
    302
            WHERE typename = l_typename
    303
            AND ddlanguage = sy-langu
    304
            AND as4local = 'A'.
    305
        IF sy-subrc = 0.
    306
          cs_ztadir-descript = l_ddtext.
    307
        ELSE.
    308
          SELECT SINGLE typename FROM dd40l INTO l_typename
    309
              WHERE typename = l_typename
    310
              AND as4local = 'A'.
    311
          IF sy-subrc <> 0.
    312
            cs_ztadir-subrc = gc_subrc_not_found.
    313
          ENDIF.
    314
        ENDIF.
    315
      ENDIF.
    316
    ENDFORM.                    "select_dd40
    317
    318
    319
    *-----------------------------------------------------------------------
    320
    * select_ddtypet                                 Texte zu Typgruppen
    321
    *-----------------------------------------------------------------------
    322
    FORM select_ddtypet
    323
      CHANGING
    324
        cs_ztadir TYPE st_ztadir.
    325
    326
      DATA:
    327
      l_ddtext TYPE ddtext,
    328
      l_typegroup TYPE typegroup.
    329
    330
      IF g_add_elem_type = abap_false.
    331
        cs_ztadir-subrc = gc_subrc_deselected.
    332
      ELSE.
    333
        l_typegroup = cs_ztadir-obj_name.
    334
        SELECT SINGLE ddtext FROM ddtypet INTO l_ddtext
    335
            WHERE typegroup = l_typegroup
    336
            AND ddlanguage = sy-langu.
    337
        IF sy-subrc = 0.
    338
          cs_ztadir-descript = l_ddtext.
    339
        ELSE.
    340
          cs_ztadir-subrc = gc_subrc_not_found.
    341
        ENDIF.
    342
      ENDIF.
    343
    ENDFORM.                    "select_ddtypet
    344
    345
    346
    *-----------------------------------------------------------------------
    347
    * select_fdir                                    Funktionsgruppen
    348
    *-----------------------------------------------------------------------
    349
    FORM select_fdir
    350
      CHANGING
    351
        cs_ztadir TYPE st_ztadir.
    352
    353
      DATA:
    354
      ls_ztadir TYPE st_ztadir,
    355
      lt_ztadir TYPE it_ztadir,
    356
      lt_fdir TYPE STANDARD TABLE OF v_fdir,
    357
      l_progname TYPE progname,
    358
      lt_incl TYPE STANDARD TABLE OF progname,
    359
      l_incl TYPE progname,
    360
      l_group TYPE area,
    361
      l_include_number TYPE includenr,
    362
      lt_d020s TYPE STANDARD TABLE OF d020s,
    363
      l_area TYPE rs38l_area,
    364
      l_areat TYPE areat,
    365
      l_stext TYPE rs38l_ftxt,
    366
      l_dtxt TYPE as4text,
    367
      l_text TYPE repti.
    368
    369
      FIELD-SYMBOLS:
    370
      <ls_fdir> TYPE v_fdir,
    371
      <ls_d020s> TYPE d020s.
    372
    373
      l_area = cs_ztadir-obj_name.
    374
    375
    * Function Group
    376
      IF g_add_elem_fugr = abap_false.
    377
        cs_ztadir-subrc = gc_subrc_deselected.
    378
      ELSE.
    379
        cs_ztadir-futype = gc_futype_group.
    380
        SELECT SINGLE areat FROM tlibt INTO l_areat
    381
          WHERE area = l_area
    382
          AND spras = sy-langu.
    383
        IF sy-subrc = 0.
    384
          cs_ztadir-descript = l_areat.
    385
        ELSE.
    386
          SELECT SINGLE area FROM tlibg INTO l_area
    387
            WHERE area = l_area.
    388
          IF sy-subrc <> 0.
    389
            cs_ztadir-subrc = gc_subrc_not_found.
    390
            CHECK sy-subrc = 0.
    391
          ENDIF.
    392
        ENDIF.
    393
        CALL FUNCTION 'RS_TADIR_TO_PROGNAME'
    394
          EXPORTING
    395
            object   = cs_ztadir-object
    396
            obj_name = cs_ztadir-obj_name
    397
          IMPORTING
    398
            progname = l_progname.
    399
      ENDIF.
    400
    401
    * Function Modules
    402
      IF g_add_elem_fuba = abap_true
    403
      OR g_add_elem_fuincl = abap_true.
    404
        SELECT * FROM v_fdir INTO TABLE lt_fdir
    405
            WHERE area = l_area
    406
            AND active = abap_true.
    407
        LOOP AT lt_fdir ASSIGNING <ls_fdir>.
    408
          CLEAR ls_ztadir.
    409
          MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    410
          CLEAR ls_ztadir-descript.
    411
          ls_ztadir-futype = gc_futype_module.
    412
          ls_ztadir-funcname = <ls_fdir>-funcname.
    413
          IF NOT <ls_fdir>-masterlang IS INITIAL.
    414
            ls_ztadir-masterlang = <ls_fdir>-masterlang.
    415
          ENDIF.
    416
          SELECT SINGLE stext FROM tftit INTO l_stext
    417
            WHERE funcname = <ls_fdir>-funcname
    418
            AND spras = sy-langu.
    419
          IF sy-subrc = 0.
    420
            ls_ztadir-descript = l_stext.
    421
          ENDIF.
    422
          CALL FUNCTION 'FUNCTION_INCLUDE_CONCATENATE'
    423
            EXPORTING
    424
              include_number = <ls_fdir>-include
    425
            IMPORTING
    426
              include        = ls_ztadir-progname
    427
            CHANGING
    428
              group          = <ls_fdir>-area.
    429
          APPEND ls_ztadir TO lt_ztadir.
    430
          IF g_add_elem_fuba = abap_true.
    431
            APPEND ls_ztadir TO gt_ztadir.
    432
          ENDIF.
    433
        ENDLOOP.
    434
      ENDIF.
    435
    436
    * Screens
    437
      IF g_add_elem_scr = abap_true.
    438
        SELECT * FROM d020s INTO TABLE lt_d020s
    439
          WHERE prog = l_progname.
    440
        LOOP AT lt_d020s ASSIGNING <ls_d020s>.
    441
          CLEAR ls_ztadir.
    442
          MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    443
          CLEAR ls_ztadir-descript.
    444
          SELECT SINGLE dtxt FROM d020t INTO l_dtxt
    445
            WHERE prog = l_progname
    446
            AND dynr = <ls_d020s>-dnum
    447
            AND lang = sy-langu.
    448
          IF sy-subrc = 0.
    449
            ls_ztadir-descript = l_dtxt.
    450
          ENDIF.
    451
          ls_ztadir-futype = gc_futype_screen.
    452
          ls_ztadir-progname = l_progname.
    453
          ls_ztadir-dynpronr = <ls_d020s>-dnum.
    454
          ls_ztadir-masterlang = <ls_d020s>-spra.
    455
          APPEND ls_ztadir TO gt_ztadir.
    456
        ENDLOOP.
    457
      ENDIF.
    458
    459
    * Includes
    460
      IF g_add_elem_fuincl = abap_true.
    461
        CALL FUNCTION 'GET_INCLUDETAB'
    462
          EXPORTING
    463
            progname = l_progname
    464
          TABLES
    465
            incltab  = lt_incl.
    466
        SORT lt_incl.
    467
        LOOP AT lt_incl INTO l_incl.
    468
          l_progname = l_incl.
    469
          CALL FUNCTION 'FUNCTION_INCLUDE_SPLIT'
    470
            IMPORTING
    471
              group          = l_group
    472
              include_number = l_include_number
    473
            CHANGING
    474
              include        = l_progname.
    475
    *     check if include is a function module
    476
          READ TABLE lt_ztadir TRANSPORTING NO FIELDS
    477
            WITH KEY progname = l_progname.
    478
          IF sy-subrc = 0.
    479
            CONTINUE.      "include is a function module
    480
          ENDIF.
    481
          IF l_group = cs_ztadir-obj_name
    482
          AND NOT l_include_number IS INITIAL.
    483
            CONTINUE.
    484
          ENDIF.
    485
          CLEAR ls_ztadir.
    486
          MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    487
          CLEAR ls_ztadir-descript.
    488
          SELECT SINGLE text FROM trdirt INTO l_text
    489
              WHERE name = l_incl
    490
              AND sprsl = sy-langu.
    491
          IF sy-subrc = 0.
    492
            ls_ztadir-descript = l_text.
    493
          ENDIF.
    494
          ls_ztadir-futype = gc_futype_include.
    495
          ls_ztadir-funcname = l_incl.
    496
          ls_ztadir-progname = l_incl.
    497
          CALL FUNCTION 'RS_PROGRAM_GET_DEVCLASS'
    498
            EXPORTING
    499
              progname = ls_ztadir-progname
    500
            IMPORTING
    501
              devclass = ls_ztadir-devclass.
    502
          APPEND ls_ztadir TO gt_ztadir.
    503
        ENDLOOP.
    504
      ENDIF.
    505
    ENDFORM.                    "select_fdir
    506
    507
    508
    *-----------------------------------------------------------------------
    509
    * select_O2_appl                                 BSP Applications
    510
    *-----------------------------------------------------------------------
    511
    FORM select_o2_appl
    512
      CHANGING
    513
        cs_ztadir TYPE st_ztadir.
    514
    515
      DATA:
    516
      l_text TYPE as4text,
    517
      l_applname(30) TYPE c,
    518
      l_applext(30) TYPE c,
    519
      l_descript(60) TYPE c,
    520
      ls_ztadir TYPE st_ztadir,
    521
      l_pagekey(70) TYPE c,
    522
      l_pagename(70) TYPE c,
    523
      l_pagetype TYPE c,
    524
      lt_mime TYPE it_mime.
    525
    526
      FIELD-SYMBOLS:
    527
      <ls_mime> TYPE st_mime.
    528
    529
      IF g_add_elem_o2appl = abap_false.
    530
        cs_ztadir-subrc = gc_subrc_deselected.
    531
      ELSE.
    532
        l_applname = cs_ztadir-obj_name.
    533
        SELECT SINGLE applname applext FROM ('O2APPL')
    534
            INTO (l_applname, l_applext)
    535
            WHERE applname = l_applname
    536
            AND version = 'A'.
    537
        IF sy-subrc = 0.
    538
          cs_ztadir-o2name = l_applext.
    539
          SELECT SINGLE text FROM ('O2APPLT') INTO l_text
    540
              WHERE applname = l_applname
    541
              AND langu = sy-langu.
    542
          IF sy-subrc = 0.
    543
            cs_ztadir-descript = l_text.
    544
          ENDIF.
    545
    * Controller, Views, Pages with Flow Logik, Page Fragments
    546
          SELECT pagekey pagename pagetype FROM ('O2PAGDIR')
    547
              INTO (l_pagekey, l_pagename, l_pagetype)
    548
              WHERE applname = l_applname
    549
              ORDER BY pagekey.
    550
            IF ( l_pagetype = gc_o2type_bsp
    551
                 AND g_add_elem_o2applbsp  = abap_true )
    552
            OR ( l_pagetype = gc_o2type_ctrl
    553
                 AND g_add_elem_o2applctrl = abap_true )
    554
            OR ( l_pagetype = gc_o2type_incl
    555
                 AND g_add_elem_o2applincl = abap_true )
    556
            OR ( l_pagetype = gc_o2type_view
    557
                 AND g_add_elem_o2applview = abap_true ).
    558
              CLEAR: ls_ztadir.
    559
              MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    560
              CLEAR l_descript.
    561
              SELECT SINGLE descript FROM ('O2PAGDIRT')
    562
                  INTO l_descript
    563
                  WHERE applname = l_applname
    564
                  AND pagekey = l_pagekey
    565
                  AND langu = sy-langu.
    566
              ls_ztadir-descript = l_descript.
    567
              ls_ztadir-o2pagekey = l_pagekey.
    568
              ls_ztadir-o2pagename = l_pagename.
    569
              ls_ztadir-o2type = l_pagetype.
    570
              APPEND ls_ztadir TO gt_ztadir.
    571
            ENDIF.
    572
          ENDSELECT.
    573
    *MIMEs
    574
          IF g_add_elem_o2applmime  = abap_true.
    575
            PERFORM o2_get_mimes
    576
              USING l_applname
    577
              CHANGING lt_mime.
    578
            LOOP AT lt_mime ASSIGNING <ls_mime>.
    579
              CLEAR: ls_ztadir.
    580
              MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    581
              CLEAR ls_ztadir-descript.
    582
              ls_ztadir-o2pagekey = <ls_mime>-key.
    583
              ls_ztadir-o2pagename = <ls_mime>-name.
    584
              ls_ztadir-o2type = gc_o2type_mime.
    585
              ls_ztadir-mime_objtype = <ls_mime>-objtype.
    586
              ls_ztadir-mime_class = <ls_mime>-class.
    587
              ls_ztadir-mime_objid = <ls_mime>-objid.
    588
              ls_ztadir-descript = <ls_mime>-mimetype_descript.
    589
              APPEND ls_ztadir TO gt_ztadir.
    590
            ENDLOOP.
    591
          ENDIF.
    592
    ***
    593
        ELSE.
    594
          cs_ztadir-subrc = gc_subrc_not_found.
    595
        ENDIF.
    596
      ENDIF.
    597
    ENDFORM.                    "select_O2_appl
    598
    599
    600
    *-----------------------------------------------------------------------
    601
    * select_O2_taglib                               BSP Extensions
    602
    *-----------------------------------------------------------------------
    603
    FORM select_o2_taglib
    604
      CHANGING
    605
        cs_ztadir TYPE st_ztadir.
    606
    607
      DATA:
    608
      l_descript TYPE as4text,
    609
      l_tlibid(30) TYPE c,
    610
      l_tagid(30) TYPE c,
    611
      ls_ztadir TYPE st_ztadir.
    612
    613
      IF g_add_elem_o2taglib = abap_false.
    614
        cs_ztadir-subrc = gc_subrc_deselected.
    615
      ELSE.
    616
        l_tlibid = cs_ztadir-obj_name.
    617
        SELECT SINGLE tlibid FROM ('O2TAGLIB') INTO l_tlibid
    618
            WHERE tlibid = l_tlibid
    619
            AND state = 'A'.
    620
        IF sy-subrc = 0.
    621
          SELECT SINGLE descript FROM ('TAGLIBT') INTO l_descript
    622
              WHERE tlibid = l_tlibid
    623
              AND state = 'A'
    624
              AND langu = sy-langu.
    625
          IF sy-subrc = 0.
    626
            cs_ztadir-descript = l_descript.
    627
          ENDIF.
    628
    * TAGs
    629
          SELECT tagid FROM ('O2TAG') INTO l_tagid
    630
              WHERE tlibid = l_tlibid
    631
              AND state = 'A'.
    632
            CLEAR: ls_ztadir.
    633
            MOVE-CORRESPONDING cs_ztadir TO ls_ztadir.
    634
            CLEAR ls_ztadir-descript.
    635
            SELECT SINGLE descript FROM ('TAGT') INTO l_descript
    636
                WHERE tlibid = l_tlibid
    637
                AND state = 'A'
    638
                AND langu = sy-langu
    639
                AND tagid = l_tagid.
    640
            IF sy-subrc = 0.
    641
              ls_ztadir-descript = l_descript.
    642
            ENDIF.
    643
            ls_ztadir-o2type = gc_o2type_tag.
    644
            ls_ztadir-o2name = l_tagid.
    645
            ls_ztadir-o2pagekey = l_tagid.
    646
            TRANSLATE ls_ztadir-o2pagekey TO UPPER CASE.
    647
            APPEND ls_ztadir TO gt_ztadir.
    648
          ENDSELECT.
    649
    ***
    650
        ELSE.
    651
          cs_ztadir-subrc = gc_subrc_not_found.
    652
        ENDIF.
    653
      ENDIF.
    654
    ENDFORM.                    "select_O2_taglib
    655
    656
    657
    *-----------------------------------------------------------------------
    658
    * select_O2_xslt                                 Transformation
    659
    *-----------------------------------------------------------------------
    660
    FORM select_o2_xslt
    661
      CHANGING
    662
        cs_ztadir TYPE st_ztadir.
    663
    664
      DATA:
    665
      l_descript TYPE as4text,
    666
      l_xsltdesc(40) TYPE c.
    667
    668
      IF g_add_elem_xslt = abap_false.
    669
        cs_ztadir-subrc = gc_subrc_deselected.
    670
      ELSE.
    671
        l_xsltdesc = cs_ztadir-obj_name.
    672
        SELECT SINGLE descript FROM ('O2XSLTTEXT') INTO l_descript
    673
            WHERE xsltdesc = l_xsltdesc
    674
            AND langu = sy-langu
    675
            AND state = 'A'.
    676
        IF sy-subrc = 0.
    677
          cs_ztadir-descript = l_descript.
    678
        ELSE.
    679
          cs_ztadir-subrc = gc_subrc_not_found.
    680
        ENDIF.
    681
      ENDIF.
    682
    ENDFORM.                    "select_O2_xslt
    683
    684
    685
    *-----------------------------------------------------------------------
    686
    * select_seoclass                                Klasse/Interface
    687
    *-----------------------------------------------------------------------
    688
    FORM select_seoclass
    689
      CHANGING
    690
        cs_ztadir TYPE st_ztadir.
    691
    692
      DATA:
    693
      l_descript TYPE seodescr,
    694
      l_clsname TYPE seoclsname,
    695
      l_type TYPE seoclstype.
    696
    697
      l_clsname = cs_ztadir-obj_name.
    698
      CASE cs_ztadir-object.
    699
        WHEN 'CLAS'.
    700
          l_type = 0.
    701
          IF g_add_elem_clas = abap_false.
    702
            cs_ztadir-subrc = gc_subrc_deselected.
    703
          ENDIF.
    704
        WHEN 'INTF'.
    705
          l_type = 1.
    706
          IF g_add_elem_intf = abap_false.
    707
            cs_ztadir-subrc = gc_subrc_deselected.
    708
          ENDIF.
    709
        WHEN OTHERS.
    710
          l_type = 2.
    711
      ENDCASE.
    712
      IF cs_ztadir-subrc = 0.
    713
        SELECT SINGLE clsname FROM seoclass INTO l_clsname
    714
            WHERE clsname = l_clsname
    715
            AND clstype = l_type.
    716
        IF sy-subrc <> 0.
    717
          cs_ztadir-subrc = gc_subrc_not_found.
    718
        ELSE.
    719
          SELECT SINGLE descript FROM seoclasstx INTO l_descript
    720
              WHERE clsname = l_clsname
    721
              AND langu = sy-langu.
    722
          IF sy-subrc = 0.
    723
            cs_ztadir-descript = l_descript.
    724
          ENDIF.
    725
        ENDIF.
    726
      ENDIF.
    727
    ENDFORM.                    "select_seoclass
    728
    729
    730
    *-----------------------------------------------------------------------
    731
    * select_t100                                    Message Class
    732
    *-----------------------------------------------------------------------
    733
    FORM select_t100
    734
      CHANGING
    735
        cs_ztadir TYPE st_ztadir.
    736
    737
      DATA:
    738
      l_arbgb TYPE arbgb,
    739
      l_stext TYPE as4text.
    740
    741
      l_arbgb = cs_ztadir-obj_name.
    742
      IF g_add_elem_msag = abap_false.
    743
        cs_ztadir-subrc = gc_subrc_deselected.
    744
      ELSE.
    745
        SELECT SINGLE stext FROM t100a INTO l_stext
    746
            WHERE arbgb = l_arbgb.
    747
        IF sy-subrc <> 0.
    748
          cs_ztadir-subrc = gc_subrc_not_found.
    749
        ELSE.
    750
          SELECT SINGLE stext FROM t100t INTO l_stext
    751
              WHERE arbgb = l_arbgb
    752
              AND sprsl = sy-langu.
    753
          cs_ztadir-descript = l_stext.
    754
        ENDIF.
    755
      ENDIF.
    756
    ENDFORM.                    "select_t100
    757
    758
    759
    *-----------------------------------------------------------------------
    760
    * select_tobj                                    Authorization Object
    761
    *-----------------------------------------------------------------------
    762
    FORM select_tobj
    763
      CHANGING
    764
        cs_ztadir TYPE st_ztadir.
    765
    766
      DATA:
    767
      l_objct TYPE xuobject,
    768
      l_ttext TYPE xutext.
    769
    770
      l_objct = cs_ztadir-obj_name.
    771
      IF g_add_elem_tobj = abap_false.
    772
        cs_ztadir-subrc = gc_subrc_deselected.
    773
      ELSE.
    774
        SELECT SINGLE objct FROM tobj INTO l_objct
    775
            WHERE objct = l_objct.
    776
        IF sy-subrc <> 0.
    777
          cs_ztadir-subrc = gc_subrc_not_found.
    778
        ELSE.
    779
          SELECT SINGLE ttext FROM tobjt INTO l_ttext
    780
              WHERE object = l_objct
    781
              AND langu = sy-langu.
    782
          IF sy-subrc = 0.
    783
            cs_ztadir-descript = l_ttext.
    784
          ENDIF.
    785
        ENDIF.
    786
      ENDIF.
    787
    ENDFORM.                    "select_tobj
    788
    789
    790
    *-----------------------------------------------------------------------
    791
    * select_tpara                                   SET/GET Parameter
    792
    *-----------------------------------------------------------------------
    793
    FORM select_tpara
    794
      CHANGING
    795
        cs_ztadir TYPE st_ztadir.
    796
    797
      DATA:
    798
      l_paramid TYPE memoryid,
    799
      l_partext TYPE as4text.
    800
    801
      l_paramid = cs_ztadir-obj_name.
    802
      IF g_add_elem_para = abap_false.
    803
        cs_ztadir-subrc = gc_subrc_deselected.
    804
      ELSE.
    805
        SELECT SINGLE partext FROM tpara INTO l_partext
    806
            WHERE paramid = l_paramid.
    807
        IF sy-subrc <> 0.
    808
          cs_ztadir-subrc = gc_subrc_not_found.
    809
        ELSE.
    810
          cs_ztadir-descript = l_partext.
    811
          SELECT SINGLE partext FROM tparat INTO l_partext
    812
              WHERE paramid = l_paramid
    813
              AND sprache = sy-langu.
    814
          IF sy-subrc = 0.
    815
            cs_ztadir-descript = l_partext.
    816
          ENDIF.
    817
        ENDIF.
    818
      ENDIF.
    819
    ENDFORM.                    "select_tpara
    820
    821
    822
    *-----------------------------------------------------------------------
    823
    * select_tstc                                    Transaction
    824
    *-----------------------------------------------------------------------
    825
    FORM select_tstc
    826
      CHANGING
    827
        cs_ztadir TYPE st_ztadir.
    828
    829
      DATA:
    830
      l_tcode TYPE tcode,
    831
      l_ttext TYPE ttext_stct.
    832
    833
      l_tcode = cs_ztadir-obj_name.
    834
      IF g_add_elem_tran = abap_false.
    835
        cs_ztadir-subrc = gc_subrc_deselected.
    836
      ELSE.
    837
        SELECT SINGLE tcode FROM tstc INTO l_tcode
    838
            WHERE tcode = l_tcode.
    839
        IF sy-subrc <> 0.
    840
          cs_ztadir-subrc = gc_subrc_not_found.
    841
        ELSE.
    842
          SELECT SINGLE ttext FROM tstct INTO l_ttext
    843
              WHERE tcode = l_tcode
    844
              AND sprsl = sy-langu.
    845
          IF sy-subrc = 0.
    846
            cs_ztadir-descript = l_ttext.
    847
          ENDIF.
    848
        ENDIF.
    849
      ENDIF.
    850
    ENDFORM.                    "select_tstc
    851
    852
    853
    *-----------------------------------------------------------------------
    854
    * select_trdir                                   Program/Include
    855
    *-----------------------------------------------------------------------
    856
    FORM select_trdir
    857
      CHANGING
    858
        cs_ztadir TYPE st_ztadir.
    859
    860
      DATA:
    861
      l_program TYPE sy-repid,
    862
      l_title TYPE rs38m-repti.
    863
    864
      l_program = cs_ztadir-obj_name.
    865
      CALL FUNCTION 'PROGRAM_TITLE'
    866
        EXPORTING
    867
          program  = l_program
    868
          language = sy-langu
    869
        IMPORTING
    870
          title    = l_title.
    871
      cs_ztadir-descript = l_title.
    872
      cs_ztadir-progname = cs_ztadir-obj_name.
    873
      SELECT SINGLE subc FROM trdir INTO cs_ztadir-subc
    874
        WHERE name = cs_ztadir-progname.
    875
      IF sy-subrc <> 0
    876
      OR cs_ztadir-subc NA '1I'.
    877
        cs_ztadir-subrc = gc_subrc_not_found.
    878
      ELSEIF ( cs_ztadir-subc = 'I' AND g_add_elem_incl = abap_false )
    879
      OR ( cs_ztadir-subc = '1' AND g_add_elem_prog = abap_false ).
    880
        cs_ztadir-subrc = gc_subrc_deselected.
    881
      ENDIF.
    882
    ENDFORM.                    "select_trdir