Properties | SourceCde
Title | SoftCopy - ddic |
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_DDIC                                   *
    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
    * ddic
    31
    *-----------------------------------------------------------------------
    32
    FORM ddic.
    33
    *DOMA
    34
      PERFORM ddic_r3tr_doma.
    35
    *DTEL
    36
      PERFORM ddic_r3tr_dtel.
    37
    *ENQU: AGGTYPE = E
    38
      PERFORM ddic_r3tr_enqu.
    39
    *SHLP
    40
      PERFORM ddic_r3tr_shlp.
    41
    *TABL: TABCLASS = APPEND, INTTAB, VIEW
    42
      PERFORM ddic_r3tr_tabl_1.
    43
    *TABL: TABCLASS = CLUSTER, POOL, TRANSP
    44
      PERFORM ddic_r3tr_tabl_2.
    45
    *TTYP
    46
      PERFORM ddic_r3tr_ttyp.
    47
    *TYPE
    48
      PERFORM ddic_r3tr_type.
    49
    *VIEW
    50
      PERFORM ddic_r3tr_view.
    51
    52
    ENDFORM.                    "ddic
    53
    54
    55
    *-----------------------------------------------------------------------
    56
    * ddic_r3tr_doma                                 DomÃƒÂ¤nen
    57
    *-----------------------------------------------------------------------
    58
    FORM ddic_r3tr_doma.
    59
    60
      DATA:
    61
      lt_html TYPE it_string,
    62
      lt_tabstrip TYPE it_tabstrip,
    63
      l_domname TYPE domname,
    64
      ls_attributes TYPE st_attributes,
    65
      ls_definition TYPE st_definition_1,
    66
      ls_value_range TYPE st_value_range,
    67
      lt_value_range TYPE it_value_range,
    68
      ls_dd01v TYPE dd01v,
    69
      ls_dd01v_n TYPE dd01v,
    70
      lt_dd07v TYPE STANDARD TABLE OF dd07v,
    71
      lt_dd07v_n TYPE STANDARD TABLE OF dd07v,
    72
      l_state TYPE dcdomaget,
    73
      lt_doc TYPE it_string.
    74
    75
      FIELD-SYMBOLS:
    76
      <ls_ztadir> TYPE st_ztadir,
    77
      <ls_dd07v> TYPE dd07v,
    78
      <ls_tabstrip> TYPE st_tabstrip.
    79
    80
      PERFORM get_tabstrip
    81
        USING 'DDIC_R3TR_DOMA' space
    82
        CHANGING lt_tabstrip.
    83
    84
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    85
          WHERE pgmid = 'R3TR'
    86
          AND object = 'DOMA'
    87
          AND downloaded = abap_false.
    88
        <ls_ztadir>-downloaded = abap_true.
    89
    90
        CLEAR:
    91
        ls_attributes.
    92
    93
        REFRESH:
    94
        lt_html,
    95
        lt_value_range,
    96
        lt_dd07v,
    97
        lt_dd07v_n,
    98
        lt_doc.
    99
    100
        l_domname = <ls_ztadir>-obj_name.
    101
        CALL FUNCTION 'DD_DOMA_GET'
    102
          EXPORTING
    103
            domain_name = l_domname
    104
            langu       = sy-langu
    105
            withtext    = abap_true
    106
          IMPORTING
    107
            dd01v_wa_a  = ls_dd01v
    108
            dd01v_wa_n  = ls_dd01v_n
    109
            got_state   = l_state
    110
          TABLES
    111
            dd07v_tab_a = lt_dd07v
    112
            dd07v_tab_n = lt_dd07v_n
    113
          EXCEPTIONS
    114
            OTHERS      = 1.
    115
        IF sy-subrc <> 0.
    116
          <ls_ztadir>-subrc = sy-subrc.
    117
          CONTINUE.
    118
        ENDIF.
    119
        ls_attributes-bname = ls_dd01v-as4user.
    120
        PERFORM get_date
    121
          USING
    122
            ls_dd01v-as4date
    123
          CHANGING
    124
            ls_attributes-date_last_changed.
    125
        ls_attributes-devclass = <ls_ztadir>-devclass.
    126
        PERFORM get_devclass
    127
          USING
    128
            <ls_ztadir>-devclass
    129
          CHANGING
    130
            ls_attributes-devclass_descr.
    131
        IF ls_dd01v-dommaster IS INITIAL.
    132
          SELECT SINGLE masterlang FROM tadir INTO ls_dd01v-dommaster
    133
              WHERE pgmid = 'R3TR'
    134
              AND object = 'DOMA'
    135
              AND obj_name = l_domname.
    136
        ENDIF.
    137
        PERFORM get_spras
    138
          USING
    139
            ls_dd01v-dommaster
    140
          CHANGING
    141
            ls_attributes-laiso
    142
            ls_attributes-sptxt.
    143
        PERFORM get_user
    144
          USING
    145
            ls_dd01v-as4user
    146
          CHANGING
    147
            ls_attributes-name_text.
    148
    149
        ls_definition-datatype = ls_dd01v-datatype.
    150
        PERFORM get_dom_value_text
    151
          USING
    152
            'DATATYPE'
    153
            ls_dd01v-datatype
    154
          CHANGING
    155
            ls_definition-datadescr.
    156
        ls_definition-dataleng = ls_dd01v-leng.
    157
        ls_definition-datadeci = ls_dd01v-decimals.
    158
        ls_definition-outputlen = ls_dd01v-outputlen.
    159
        ls_definition-convexit = ls_dd01v-convexit.
    160
        ls_definition-signflag = ls_dd01v-signflag.
    161
        ls_definition-lowercase = ls_dd01v-lowercase.
    162
    163
        SORT lt_dd07v BY valpos.
    164
        LOOP AT lt_dd07v ASSIGNING <ls_dd07v>.
    165
          ls_value_range-ddtext = <ls_dd07v>-ddtext.
    166
          IF <ls_dd07v>-domval_ld IS INITIAL.
    167
            ls_value_range-domvalue_l = <ls_dd07v>-domvalue_l.
    168
          ELSE.
    169
            ls_value_range-domvalue_l = <ls_dd07v>-domval_ld.
    170
          ENDIF.
    171
          IF <ls_dd07v>-domval_hd IS INITIAL.
    172
            ls_value_range-domvalue_h = <ls_dd07v>-domval_hd.
    173
          ELSE.
    174
            ls_value_range-domvalue_h = <ls_dd07v>-domvalue_h.
    175
          ENDIF.
    176
          APPEND ls_value_range TO lt_value_range.
    177
        ENDLOOP.
    178
    *doma documentation
    179
        PERFORM get_docu
    180
          USING
    181
            'DO'
    182
            <ls_ztadir>-obj_name
    183
            'T'
    184
          CHANGING
    185
            lt_doc.
    186
    ***
    187
        LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    188
          <ls_tabstrip>-empty = abap_false.
    189
          CASE <ls_tabstrip>-id.
    190
            WHEN 'DOC'.
    191
              IF lt_doc IS INITIAL.
    192
                <ls_tabstrip>-empty = abap_true.
    193
              ENDIF.
    194
          ENDCASE.
    195
        ENDLOOP.
    196
    *HTML header
    197
        PERFORM html_main_header
    198
          USING
    199
            tpt_ddic_doma
    200
            txt_domain
    201
            <ls_ztadir>-obj_name
    202
            txt_active___1
    203
            txt_short_text___2
    204
            <ls_ztadir>-descript
    205
            space
    206
            lt_tabstrip
    207
            gt_link
    208
          CHANGING
    209
            lt_html.
    210
    *HTML documentation
    211
        IF NOT lt_doc IS INITIAL
    212
        OR g_empty_tab = gc_empty_tab_display.
    213
          PERFORM html_add_doc
    214
            USING
    215
              lt_doc
    216
              'DOC'
    217
              abap_false
    218
            CHANGING
    219
              lt_html.
    220
        ENDIF.
    221
    *HTML attributes
    222
        PERFORM html_add_attributes_1
    223
          USING
    224
            ls_attributes
    225
            'ATTRIBUTES'
    226
            abap_false
    227
          CHANGING
    228
            lt_html.
    229
    *HTML definition
    230
        PERFORM html_add_definition_1
    231
          USING
    232
            ls_definition
    233
            'DEFINITION'
    234
            abap_true
    235
          CHANGING
    236
            lt_html.
    237
    *HTML value range
    238
        PERFORM html_add_value_range
    239
          USING
    240
            lt_value_range
    241
            'VALUERANGE'
    242
            abap_false
    243
          CHANGING
    244
            lt_html.
    245
    *HTML footer
    246
        PERFORM html_main_footer
    247
          USING
    248
            lt_html.
    249
    *
    250
        PERFORM download
    251
          USING
    252
            lt_html
    253
            <ls_ztadir>-pgmid
    254
            <ls_ztadir>-object
    255
            <ls_ztadir>-obj_name
    256
            gc_extension_htm
    257
            abap_true.
    258
      ENDLOOP.
    259
    ENDFORM.                                                    "r3tr_doma
    260
    261
    262
    *-----------------------------------------------------------------------
    263
    * ddic_r3tr_dtel                                 Datenelemente
    264
    *-----------------------------------------------------------------------
    265
    FORM ddic_r3tr_dtel.
    266
    267
      DATA:
    268
      lt_html TYPE it_string,
    269
      lt_tabstrip TYPE it_tabstrip,
    270
      ls_tabstrip TYPE st_tabstrip,
    271
      l_rollname TYPE rollname,
    272
      ls_attributes TYPE st_attributes,
    273
      ls_data_type TYPE st_data_type,
    274
      ls_further_char TYPE st_further_char,
    275
      ls_field_label TYPE st_field_label,
    276
      lt_para TYPE tpara,
    277
      ls_dd01l TYPE dd01l,
    278
      lt_dd03p TYPE STANDARD TABLE OF dd03p,
    279
      ls_dd04l TYPE dd04l,
    280
      ls_dd04l_n TYPE dd04l,
    281
      lt_dd04t TYPE STANDARD TABLE OF dd04t,
    282
      ls_dd04t TYPE dd04t,
    283
      lt_dd04t_n TYPE STANDARD TABLE OF dd04t,
    284
      l_state TYPE ddrefstruc-state,
    285
      lt_doc TYPE it_string,
    286
      lt_docdz TYPE STANDARD TABLE OF docdz,
    287
      l_tab_nr TYPE i,
    288
      l_tab_id TYPE string,
    289
      l_doc_obj TYPE doku_obj,
    290
      l_active TYPE flag.
    291
    292
      FIELD-SYMBOLS:
    293
      <l_dataleng> TYPE ANY,
    294
      <l_datatype> TYPE ANY,
    295
      <l_decimals> TYPE ANY,
    296
      <l_refkind> TYPE ANY,
    297
      <l_reftype> TYPE ANY,
    298
      <ls_ztadir> TYPE st_ztadir,
    299
      <ls_dd03p> TYPE dd03p,
    300
      <ls_tabstrip> TYPE st_tabstrip,
    301
      <ls_docdz> TYPE docdz.
    302
    303
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    304
          WHERE pgmid = 'R3TR'
    305
          AND object = 'DTEL'
    306
          AND downloaded = abap_false.
    307
        <ls_ztadir>-downloaded = abap_true.
    308
    309
        CLEAR:
    310
        ls_attributes.
    311
    312
        REFRESH:
    313
        lt_html,
    314
        lt_tabstrip,
    315
        lt_dd04t,
    316
        lt_dd04t_n,
    317
        lt_doc,
    318
        lt_docdz.
    319
    320
        l_rollname = <ls_ztadir>-obj_name.
    321
        CALL FUNCTION 'DD_DTEL_GET'
    322
          EXPORTING
    323
            roll_name   = l_rollname
    324
            langu       = sy-langu
    325
            withtext    = abap_true
    326
          IMPORTING
    327
            got_state   = l_state
    328
            dd04l_wa_a  = ls_dd04l
    329
            dd04l_wa_n  = ls_dd04l_n
    330
            dd01l_wa    = ls_dd01l
    331
            tpara_wa    = lt_para
    332
          TABLES
    333
            dd04t_tab_a = lt_dd04t
    334
            dd04t_tab_n = lt_dd04t_n
    335
          EXCEPTIONS
    336
            OTHERS      = 1.
    337
        IF sy-subrc <> 0.
    338
          <ls_ztadir>-subrc = sy-subrc.
    339
          CONTINUE.
    340
        ENDIF.
    341
        READ TABLE lt_dd04t INTO ls_dd04t INDEX 1.
    342
    *attributes
    343
        ls_attributes-bname = ls_dd04l-as4user.
    344
        PERFORM get_date
    345
          USING
    346
            ls_dd04l-as4date
    347
          CHANGING
    348
            ls_attributes-date_last_changed.
    349
        ls_attributes-devclass = <ls_ztadir>-devclass.
    350
        PERFORM get_devclass
    351
          USING
    352
            <ls_ztadir>-devclass
    353
          CHANGING
    354
            ls_attributes-devclass_descr.
    355
        IF ls_dd04l-dtelmaster IS INITIAL.
    356
          SELECT SINGLE masterlang FROM tadir INTO ls_dd04l-dtelmaster
    357
              WHERE pgmid = 'R3TR'
    358
              AND object = 'DTEL'
    359
              AND obj_name = l_rollname.
    360
        ENDIF.
    361
        PERFORM get_spras
    362
          USING
    363
            ls_dd04l-dtelmaster
    364
          CHANGING
    365
            ls_attributes-laiso
    366
            ls_attributes-sptxt.
    367
        PERFORM get_user
    368
          USING
    369
            ls_dd04l-as4user
    370
          CHANGING
    371
            ls_attributes-name_text.
    372
    *data type
    373
        ls_data_type-domname = ls_dd04l-domname.
    374
        PERFORM get_dom
    375
          USING
    376
            ls_data_type-domname
    377
          CHANGING
    378
            ls_data_type-domdescr.
    379
        ASSIGN COMPONENT 'DATATYPE' OF STRUCTURE ls_dd04l TO <l_datatype>.
    380
        IF <l_datatype> IS ASSIGNED.
    381
          ls_data_type-datatype = <l_datatype>.
    382
          UNASSIGN <l_datatype>.
    383
        ENDIF.
    384
        PERFORM get_dom_value_text
    385
          USING
    386
            'DATATYPE'
    387
            ls_dd04l-domname
    388
          CHANGING
    389
            ls_data_type-datadescr.
    390
        ASSIGN COMPONENT 'LENG' OF STRUCTURE ls_dd04l TO <l_dataleng>.
    391
        IF <l_dataleng> IS ASSIGNED.
    392
          ls_data_type-dataleng = <l_dataleng>.
    393
          UNASSIGN <l_dataleng>.
    394
        ENDIF.
    395
        ASSIGN COMPONENT 'DECIMALS' OF STRUCTURE ls_dd04l TO <l_decimals>.
    396
        IF <l_decimals> IS ASSIGNED.
    397
          ls_data_type-datadeci = <l_decimals>.
    398
          UNASSIGN <l_decimals>.
    399
        ENDIF.
    400
        ASSIGN COMPONENT 'REFKIND' OF STRUCTURE ls_dd04l TO <l_refkind>.
    401
        IF <l_refkind> IS ASSIGNED.
    402
          ls_data_type-refkind = <l_refkind>.
    403
          UNASSIGN <l_refkind>.
    404
        ENDIF.
    405
        ASSIGN COMPONENT 'REFTYPE' OF STRUCTURE ls_dd04l TO <l_reftype>.
    406
        IF <l_reftype> IS ASSIGNED.
    407
          ls_data_type-reftype = <l_reftype>.
    408
          UNASSIGN <l_reftype>.
    409
        ELSE.
    410
          ls_data_type-reftype = '#'.  "R/3 4.6 does not know ref type
    411
        ENDIF.
    412
    *further char
    413
        ls_further_char-shlpname = ls_dd04l-shlpname.
    414
        ls_further_char-shlpfield = ls_dd04l-shlpfield.
    415
        ls_further_char-memoryid = ls_dd04l-memoryid.
    416
        ls_further_char-deffdname = ls_dd04l-deffdname.
    417
        ls_further_char-logflag = ls_dd04l-logflag.
    418
    *field label
    419
        ls_field_label-scrlen_s = ls_dd04l-scrlen1.
    420
        ls_field_label-scrtext_s = ls_dd04t-scrtext_s.
    421
        ls_field_label-scrlen_m = ls_dd04l-scrlen2.
    422
        ls_field_label-scrtext_m = ls_dd04t-scrtext_m.
    423
        ls_field_label-scrlen_l = ls_dd04l-scrlen3.
    424
        ls_field_label-scrtext_l = ls_dd04t-scrtext_l.
    425
        ls_field_label-headlen = ls_dd04l-headlen.
    426
        ls_field_label-reptext = ls_dd04t-reptext.
    427
    *dtel documentation
    428
        PERFORM get_docu
    429
          USING
    430
            'DE'
    431
            <ls_ztadir>-obj_name
    432
            'E'
    433
          CHANGING
    434
            lt_doc.
    435
    *supplementary documentation
    436
        CALL FUNCTION 'DOCU_GET_DZ'
    437
          EXPORTING
    438
            langu    = sy-langu
    439
            rollname = l_rollname
    440
          TABLES
    441
            dz_list  = lt_docdz
    442
          EXCEPTIONS
    443
            OTHERS   = 1.
    444
        SORT lt_docdz BY addition.
    445
    ***
    446
        PERFORM get_tabstrip
    447
          USING 'DDIC_R3TR_DTEL' space
    448
          CHANGING lt_tabstrip.
    449
        SORT lt_tabstrip BY tab_nr DESCENDING.
    450
        READ TABLE lt_tabstrip ASSIGNING <ls_tabstrip> INDEX 1.
    451
        l_tab_nr = <ls_tabstrip>-tab_nr.
    452
        SORT lt_tabstrip BY tab_nr.
    453
        CLEAR ls_tabstrip.
    454
        ls_tabstrip-active_order = 1.
    455
        LOOP AT lt_docdz ASSIGNING <ls_docdz>.
    456
          l_tab_nr = l_tab_nr + 1.
    457
          ls_tabstrip-form = 'DDIC_R3TR_DTEL'.
    458
          CONCATENATE 'DOCDZ_' <ls_docdz>-addition INTO ls_tabstrip-id.
    459
          ls_tabstrip-parent_id = 'DOCDZ'.
    460
          ls_tabstrip-tab_nr = l_tab_nr.
    461
          ls_tabstrip-text = <ls_docdz>-addition.
    462
          APPEND ls_tabstrip TO lt_tabstrip.
    463
          CLEAR ls_tabstrip.
    464
        ENDLOOP.
    465
        LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    466
          <ls_tabstrip>-empty = abap_false.
    467
          CASE <ls_tabstrip>-id.
    468
            WHEN 'DOC'.
    469
              IF lt_doc IS INITIAL.
    470
                <ls_tabstrip>-empty = abap_true.
    471
              ENDIF.
    472
            WHEN 'DOCDZ'.
    473
              IF lt_docdz IS INITIAL.
    474
                <ls_tabstrip>-empty = abap_true.
    475
              ENDIF.
    476
          ENDCASE.
    477
        ENDLOOP.
    478
    *HTML header
    479
        PERFORM html_main_header
    480
          USING
    481
            tpt_ddic_dtel
    482
            txt_data_element___1
    483
            <ls_ztadir>-obj_name
    484
            txt_active___1
    485
            txt_short_text___2
    486
            <ls_ztadir>-descript
    487
            space
    488
            lt_tabstrip
    489
            gt_link
    490
          CHANGING
    491
            lt_html.
    492
    *HTML documentation
    493
        IF NOT lt_doc IS INITIAL
    494
        OR g_empty_tab = gc_empty_tab_display.
    495
          PERFORM html_add_doc
    496
            USING
    497
              lt_doc
    498
              'DOC'
    499
              abap_false
    500
            CHANGING
    501
              lt_html.
    502
        ENDIF.
    503
    *HTML supplementary documentation
    504
        IF NOT lt_docdz IS INITIAL
    505
        OR g_empty_tab = gc_empty_tab_display.
    506
          PERFORM html_add_container_begin
    507
            USING
    508
              lt_tabstrip
    509
              'DOCDZ'
    510
              abap_false
    511
            CHANGING
    512
              lt_html.
    513
          l_active = abap_true.
    514
          LOOP AT lt_docdz ASSIGNING <ls_docdz>.
    515
            CLEAR: l_tab_id, l_doc_obj.
    516
            REFRESH lt_doc.
    517
            CONCATENATE 'DOCDZ_' <ls_docdz>-addition INTO l_tab_id.
    518
            CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
    519
              EXPORTING
    520
                docu_id  = 'DZ'
    521
                element  = <ls_docdz>-rollname
    522
                addition = <ls_docdz>-addition
    523
              IMPORTING
    524
                object   = l_doc_obj.
    525
            PERFORM get_docu
    526
              USING
    527
                'DZ'
    528
                l_doc_obj
    529
                'E'
    530
              CHANGING
    531
                lt_doc.
    532
            PERFORM html_add_doc
    533
              USING
    534
                lt_doc
    535
                l_tab_id
    536
                l_active
    537
              CHANGING
    538
                lt_html.
    539
            l_active = abap_false.
    540
          ENDLOOP.
    541
          PERFORM html_add_container_end
    542
            CHANGING
    543
              lt_html.
    544
        ENDIF.
    545
    *HTML attributes
    546
        PERFORM html_add_attributes_1
    547
          USING
    548
            ls_attributes
    549
            'ATTRIBUTES'
    550
            abap_false
    551
          CHANGING
    552
            lt_html.
    553
    *HTML data type
    554
        PERFORM html_add_data_type
    555
          USING
    556
            ls_data_type
    557
            'DATATYPE'
    558
            abap_true
    559
          CHANGING
    560
            lt_html.
    561
    *HTML further char
    562
        PERFORM html_add_further_char
    563
          USING
    564
            ls_further_char
    565
            'FURTHERCHAR'
    566
            abap_false
    567
          CHANGING
    568
            lt_html.
    569
    *HTML field label
    570
        PERFORM html_add_field_label
    571
          USING
    572
            ls_field_label
    573
            'FIELDLABEL'
    574
            abap_false
    575
          CHANGING
    576
            lt_html.
    577
    *HTML footer
    578
        PERFORM html_main_footer
    579
          USING
    580
            lt_html.
    581
    582
    *download
    583
        PERFORM download
    584
          USING
    585
            lt_html
    586
            <ls_ztadir>-pgmid
    587
            <ls_ztadir>-object
    588
            <ls_ztadir>-obj_name
    589
            gc_extension_htm
    590
            abap_true.
    591
      ENDLOOP.
    592
    ENDFORM.                                                    "r3tr_dtel
    593
    594
    595
    *-----------------------------------------------------------------------
    596
    * ddic_r3tr_enqu                                 Aggregat-Header
    597
    *                                                         (Sperrobjekte)
    598
    *-----------------------------------------------------------------------
    599
    FORM ddic_r3tr_enqu.
    600
    601
      DATA:
    602
      lt_html TYPE it_string,
    603
      lt_tabstrip TYPE it_tabstrip,
    604
      l_viewname TYPE viewname,
    605
      ls_attributes TYPE st_attributes,
    606
      lt_tables TYPE it_tables,
    607
      ls_tables TYPE st_tables,
    608
      ls_dd25v TYPE dd25v,
    609
      ls_dd25v_n TYPE dd25v,
    610
      lt_dd26v TYPE STANDARD TABLE OF dd26v,
    611
      lt_dd26v_n TYPE STANDARD TABLE OF dd26v,
    612
      lt_dd27p TYPE STANDARD TABLE OF dd27p,
    613
      lt_dd27p_n TYPE STANDARD TABLE OF dd27p,
    614
      l_state TYPE dcenquget.
    615
    616
      FIELD-SYMBOLS:
    617
      <ls_ztadir> TYPE st_ztadir,
    618
      <ls_dd27p> TYPE dd27p.
    619
    620
      PERFORM get_tabstrip
    621
        USING 'DDIC_R3TR_ENQU' space
    622
        CHANGING lt_tabstrip.
    623
    624
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    625
          WHERE pgmid = 'R3TR'
    626
          AND object = 'ENQU'
    627
          AND aggtype = 'E'
    628
          AND downloaded = abap_false.
    629
        <ls_ztadir>-downloaded = abap_true.
    630
    631
        CLEAR:
    632
        ls_attributes.
    633
    634
        REFRESH:
    635
        lt_html,
    636
        lt_dd26v,
    637
        lt_dd26v_n,
    638
        lt_dd27p,
    639
        lt_dd27p_n.
    640
    641
        l_viewname = <ls_ztadir>-obj_name.
    642
        CALL FUNCTION 'DD_ENQU_GET'
    643
          EXPORTING
    644
            enqu_name   = l_viewname
    645
            langu       = sy-langu
    646
            withtext    = abap_true
    647
          IMPORTING
    648
            dd25v_wa_a  = ls_dd25v
    649
            dd25v_wa_n  = ls_dd25v_n
    650
            got_state   = l_state
    651
          TABLES
    652
            dd26v_tab_a = lt_dd26v
    653
            dd26v_tab_n = lt_dd26v_n
    654
            dd27p_tab_a = lt_dd27p
    655
            dd27p_tab_n = lt_dd27p_n
    656
          EXCEPTIONS
    657
            OTHERS      = 1.
    658
        IF sy-subrc <> 0.
    659
          <ls_ztadir>-subrc = sy-subrc.
    660
          CONTINUE.
    661
        ENDIF.
    662
    *attributes
    663
        ls_attributes-bname = ls_dd25v-as4user.
    664
        PERFORM get_date
    665
          USING
    666
            ls_dd25v-as4date
    667
          CHANGING
    668
            ls_attributes-date_last_changed.
    669
        ls_attributes-devclass = <ls_ztadir>-devclass.
    670
        PERFORM get_devclass
    671
          USING
    672
            <ls_ztadir>-devclass
    673
          CHANGING
    674
            ls_attributes-devclass_descr.
    675
        IF ls_dd25v-masterlang IS INITIAL.
    676
          SELECT SINGLE masterlang FROM tadir INTO ls_dd25v-masterlang
    677
              WHERE pgmid = 'R3TR'
    678
              AND object = 'ENQU'
    679
              AND obj_name = l_viewname.
    680
        ENDIF.
    681
        PERFORM get_spras
    682
          USING
    683
            ls_dd25v-masterlang
    684
          CHANGING
    685
            ls_attributes-laiso
    686
            ls_attributes-sptxt.
    687
        PERFORM get_user
    688
          USING
    689
            ls_dd25v-as4user
    690
          CHANGING
    691
            ls_attributes-name_text.
    692
        ls_attributes-display_rfcenable = abap_true.
    693
        ls_attributes-rfcenable = ls_dd25v-globalflag.
    694
    695
        SORT lt_dd27p BY viewname objpos.
    696
        LOOP AT lt_dd27p ASSIGNING <ls_dd27p>
    697
            WHERE fieldname = '*'.
    698
          CLEAR ls_tables.
    699
          IF <ls_dd27p>-tabname = ls_dd25v-roottab.
    700
            ls_tables-primary = abap_true.
    701
          ENDIF.
    702
          ls_tables-tabname = <ls_dd27p>-tabname.
    703
          PERFORM get_dom_value_text
    704
            USING
    705
              'ENQMODE'
    706
              <ls_dd27p>-enqmode
    707
            CHANGING
    708
              ls_tables-enqmode.
    709
          APPEND ls_tables TO lt_tables.
    710
        ENDLOOP.
    711
    712
    713
        PERFORM html_main_header
    714
          USING
    715
            tpt_ddic_enqu
    716
            txt_lock_object___1
    717
            <ls_ztadir>-obj_name
    718
            txt_active___1
    719
            txt_short_text___2
    720
            <ls_ztadir>-descript
    721
            space
    722
            lt_tabstrip
    723
            gt_link
    724
          CHANGING
    725
            lt_html.
    726
        PERFORM html_add_attributes_1
    727
          USING
    728
            ls_attributes
    729
            'ATTRIBUTES'
    730
            abap_false
    731
          CHANGING
    732
            lt_html.
    733
        PERFORM html_add_tables
    734
          USING
    735
            lt_tables
    736
            'TABLES'
    737
            abap_true
    738
          CHANGING
    739
            lt_html.
    740
    741
        DELETE lt_dd27p WHERE fieldname = '*'.
    742
        PERFORM html_add_table
    743
          USING
    744
            'ENQU_PARAM'
    745
            lt_dd27p
    746
            lt_dd27p
    747
            'LOCKPARAMETER'
    748
            abap_false
    749
          CHANGING
    750
            lt_html.
    751
        PERFORM html_main_footer
    752
          USING
    753
            lt_html.
    754
    755
        PERFORM download
    756
          USING
    757
            lt_html
    758
            <ls_ztadir>-pgmid
    759
            <ls_ztadir>-object
    760
            <ls_ztadir>-obj_name
    761
            gc_extension_htm
    762
            abap_true.
    763
      ENDLOOP.
    764
    ENDFORM.                    "r3tr_enqu_e
    765
    766
    767
    *-----------------------------------------------------------------------
    768
    * ddic_r3tr_shlp                                 Suchhilfen
    769
    *-----------------------------------------------------------------------
    770
    FORM ddic_r3tr_shlp.
    771
    772
      DATA:
    773
      lt_html TYPE it_string,
    774
      l_shlpname TYPE shlpname,
    775
      ls_dd30v TYPE dd30v,
    776
      ls_dd30v_n TYPE dd30v,
    777
      lt_dd31v TYPE STANDARD TABLE OF dd31v,
    778
      lt_dd31v_n TYPE STANDARD TABLE OF dd31v,
    779
      lt_dd32p TYPE STANDARD TABLE OF dd32p,
    780
      lt_dd32p_n TYPE STANDARD TABLE OF dd32p,
    781
      lt_dd33v TYPE STANDARD TABLE OF dd33v,
    782
      lt_dd33v_n TYPE STANDARD TABLE OF dd33v,
    783
      ls_attributes TYPE st_attributes,
    784
      lt_tabstrip TYPE it_tabstrip,
    785
      ls_definition TYPE st_definition_2,
    786
      l_state TYPE dcshlpget.
    787
    788
      FIELD-SYMBOLS:
    789
      <ls_ztadir> TYPE st_ztadir,
    790
      <ls_dd07v> TYPE dd07v.
    791
    792
      PERFORM get_tabstrip
    793
        USING 'DDIC_R3TR_SHLP' space
    794
        CHANGING lt_tabstrip.
    795
    796
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    797
          WHERE pgmid = 'R3TR'
    798
          AND object = 'SHLP'
    799
          AND downloaded = abap_false.
    800
        <ls_ztadir>-downloaded = abap_true.
    801
    802
        CLEAR:
    803
        ls_attributes,
    804
        ls_definition.
    805
    806
        REFRESH:
    807
        lt_html,
    808
        lt_dd31v,
    809
        lt_dd31v_n,
    810
        lt_dd32p,
    811
        lt_dd32p_n,
    812
        lt_dd33v,
    813
        lt_dd33v_n.
    814
    815
    816
        l_shlpname = <ls_ztadir>-obj_name.
    817
        CALL FUNCTION 'DD_SHLP_GET'
    818
          EXPORTING
    819
            shlp_name    = l_shlpname
    820
            langu        = sy-langu
    821
            withtext     = abap_true
    822
            add_typeinfo = abap_true
    823
          IMPORTING
    824
            dd30v_wa_a   = ls_dd30v
    825
            dd30v_wa_n   = ls_dd30v_n
    826
            got_state    = l_state
    827
          TABLES
    828
            dd31v_tab_a  = lt_dd31v
    829
            dd31v_tab_n  = lt_dd31v_n
    830
            dd32p_tab_a  = lt_dd32p
    831
            dd32p_tab_n  = lt_dd32p_n
    832
            dd33v_tab_a  = lt_dd33v
    833
            dd33v_tab_n  = lt_dd33v_n
    834
          EXCEPTIONS
    835
            OTHERS       = 1.
    836
        IF sy-subrc <> 0.
    837
          <ls_ztadir>-subrc = sy-subrc.
    838
          CONTINUE.
    839
        ENDIF.
    840
        ls_attributes-bname = ls_dd30v-as4user.
    841
        PERFORM get_date
    842
          USING
    843
            ls_dd30v-as4date
    844
          CHANGING
    845
            ls_attributes-date_last_changed.
    846
        ls_attributes-devclass = <ls_ztadir>-devclass.
    847
        PERFORM get_devclass
    848
          USING
    849
            <ls_ztadir>-devclass
    850
          CHANGING
    851
            ls_attributes-devclass_descr.
    852
        IF ls_dd30v-ddlanguage IS INITIAL.
    853
          SELECT SINGLE masterlang FROM tadir INTO ls_dd30v-ddlanguage
    854
              WHERE pgmid = 'R3TR'
    855
              AND object = 'SHLP'
    856
              AND obj_name = l_shlpname.
    857
        ENDIF.
    858
        PERFORM get_spras
    859
          USING
    860
            ls_dd30v-ddlanguage
    861
          CHANGING
    862
            ls_attributes-laiso
    863
            ls_attributes-sptxt.
    864
        PERFORM get_user
    865
          USING
    866
            ls_dd30v-as4user
    867
          CHANGING
    868
            ls_attributes-name_text.
    869
    870
        ls_definition-selmethod = ls_dd30v-selmethod.
    871
        ls_definition-texttab = ls_dd30v-texttab.
    872
        ls_definition-dialogtype = ls_dd30v-dialogtype.
    873
        ls_definition-hotkey = ls_dd30v-hotkey.
    874
        ls_definition-selmexit = ls_dd30v-selmexit.
    875
    876
        PERFORM html_main_header
    877
          USING
    878
            tpt_ddic_shlp
    879
            txt_elementary_srch_hlp
    880
            <ls_ztadir>-obj_name
    881
            txt_active___1
    882
            txt_short_text___2
    883
            <ls_ztadir>-descript
    884
            space
    885
            lt_tabstrip
    886
            gt_link
    887
          CHANGING
    888
            lt_html.
    889
        PERFORM html_add_attributes_1
    890
          USING
    891
            ls_attributes
    892
            'ATTRIBUTES'
    893
            abap_false
    894
          CHANGING
    895
            lt_html.
    896
        PERFORM html_add_definition_2
    897
          USING
    898
            ls_definition
    899
            'SHLP_PARAM'
    900
            lt_dd32p
    901
            'DEFINITION'
    902
            abap_true
    903
          CHANGING
    904
            lt_html.
    905
        PERFORM html_main_footer
    906
          USING
    907
            lt_html.
    908
    909
        PERFORM download
    910
          USING
    911
            lt_html
    912
            <ls_ztadir>-pgmid
    913
            <ls_ztadir>-object
    914
            <ls_ztadir>-obj_name
    915
            gc_extension_htm
    916
            abap_true.
    917
      ENDLOOP.
    918
    ENDFORM.                                                    "r3tr_shlp
    919
    920
    921
    *-----------------------------------------------------------------------
    922
    * ddic_r3tr_tabl_1                               SAP-Tabellen
    923
    *                                                           (Strukturen)
    924
    *-----------------------------------------------------------------------
    925
    FORM ddic_r3tr_tabl_1.
    926
    927
      DATA:
    928
      lt_html TYPE it_string,
    929
      lt_tabstrip TYPE it_tabstrip,
    930
      ls_attributes TYPE st_attributes,
    931
      ls_deliv_maint TYPE st_deliv_maint,
    932
      ls_dd02v TYPE dd02v,
    933
      lt_dd03p TYPE STANDARD TABLE OF dd03p,
    934
      ls_dd09l TYPE dd09l,
    935
      lt_zdd03p_ext TYPE it_zdd03p_ext,
    936
      l_state TYPE dctablget,
    937
      lt_doc TYPE it_string,
    938
      lt_ddranking TYPE it_dom_value,
    939
      lt_exclass TYPE it_access,
    940
      ls_exclass TYPE st_access.
    941
    942
      FIELD-SYMBOLS:
    943
      <ls_ztadir> TYPE st_ztadir,
    944
      <ls_ddranking> TYPE st_dom_value,
    945
      <ls_tabstrip> TYPE st_tabstrip,
    946
      <l_exclass> TYPE ANY.
    947
    948
      PERFORM get_tabstrip
    949
        USING 'DDIC_R3TR_TABL_1' space
    950
        CHANGING lt_tabstrip.
    951
      PERFORM get_dom_value_texts
    952
        USING 'DDRANKING'
    953
        CHANGING lt_ddranking.
    954
      SORT lt_ddranking BY value DESCENDING.
    955
    956
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    957
          WHERE pgmid = 'R3TR'
    958
          AND object = 'TABL'
    959
          AND ( tabclass = 'INTTAB'
    960
            OR tabclass = 'VIEW'
    961
            OR tabclass = 'APPEND' )
    962
          AND downloaded = abap_false.
    963
        <ls_ztadir>-downloaded = abap_true.
    964
    965
        CLEAR:
    966
        ls_attributes.
    967
    968
        REFRESH:
    969
        lt_html,
    970
        lt_dd03p,
    971
        lt_doc,
    972
        lt_exclass.
    973
    974
        PERFORM ddic_r3tr_tabl_get
    975
          CHANGING
    976
            <ls_ztadir>
    977
            ls_dd02v
    978
            lt_dd03p
    979
            lt_zdd03p_ext
    980
            ls_dd09l.
    981
    982
        ls_attributes-bname = ls_dd02v-as4user.
    983
        PERFORM get_date
    984
          USING
    985
            ls_dd02v-as4date
    986
          CHANGING
    987
            ls_attributes-date_last_changed.
    988
        ls_attributes-devclass = <ls_ztadir>-devclass.
    989
        PERFORM get_devclass
    990
          USING
    991
            <ls_ztadir>-devclass
    992
          CHANGING
    993
            ls_attributes-devclass_descr.
    994
        PERFORM get_spras
    995
          USING
    996
            ls_dd02v-masterlang
    997
          CHANGING
    998
            ls_attributes-laiso
    999
            ls_attributes-sptxt.
    1000
        PERFORM get_user
    1001
          USING
    1002
            ls_dd02v-as4user
    1003
          CHANGING
    1004
            ls_attributes-name_text.
    1005
    1006
        ls_deliv_maint-contflag = ls_dd02v-contflag.
    1007
        PERFORM get_dom_value_text
    1008
          USING
    1009
            'CONTFLAG'
    1010
            ls_dd02v-contflag
    1011
          CHANGING
    1012
            ls_deliv_maint-contflag_text.
    1013
        PERFORM get_dom_value_text
    1014
          USING
    1015
            'MAINTFLAG'
    1016
            ls_dd02v-mainflag
    1017
          CHANGING
    1018
            ls_deliv_maint-mainflag_text.
    1019
    *enhancement category
    1020
        ASSIGN COMPONENT 'EXCLASS' OF STRUCTURE ls_dd02v TO <l_exclass>.
    1021
        IF <l_exclass> IS ASSIGNED.
    1022
          LOOP AT lt_ddranking ASSIGNING <ls_ddranking>.
    1023
            ls_exclass-ddtext = <ls_ddranking>-text.
    1024
            ls_exclass-checked = abap_false.
    1025
            IF <ls_ddranking>-value = <l_exclass>.
    1026
              ls_exclass-checked = abap_true.
    1027
            ENDIF.
    1028
            APPEND ls_exclass TO lt_exclass.
    1029
          ENDLOOP.
    1030
        ENDIF.
    1031
    *documentation
    1032
        PERFORM get_docu
    1033
          USING
    1034
            'TB'
    1035
            <ls_ztadir>-obj_name
    1036
            'E'
    1037
          CHANGING
    1038
            lt_doc.
    1039
    ***
    1040
        LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    1041
          <ls_tabstrip>-empty = abap_false.
    1042
          CASE <ls_tabstrip>-id.
    1043
            WHEN 'DOC'.
    1044
              IF lt_doc IS INITIAL.
    1045
                <ls_tabstrip>-empty = abap_true.
    1046
              ENDIF.
    1047
            WHEN 'EXCLASS'.
    1048
              IF lt_exclass IS INITIAL.
    1049
                <ls_tabstrip>-hidden = abap_true.
    1050
              ENDIF.
    1051
          ENDCASE.
    1052
        ENDLOOP.
    1053
    *HTML header
    1054
        PERFORM html_main_header
    1055
          USING
    1056
            tpt_ddic_stru
    1057
            txt_structure
    1058
            <ls_ztadir>-obj_name
    1059
            txt_active___1
    1060
            txt_short_text___2
    1061
            <ls_ztadir>-descript
    1062
            space
    1063
            lt_tabstrip
    1064
            gt_link
    1065
          CHANGING
    1066
            lt_html.
    1067
    *HTML enhancement category
    1068
        IF NOT lt_exclass IS INITIAL.
    1069
          PERFORM html_add_box_radiobuttons
    1070
            USING
    1071
              txt_enhancement_category_for_s
    1072
              'EXCLASS'
    1073
              lt_exclass
    1074
              'EXCLASS'
    1075
              abap_false
    1076
            CHANGING
    1077
              lt_html.
    1078
        ENDIF.
    1079
    *HTML documentation
    1080
        IF NOT lt_doc IS INITIAL
    1081
        OR g_empty_tab = gc_empty_tab_display.
    1082
          PERFORM html_add_doc
    1083
            USING
    1084
              lt_doc
    1085
              'DOC'
    1086
              abap_false
    1087
            CHANGING
    1088
              lt_html.
    1089
        ENDIF.
    1090
    *HTML attributes
    1091
        PERFORM html_add_attributes_1
    1092
          USING
    1093
            ls_attributes
    1094
            'ATTRIBUTES'
    1095
            abap_false
    1096
          CHANGING
    1097
            lt_html.
    1098
    *HTML components
    1099
        PERFORM html_add_table
    1100
          USING
    1101
            'TABL1COMPO'
    1102
            lt_dd03p
    1103
            lt_zdd03p_ext
    1104
            'COMPONENTS'
    1105
            abap_true
    1106
          CHANGING
    1107
            lt_html.
    1108
    *HTML entry help check
    1109
        PERFORM html_add_table
    1110
          USING
    1111
            'TABL1ENTRY'
    1112
            lt_dd03p
    1113
            lt_zdd03p_ext
    1114
            'ENTRY_HELP_CHECK'
    1115
            abap_false
    1116
          CHANGING
    1117
            lt_html.
    1118
    *HTML curr quant fields
    1119
        PERFORM html_add_table
    1120
          USING
    1121
            'TABL1CURRQ'
    1122
            lt_dd03p
    1123
            lt_zdd03p_ext
    1124
            'CURR_QUANT_FIELDS'
    1125
            abap_false
    1126
          CHANGING
    1127
            lt_html.
    1128
    *HTML footer
    1129
        PERFORM html_main_footer
    1130
          USING
    1131
            lt_html.
    1132
    *
    1133
        PERFORM download
    1134
          USING
    1135
            lt_html
    1136
            <ls_ztadir>-pgmid
    1137
            <ls_ztadir>-object
    1138
            <ls_ztadir>-obj_name
    1139
            gc_extension_htm
    1140
            abap_true.
    1141
      ENDLOOP.
    1142
    ENDFORM.                    "r3tr_tabl_1
    1143
    1144
    1145
    *-----------------------------------------------------------------------
    1146
    * ddic_r3tr_tabl_2                               SAP-Tabellen
    1147
    *                                                    (Datenbanktabellen)
    1148
    *-----------------------------------------------------------------------
    1149
    FORM ddic_r3tr_tabl_2.
    1150
    1151
      DATA:
    1152
      lt_html TYPE it_string,
    1153
      lt_tabstrip TYPE it_tabstrip,
    1154
      l_name_value TYPE string,
    1155
      ls_attributes TYPE st_attributes,
    1156
      ls_deliv_maint TYPE st_deliv_maint,
    1157
      lt_access TYPE it_access,
    1158
      ls_dd02v TYPE dd02v,
    1159
      lt_dd03p TYPE STANDARD TABLE OF dd03p,
    1160
      ls_dd09l TYPE dd09l,
    1161
      lt_zdd03p_ext TYPE it_zdd03p_ext,
    1162
      l_state TYPE dctablget,
    1163
      lt_doc TYPE it_string,
    1164
      lt_ddranking TYPE it_dom_value,
    1165
      lt_exclass TYPE it_access,
    1166
      ls_exclass TYPE st_access,
    1167
      l_texttabname TYPE tabname,
    1168
      l_text_obj_name TYPE sobj_name,
    1169
      l_text_devclass TYPE devclass,
    1170
      lt_link TYPE it_link,
    1171
      ls_link TYPE st_link,
    1172
      lt_csv TYPE it_string,
    1173
      lt_xml TYPE it_string,
    1174
      lt_ts_params TYPE it_textinput,
    1175
      lt_ts_buffer TYPE it_access,
    1176
      lt_ts_buffer_type_l TYPE it_textinput,
    1177
      lt_ts_buffer_type_r TYPE it_textinput,
    1178
      lt_ts_bottom TYPE it_textinput,
    1179
      ls_textinput TYPE st_textinput,
    1180
      ls_access TYPE st_access,
    1181
      l_ddtext TYPE ddtext,
    1182
      lt_dom_value TYPE it_dom_value,
    1183
      lt_tmg_tech_details TYPE it_textinput,
    1184
      ls_tddat TYPE tddat,
    1185
      ls_tbrgt TYPE tbrgt,
    1186
      ls_tvdir TYPE tvdir,
    1187
      ls_objh TYPE objh,
    1188
      l_compare_flag TYPE string,
    1189
      lt_str TYPE it_string.
    1190
    1191
    1192
      FIELD-SYMBOLS:
    1193
      <ls_ztadir> TYPE st_ztadir,
    1194
      <ls_ddranking> TYPE st_dom_value,
    1195
      <ls_tabstrip> TYPE st_tabstrip,
    1196
      <l_exclass> TYPE ANY,
    1197
      <ls_dom_value> TYPE st_dom_value.
    1198
    1199
      PERFORM get_tabstrip
    1200
        USING 'DDIC_R3TR_TABL_2' space
    1201
        CHANGING lt_tabstrip.
    1202
      PERFORM get_dom_value_texts
    1203
        USING 'DDRANKING'
    1204
        CHANGING lt_ddranking.
    1205
      SORT lt_ddranking BY value DESCENDING.
    1206
    1207
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    1208
          WHERE pgmid = 'R3TR'
    1209
          AND object = 'TABL'
    1210
          AND ( tabclass = 'CLUSTER'
    1211
            OR tabclass = 'POOL'
    1212
            OR tabclass = 'TRANSP' )
    1213
          AND downloaded = abap_false.
    1214
        <ls_ztadir>-downloaded = abap_true.
    1215
    1216
        CLEAR:
    1217
        ls_attributes,
    1218
        l_state,
    1219
        l_texttabname,
    1220
        l_text_obj_name,
    1221
        l_text_devclass,
    1222
        ls_textinput,
    1223
        l_ddtext,
    1224
        ls_tddat,
    1225
        ls_tbrgt,
    1226
        ls_tvdir,
    1227
        ls_objh,
    1228
        l_compare_flag.
    1229
    1230
        REFRESH:
    1231
        lt_html,
    1232
        lt_doc,
    1233
        lt_exclass,
    1234
        lt_link,
    1235
        lt_csv,
    1236
        lt_xml,
    1237
        lt_ts_params,
    1238
        lt_ts_buffer,
    1239
        lt_ts_buffer_type_l,
    1240
        lt_ts_buffer_type_r,
    1241
        lt_ts_bottom,
    1242
        lt_tmg_tech_details.
    1243
    1244
        PERFORM ddic_r3tr_tabl_get
    1245
          CHANGING
    1246
            <ls_ztadir>
    1247
            ls_dd02v
    1248
            lt_dd03p
    1249
            lt_zdd03p_ext
    1250
            ls_dd09l.
    1251
    1252
        l_tabname = <ls_ztadir>-obj_name.
    1253
    1254
    *attributes
    1255
        ls_attributes-bname = ls_dd02v-as4user.
    1256
        PERFORM get_date
    1257
          USING
    1258
            ls_dd02v-as4date
    1259
          CHANGING
    1260
            ls_attributes-date_last_changed.
    1261
        ls_attributes-devclass = <ls_ztadir>-devclass.
    1262
        PERFORM get_devclass
    1263
          USING
    1264
            <ls_ztadir>-devclass
    1265
          CHANGING
    1266
            ls_attributes-devclass_descr.
    1267
        PERFORM get_spras
    1268
          USING
    1269
            ls_dd02v-masterlang
    1270
          CHANGING
    1271
            ls_attributes-laiso
    1272
            ls_attributes-sptxt.
    1273
        PERFORM get_user
    1274
          USING
    1275
            ls_dd02v-as4user
    1276
          CHANGING
    1277
            ls_attributes-name_text.
    1278
    *deliv maint
    1279
        ls_deliv_maint-sqltab = ls_dd02v-sqltab.
    1280
        ls_deliv_maint-display_cont = abap_true.
    1281
        ls_deliv_maint-contflag = ls_dd02v-contflag.
    1282
        PERFORM get_dom_value_text
    1283
          USING
    1284
            'CONTFLAG'
    1285
            ls_dd02v-contflag
    1286
          CHANGING
    1287
            ls_deliv_maint-contflag_text.
    1288
        ls_deliv_maint-display_main = abap_true.
    1289
        PERFORM get_dom_value_text
    1290
          USING
    1291
            'MAINTFLAG'
    1292
            ls_dd02v-mainflag
    1293
          CHANGING
    1294
            ls_deliv_maint-mainflag_text.
    1295
    *technical settings
    1296
    *   logical storage parameters
    1297
        CLEAR ls_textinput.
    1298
        ls_textinput-name = txt_data_class.
    1299
        ls_textinput-value = ls_dd09l-tabart.
    1300
        SELECT SINGLE darttext FROM dartt INTO l_ddtext
    1301
          WHERE tabart = ls_dd09l-tabart
    1302
          AND ddlangu = sy-langu.
    1303
        ls_textinput-description = l_ddtext.
    1304
        ls_textinput-input = abap_true.
    1305
        APPEND ls_textinput TO lt_ts_params.
    1306
        CLEAR ls_textinput.
    1307
        ls_textinput-name = txt_size_category.
    1308
        ls_textinput-value = ls_dd09l-tabkat.
    1309
        ls_textinput-input = abap_true.
    1310
        APPEND ls_textinput TO lt_ts_params.
    1311
    *   buffering
    1312
        PERFORM get_dom_value_texts
    1313
          USING 'BUFALLOW'
    1314
          CHANGING lt_dom_value.
    1315
        LOOP AT lt_dom_value ASSIGNING <ls_dom_value>.
    1316
          CLEAR ls_access.
    1317
          ls_access-ddtext = <ls_dom_value>-text.
    1318
          IF <ls_dom_value>-value = ls_dd09l-bufallow.
    1319
            ls_access-checked = abap_true.
    1320
          ENDIF.
    1321
          APPEND ls_access TO lt_ts_buffer.
    1322
        ENDLOOP.
    1323
    *   buffering type
    1324
        CLEAR ls_textinput.
    1325
        ls_textinput-name = txt_single_records_buff.
    1326
        IF ls_dd09l-pufferung = 'P'.
    1327
          ls_textinput-value = abap_true.
    1328
        ENDIF.
    1329
        ls_textinput-flag = abap_true.
    1330
        APPEND ls_textinput TO lt_ts_buffer_type_l.
    1331
        CLEAR ls_textinput.
    1332
        ls_textinput-name = txt_generic_area_buffered.
    1333
        IF ls_dd09l-pufferung = 'G'.
    1334
          ls_textinput-value = abap_true.
    1335
        ENDIF.
    1336
        ls_textinput-flag = abap_true.
    1337
        APPEND ls_textinput TO lt_ts_buffer_type_l.
    1338
        CLEAR ls_textinput.
    1339
        ls_textinput-name = txt_fully_buffered.
    1340
        IF ls_dd09l-pufferung = 'X'.
    1341
          ls_textinput-value = abap_true.
    1342
        ENDIF.
    1343
        ls_textinput-flag = abap_true.
    1344
        APPEND ls_textinput TO lt_ts_buffer_type_l.
    1345
        CLEAR ls_textinput.
    1346
        ls_textinput-space = abap_true.
    1347
        APPEND ls_textinput TO lt_ts_buffer_type_r.
    1348
        CLEAR ls_textinput.
    1349
        ls_textinput-name = txt_no_of_key_fields.
    1350
        PERFORM get_unpacked
    1351
          USING ls_dd09l-schfeldanz
    1352
          CHANGING ls_textinput-value.
    1353
        ls_textinput-input = abap_true.
    1354
        APPEND ls_textinput TO lt_ts_buffer_type_r.
    1355
        CLEAR ls_textinput.
    1356
        ls_textinput-space = abap_true.
    1357
        APPEND ls_textinput TO lt_ts_buffer_type_r.
    1358
    *   bottom
    1359
        CLEAR ls_textinput.
    1360
        ls_textinput-name = txt_log_data_changes.
    1361
        ls_textinput-value = ls_dd09l-protokoll.
    1362
        ls_textinput-flag = abap_true.
    1363
        APPEND ls_textinput TO lt_ts_bottom.
    1364
    *enhancement category
    1365
        ASSIGN COMPONENT 'EXCLASS' OF STRUCTURE ls_dd02v TO <l_exclass>.
    1366
        IF <l_exclass> IS ASSIGNED.
    1367
          LOOP AT lt_ddranking ASSIGNING <ls_ddranking>.
    1368
            ls_exclass-ddtext = <ls_ddranking>-text.
    1369
            ls_exclass-checked = abap_false.
    1370
            IF <ls_ddranking>-value = <l_exclass>.
    1371
              ls_exclass-checked = abap_true.
    1372
            ENDIF.
    1373
            APPEND ls_exclass TO lt_exclass.
    1374
          ENDLOOP.
    1375
        ENDIF.
    1376
    *Table Maintenance Generator
    1377
        SELECT SINGLE * FROM tvdir INTO ls_tvdir
    1378
            WHERE tabname = l_tabname.
    1379
        SELECT SINGLE * FROM objh INTO ls_objh
    1380
            WHERE objectname = l_tabname
    1381
            AND objecttype = 'S'.
    1382
    *   technical dialog details
    1383
        SELECT SINGLE * FROM tddat INTO ls_tddat
    1384
            WHERE tabname = l_tabname.
    1385
        SELECT SINGLE * FROM tbrgt INTO ls_tbrgt
    1386
            WHERE brgru = ls_tddat-cclass
    1387
            AND spras = sy-langu.
    1388
    *
    1389
        CLEAR ls_textinput.
    1390
        ls_textinput-name = txt_authorization_group.
    1391
        ls_textinput-value = ls_tddat-cclass.
    1392
        PERFORM encode_html CHANGING ls_textinput-value.
    1393
        ls_textinput-input = abap_true.
    1394
        ls_textinput-description = ls_tbrgt-bezei.
    1395
        PERFORM encode_html CHANGING ls_textinput-description.
    1396
        APPEND ls_textinput TO lt_tmg_tech_details.
    1397
    *
    1398
        CLEAR ls_textinput.
    1399
        ls_textinput-name = txt_authorization_object___1.
    1400
        ls_textinput-value = ls_tbrgt-brobj.
    1401
        APPEND ls_textinput TO lt_tmg_tech_details.
    1402
    *
    1403
        CLEAR ls_textinput.
    1404
        ls_textinput-name = txt_function_group.
    1405
        ls_textinput-value = ls_tvdir-area.
    1406
        ls_textinput-input = abap_true.
    1407
        APPEND ls_textinput TO lt_tmg_tech_details.
    1408
    *
    1409
        CLEAR ls_textinput.
    1410
        ls_textinput-name = txt_package.
    1411
        ls_textinput-value = ls_tvdir-devclass.
    1412
        ls_textinput-input = abap_true.
    1413
        APPEND ls_textinput TO lt_tmg_tech_details.
    1414
    *   dialog data transport details
    1415
        PERFORM get_dom_value_text
    1416
          USING 'OBJIMP' ls_objh-importable
    1417
          CHANGING l_compare_flag.
    1418
    *Table Documentation
    1419
        PERFORM get_docu
    1420
          USING
    1421
            'TB'
    1422
            <ls_ztadir>-obj_name
    1423
            'E'
    1424
          CHANGING
    1425
            lt_doc.
    1426
    *Text table
    1427
        CLEAR ls_link.
    1428
        CALL FUNCTION 'TABLE_GET_TEXTTABLE'
    1429
          EXPORTING
    1430
            checktable = l_tabname
    1431
          IMPORTING
    1432
            tabname    = l_texttabname
    1433
          EXCEPTIONS
    1434
            OTHERS     = 1.
    1435
        IF sy-subrc = 0.
    1436
          l_text_obj_name = l_texttabname.
    1437
          SELECT SINGLE devclass FROM tadir INTO l_text_devclass
    1438
              WHERE pgmid = <ls_ztadir>-pgmid
    1439
              AND object = <ls_ztadir>-object
    1440
              AND obj_name = l_text_obj_name.
    1441
          IF l_text_devclass = g_pack.
    1442
            CONCATENATE l_texttabname '.' gc_extension_htm
    1443
                INTO ls_link-href.
    1444
            ls_link-onclick = 'window.location=this.href'.
    1445
          ENDIF.
    1446
          ls_link-descript = txt_text_table.
    1447
          ls_link-title = l_texttabname.
    1448
          APPEND ls_link TO lt_link.
    1449
        ENDIF.
    1450
    *Content
    1451
        CLEAR ls_link.
    1452
        READ TABLE gt_tadir TRANSPORTING NO FIELDS
    1453
          WITH KEY obj_name = <ls_ztadir>-obj_name.
    1454
        IF sy-subrc = 0.
    1455
    *  csv
    1456
          IF g_add_db_format_csv = abap_true.
    1457
            PERFORM data2csv
    1458
              USING l_tabname
    1459
              CHANGING lt_csv.
    1460
            PERFORM download
    1461
              USING
    1462
                lt_csv
    1463
                <ls_ztadir>-pgmid
    1464
                <ls_ztadir>-object
    1465
                <ls_ztadir>-obj_name
    1466
                gc_extension_csv
    1467
                abap_false.
    1468
            ls_link-href = <ls_ztadir>-obj_name.
    1469
            SPLIT ls_link-href AT '/' INTO TABLE lt_str.
    1470
            LOOP AT lt_str INTO ls_link-href.
    1471
            ENDLOOP.
    1472
            CONCATENATE ls_link-href '.' gc_extension_csv
    1473
              INTO ls_link-href.
    1474
            ls_link-onclick = 'window.open(this.href)'.
    1475
            ls_link-descript = gc_extension_csv.
    1476
            APPEND ls_link TO lt_link.
    1477
          ENDIF.
    1478
    *  xml
    1479
          IF g_add_db_format_xml = abap_true.
    1480
            PERFORM data2xml
    1481
              USING l_tabname
    1482
              CHANGING lt_xml.
    1483
            PERFORM download
    1484
              USING
    1485
                lt_xml
    1486
                <ls_ztadir>-pgmid
    1487
                <ls_ztadir>-object
    1488
                <ls_ztadir>-obj_name
    1489
                gc_extension_xml
    1490
                abap_false.
    1491
            ls_link-href = <ls_ztadir>-obj_name.
    1492
            SPLIT ls_link-href AT '/' INTO TABLE lt_str.
    1493
            LOOP AT lt_str INTO ls_link-href.
    1494
            ENDLOOP.
    1495
            CONCATENATE ls_link-href '.' gc_extension_xml
    1496
              INTO ls_link-href.
    1497
            ls_link-onclick = 'window.open(this.href)'.
    1498
            ls_link-descript = gc_extension_xml.
    1499
            APPEND ls_link TO lt_link.
    1500
          ENDIF.
    1501
        ENDIF.
    1502
    ***
    1503
        LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    1504
          <ls_tabstrip>-empty = abap_false.
    1505
          CASE <ls_tabstrip>-id.
    1506
            WHEN 'DOC'.
    1507
              IF lt_doc IS INITIAL.
    1508
                <ls_tabstrip>-empty = abap_true.
    1509
              ENDIF.
    1510
            WHEN 'EXCLASS'.
    1511
              IF lt_exclass IS INITIAL.
    1512
                <ls_tabstrip>-hidden = abap_true.
    1513
              ENDIF.
    1514
          ENDCASE.
    1515
        ENDLOOP.
    1516
        CASE <ls_ztadir>-tabclass.
    1517
          WHEN 'CLUSTER'.
    1518
            l_name_value = txt_cluster_table.
    1519
          WHEN 'POOL'.
    1520
            l_name_value = txt_pooled_table.
    1521
          WHEN 'TRANSP'.
    1522
            l_name_value = txt_transp_table.
    1523
          WHEN OTHERS.
    1524
            l_name_value = txt_table.
    1525
        ENDCASE.
    1526
    *HTML header
    1527
        PERFORM html_main_header
    1528
          USING
    1529
            tpt_ddic_tabl
    1530
            l_name_value
    1531
            <ls_ztadir>-obj_name
    1532
            txt_active___1
    1533
            txt_short_text___2
    1534
            <ls_ztadir>-descript
    1535
            space
    1536
            lt_tabstrip
    1537
            lt_link
    1538
          CHANGING
    1539
            lt_html.
    1540
    *HTML technical settings
    1541
        PERFORM html_add_tech_settings
    1542
          USING
    1543
            txt_logical_storage_parameters
    1544
            lt_ts_params
    1545
            txt_buffering
    1546
            lt_ts_buffer
    1547
            txt_buffering_type
    1548
            lt_ts_buffer_type_l
    1549
            lt_ts_buffer_type_r
    1550
            lt_ts_bottom
    1551
            'TECH_SETTINGS'
    1552
            abap_false
    1553
          CHANGING
    1554
            lt_html.
    1555
    *HTML enhancement category
    1556
        IF NOT lt_exclass IS INITIAL.
    1557
          PERFORM html_add_box_radiobuttons
    1558
            USING
    1559
              txt_enhancement_category_for_s
    1560
              'EXCLASS'
    1561
              lt_exclass
    1562
              'EXCLASS'
    1563
              abap_false
    1564
            CHANGING
    1565
              lt_html.
    1566
        ENDIF.
    1567
    *HTML table maintenance generator
    1568
        PERFORM html_add_tablemaintgenerator
    1569
          USING
    1570
            txt_technical_dialog_details
    1571
            lt_tmg_tech_details
    1572
            txt_maintenance_screens
    1573
            ls_tvdir-type
    1574
            ls_tvdir-liste
    1575
            ls_tvdir-detail
    1576
            txt_dialog_data_transport_deta
    1577
            ls_tvdir-flag
    1578
            l_compare_flag
    1579
            'TABLE_MAINT_GEN'
    1580
            abap_false
    1581
          CHANGING
    1582
            lt_html.
    1583
    *HTML documentation
    1584
        IF NOT lt_doc IS INITIAL
    1585
        OR g_empty_tab = gc_empty_tab_display.
    1586
          PERFORM html_add_doc
    1587
            USING
    1588
              lt_doc
    1589
              'DOC'
    1590
              abap_false
    1591
            CHANGING
    1592
              lt_html.
    1593
        ENDIF.
    1594
    *HTML attributes
    1595
        PERFORM html_add_attributes_1
    1596
          USING
    1597
            ls_attributes
    1598
            'ATTRIBUTES'
    1599
            abap_false
    1600
          CHANGING
    1601
            lt_html.
    1602
        PERFORM html_add_deliv_maint
    1603
          USING
    1604
            ls_deliv_maint
    1605
            lt_access
    1606
            'DELIVMAINT'
    1607
            abap_false
    1608
          CHANGING
    1609
            lt_html.
    1610
    *HTML fields
    1611
        PERFORM html_add_table
    1612
          USING
    1613
            'TABL2FIELD'
    1614
            lt_dd03p
    1615
            lt_zdd03p_ext
    1616
            'FIELDS'
    1617
            abap_true
    1618
          CHANGING
    1619
            lt_html.
    1620
    *HTML entry help check
    1621
        PERFORM html_add_table
    1622
          USING
    1623
            'TABL2ENTRY'
    1624
            lt_dd03p
    1625
            lt_zdd03p_ext
    1626
            'ENTRY_HELP_CHECK'
    1627
            abap_false
    1628
          CHANGING
    1629
            lt_html.
    1630
    *HTML curr quant fields
    1631
        PERFORM html_add_table
    1632
          USING
    1633
            'TABL2CURRQ'
    1634
            lt_dd03p
    1635
            lt_zdd03p_ext
    1636
            'CURR_QUANT_FIELDS'
    1637
            abap_false
    1638
          CHANGING
    1639
            lt_html.
    1640
    *HTML footer
    1641
        PERFORM html_main_footer
    1642
          USING
    1643
            lt_html.
    1644
        PERFORM download
    1645
          USING
    1646
            lt_html
    1647
            <ls_ztadir>-pgmid
    1648
            <ls_ztadir>-object
    1649
            <ls_ztadir>-obj_name
    1650
            gc_extension_htm
    1651
            abap_true.
    1652
      ENDLOOP.
    1653
    ENDFORM.                    "r3tr_tabl_2
    1654
    1655
    1656
    *-----------------------------------------------------------------------
    1657
    * ddic_r3tr_tabl_get                             SAP-Tabellen
    1658
    *-----------------------------------------------------------------------
    1659
    FORM ddic_r3tr_tabl_get
    1660
      CHANGING
    1661
        cs_ztadir TYPE st_ztadir
    1662
        cs_dd02v TYPE dd02v
    1663
        ct_dd03p TYPE dd03ttyp
    1664
        ct_zdd03p_ext TYPE it_zdd03p_ext
    1665
        cs_dd09l TYPE dd09l.
    1666
    1667
    1668
      CLEAR:
    1669
      cs_dd02v,
    1670
      cs_dd09l.
    1671
    1672
      REFRESH:
    1673
      ct_dd03p,
    1674
      ct_zdd03p_ext.
    1675
    1676
      DATA:
    1677
      l_strukname TYPE strukname,
    1678
      ls_dd02v_n TYPE dd02v,
    1679
      lt_dd03p_n TYPE STANDARD TABLE OF dd03p,
    1680
      lt_dd05m TYPE STANDARD TABLE OF dd05m,
    1681
      lt_dd05m_n TYPE STANDARD TABLE OF dd05m,
    1682
      lt_dd08v TYPE STANDARD TABLE OF dd08v,
    1683
      lt_dd08v_n TYPE STANDARD TABLE OF dd08v,
    1684
      ls_dd09v_n TYPE dd09v,
    1685
      lt_dd12v TYPE STANDARD TABLE OF dd12v,
    1686
      lt_dd12v_n TYPE STANDARD TABLE OF dd12v,
    1687
      lt_dd17v TYPE STANDARD TABLE OF dd17v,
    1688
      lt_dd17v_n TYPE STANDARD TABLE OF dd17v,
    1689
      lt_dd35v TYPE STANDARD TABLE OF dd35v,
    1690
      lt_dd35v_n TYPE STANDARD TABLE OF dd35v,
    1691
      lt_dd36m TYPE STANDARD TABLE OF dd36m,
    1692
      lt_dd36m_n TYPE STANDARD TABLE OF dd36m,
    1693
      ls_zdd03p_ext TYPE st_zdd03p_ext,
    1694
      l_state TYPE dctablget.
    1695
    1696
      FIELD-SYMBOLS:
    1697
      <ls_dd03p> TYPE dd03p.
    1698
    1699
    1700
      l_strukname = cs_ztadir-obj_name.
    1701
      CALL FUNCTION 'DD_TABL_GET'
    1702
        EXPORTING
    1703
          tabl_name    = l_strukname
    1704
          withtext     = abap_true
    1705
          add_typeinfo = abap_true
    1706
        IMPORTING
    1707
          dd02v_wa_a   = cs_dd02v
    1708
          dd02v_wa_n   = ls_dd02v_n
    1709
          dd09l_wa_a   = cs_dd09l
    1710
          dd09l_wa_n   = ls_dd09v_n
    1711
          got_state    = l_state
    1712
        TABLES
    1713
          dd03p_tab_a  = ct_dd03p
    1714
          dd03p_tab_n  = lt_dd03p_n
    1715
          dd05m_tab_a  = lt_dd05m
    1716
          dd05m_tab_n  = lt_dd05m_n
    1717
          dd08v_tab_a  = lt_dd08v
    1718
          dd08v_tab_n  = lt_dd08v_n
    1719
          dd12v_tab_a  = lt_dd12v
    1720
          dd12v_tab_n  = lt_dd12v_n
    1721
          dd17v_tab_a  = lt_dd17v
    1722
          dd17v_tab_n  = lt_dd17v_n
    1723
          dd35v_tab_a  = lt_dd35v
    1724
          dd35v_tab_n  = lt_dd35v_n
    1725
          dd36m_tab_a  = lt_dd36m
    1726
          dd36m_tab_n  = lt_dd36m_n
    1727
        EXCEPTIONS
    1728
          OTHERS       = 1.
    1729
      IF sy-subrc <> 0.
    1730
        cs_ztadir-subrc = sy-subrc.
    1731
        RETURN.
    1732
      ENDIF.
    1733
    1734
      IF cs_dd02v-masterlang IS INITIAL.
    1735
        SELECT SINGLE masterlang FROM tadir INTO cs_dd02v-masterlang
    1736
            WHERE pgmid = 'R3TR'
    1737
            AND object = 'TABL'
    1738
            AND obj_name = l_strukname.
    1739
      ENDIF.
    1740
    1741
      LOOP AT ct_dd03p ASSIGNING <ls_dd03p>.
    1742
        IF <ls_dd03p>-fieldname = '.INCLU--AP'.
    1743
          <ls_dd03p>-fieldname = '.APPEND'.
    1744
        ENDIF.
    1745
        IF <ls_dd03p>-rollname IS INITIAL
    1746
        AND NOT <ls_dd03p>-precfield IS INITIAL.
    1747
          SELECT SINGLE tabname FROM dd02l INTO <ls_dd03p>-rollname
    1748
            WHERE tabname = <ls_dd03p>-precfield
    1749
            AND as4local = 'A'.
    1750
          IF sy-subrc = 0.
    1751
            <ls_dd03p>-datatype = 'STRU'.
    1752
          ELSE.
    1753
            SELECT SINGLE typename FROM dd40l INTO <ls_dd03p>-rollname
    1754
              WHERE typename = <ls_dd03p>-precfield
    1755
              AND as4local = 'A'.
    1756
            IF sy-subrc = 0.
    1757
              <ls_dd03p>-datatype = 'TTYP'.
    1758
            ENDIF.
    1759
          ENDIF.
    1760
        ENDIF.
    1761
    1762
        CLEAR ls_zdd03p_ext.
    1763
        CASE <ls_dd03p>-shlporigin.
    1764
          WHEN 'F'.
    1765
            ls_zdd03p_ext-shlporigin_f = abap_true.
    1766
          WHEN 'P'.
    1767
            ls_zdd03p_ext-shlporigin_p = abap_true.
    1768
        ENDCASE.
    1769
        IF NOT <ls_dd03p>-shlporigin IS INITIAL.
    1770
          PERFORM get_dom_value_text
    1771
            USING
    1772
              'SHLPORIGIN'
    1773
              <ls_dd03p>-shlporigin
    1774
            CHANGING
    1775
              ls_zdd03p_ext-shlporigin_ddtext.
    1776
        ENDIF.
    1777
        APPEND ls_zdd03p_ext TO ct_zdd03p_ext.
    1778
      ENDLOOP.
    1779
    ENDFORM.                    "r3tr_tabl_get
    1780
    1781
    1782
    *-----------------------------------------------------------------------
    1783
    * ddic_r3tr_ttyp                                 Tabellentypen
    1784
    *-----------------------------------------------------------------------
    1785
    FORM ddic_r3tr_ttyp.
    1786
    1787
      DATA:
    1788
      lt_html TYPE it_string,
    1789
      lt_tabstrip TYPE it_tabstrip,
    1790
      l_typename TYPE typename,
    1791
      lt_dom_value_accessmode TYPE it_dom_value,
    1792
      lt_dom_value_keydef TYPE it_dom_value,
    1793
      lt_dom_value_keykind TYPE it_dom_value,
    1794
      ls_access TYPE st_access,
    1795
      ls_attributes TYPE st_attributes,
    1796
      ls_line_type TYPE st_line_type,
    1797
      ls_init_access TYPE st_init_access,
    1798
      ls_key TYPE st_key,
    1799
      lt_accessmode TYPE it_access,
    1800
      lt_keykind TYPE it_access,
    1801
      lt_keydef TYPE it_access,
    1802
      ls_dd40v TYPE dd40v,
    1803
      ls_dd40v_n TYPE dd40v,
    1804
      ls_dd42v TYPE dd42v,
    1805
      lt_dd42v TYPE STANDARD TABLE OF dd42v,
    1806
      lt_dd42v_n TYPE STANDARD TABLE OF dd42v,
    1807
      l_state TYPE dcttypget,
    1808
      l_ttypkind TYPE c.
    1809
    1810
      FIELD-SYMBOLS:
    1811
      <l_datatype> TYPE ANY,
    1812
      <l_dataleng> TYPE ANY,
    1813
      <l_decimals> TYPE ANY,
    1814
      <l_reftype> TYPE ANY,
    1815
      <l_rowkind> TYPE ANY,
    1816
      <l_rowtype> TYPE ANY,
    1817
      <l_occurs> TYPE ANY,
    1818
      <l_range_ctyp> TYPE ANY,
    1819
      <l_ttypkind> TYPE ANY,
    1820
      <ls_ztadir> TYPE st_ztadir,
    1821
      <ls_dom_value> TYPE st_dom_value.
    1822
    1823
      PERFORM get_tabstrip
    1824
        USING 'DDIC_R3TR_TTYP' space
    1825
        CHANGING lt_tabstrip.
    1826
    1827
      PERFORM get_dom_value_texts
    1828
        USING
    1829
          'ACCESSMODE'
    1830
        CHANGING
    1831
          lt_dom_value_accessmode.
    1832
      PERFORM get_dom_value_texts
    1833
        USING
    1834
          'TTYPKEYDEF'
    1835
        CHANGING
    1836
          lt_dom_value_keydef.
    1837
      PERFORM get_dom_value_texts
    1838
        USING
    1839
          'KEYKIND'
    1840
        CHANGING
    1841
          lt_dom_value_keykind.
    1842
    1843
    1844
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    1845
          WHERE pgmid = 'R3TR'
    1846
          AND object = 'TTYP'
    1847
          AND downloaded = abap_false.
    1848
        <ls_ztadir>-downloaded = abap_true.
    1849
    1850
        CLEAR:
    1851
        ls_attributes,
    1852
        ls_line_type,
    1853
        ls_init_access,
    1854
        ls_key,
    1855
        l_ttypkind.
    1856
    1857
        REFRESH:
    1858
        lt_html,
    1859
        lt_dd42v,
    1860
        lt_dd42v_n.
    1861
    1862
        l_typename = <ls_ztadir>-obj_name.
    1863
        CALL FUNCTION 'DD_TTYP_GET'
    1864
          EXPORTING
    1865
            ttyp_name   = l_typename
    1866
            langu       = sy-langu
    1867
            withtext    = abap_true
    1868
          IMPORTING
    1869
            got_state   = l_state
    1870
            dd40v_wa_a  = ls_dd40v
    1871
            dd40v_wa_n  = ls_dd40v_n
    1872
          TABLES
    1873
            dd42v_tab_a = lt_dd42v
    1874
            dd42v_tab_n = lt_dd42v_n
    1875
          EXCEPTIONS
    1876
            OTHERS      = 1.
    1877
        IF sy-subrc <> 0.
    1878
          <ls_ztadir>-subrc = sy-subrc.
    1879
          CONTINUE.
    1880
        ENDIF.
    1881
        ASSIGN COMPONENT 'TTYPKIND' OF STRUCTURE ls_dd40v TO <l_ttypkind>.
    1882
        IF <l_ttypkind> IS ASSIGNED.
    1883
          l_ttypkind = <l_ttypkind>.
    1884
          UNASSIGN <l_ttypkind>.
    1885
        ENDIF.
    1886
    *attributes
    1887
        ls_attributes-bname = ls_dd40v-as4user.
    1888
        PERFORM get_date
    1889
          USING
    1890
            ls_dd40v-as4date
    1891
          CHANGING
    1892
            ls_attributes-date_last_changed.
    1893
        ls_attributes-devclass = <ls_ztadir>-devclass.
    1894
        PERFORM get_devclass
    1895
          USING
    1896
            <ls_ztadir>-devclass
    1897
          CHANGING
    1898
            ls_attributes-devclass_descr.
    1899
        IF ls_dd40v-ddlanguage IS INITIAL.
    1900
          SELECT SINGLE masterlang FROM tadir INTO ls_dd40v-ddlanguage
    1901
              WHERE pgmid = 'R3TR'
    1902
              AND object = 'TTYP'
    1903
              AND obj_name = l_typename.
    1904
        ENDIF.
    1905
        PERFORM get_spras
    1906
          USING
    1907
            ls_dd40v-ddlanguage
    1908
          CHANGING
    1909
            ls_attributes-laiso
    1910
            ls_attributes-sptxt.
    1911
        PERFORM get_user
    1912
          USING
    1913
            ls_dd40v-as4user
    1914
          CHANGING
    1915
            ls_attributes-name_text.
    1916
    *linetype
    1917
        ls_line_type-rowkind = ls_dd40v-rowkind.
    1918
        ASSIGN COMPONENT 'ROWKIND' OF STRUCTURE ls_dd40v TO <l_rowkind>.
    1919
        IF <l_rowkind> IS ASSIGNED.
    1920
          ls_line_type-rowkind = <l_rowkind>.
    1921
          UNASSIGN <l_rowkind>.
    1922
        ENDIF.
    1923
        ASSIGN COMPONENT 'ROWTYPE' OF STRUCTURE ls_dd40v TO <l_rowtype>.
    1924
        IF <l_rowtype> IS ASSIGNED.
    1925
          ls_line_type-rowtype = <l_rowtype>.
    1926
          UNASSIGN <l_rowtype>.
    1927
        ENDIF.
    1928
        PERFORM get_dom_value_text
    1929
          USING
    1930
            'TYPEKIND'
    1931
            ls_dd40v-rowtype
    1932
          CHANGING
    1933
            ls_line_type-rowdescr.
    1934
        ASSIGN COMPONENT 'DATATYPE' OF STRUCTURE ls_dd40v TO <l_datatype>.
    1935
        IF <l_datatype> IS ASSIGNED.
    1936
          ls_line_type-datatype = <l_datatype>.
    1937
          UNASSIGN <l_datatype>.
    1938
        ENDIF.
    1939
        ASSIGN COMPONENT 'LENG' OF STRUCTURE ls_dd40v TO <l_dataleng>.
    1940
        IF <l_dataleng> IS ASSIGNED.
    1941
          ls_line_type-dataleng = <l_dataleng>.
    1942
          UNASSIGN <l_dataleng>.
    1943
        ENDIF.
    1944
        ASSIGN COMPONENT 'DECIMALS' OF STRUCTURE ls_dd40v TO <l_decimals>.
    1945
        IF <l_decimals> IS ASSIGNED.
    1946
          ls_line_type-datadeci = <l_decimals>.
    1947
          UNASSIGN <l_decimals>.
    1948
        ENDIF.
    1949
        ls_line_type-datadeci = ls_dd40v-decimals.
    1950
        ASSIGN COMPONENT 'REFTYPE' OF STRUCTURE ls_dd40v TO <l_reftype>.
    1951
        IF <l_reftype> IS ASSIGNED.
    1952
          ls_line_type-reftype = <l_reftype>.
    1953
          PERFORM get_dom_value_text
    1954
            USING
    1955
              'DDREFTYPE'
    1956
              <l_reftype>
    1957
            CHANGING
    1958
              ls_line_type-refdescr.
    1959
          UNASSIGN <l_reftype>.
    1960
        ELSE.
    1961
          ls_line_type-reftype = '#'.  " R/3 4.6 does not know ref type
    1962
        ENDIF.
    1963
        ASSIGN COMPONENT 'RANGE_CTYP' OF STRUCTURE ls_dd40v
    1964
          TO <l_range_ctyp>.
    1965
        IF <l_range_ctyp> IS ASSIGNED.
    1966
          ls_line_type-range_ctyp = <l_range_ctyp>.
    1967
          UNASSIGN <l_range_ctyp>.
    1968
        ENDIF.
    1969
        ASSIGN COMPONENT 'CTDATATYPE' OF STRUCTURE ls_dd40v
    1970
          TO <l_datatype>.
    1971
        IF <l_datatype> IS ASSIGNED.
    1972
          ls_line_type-ctdatatype = <l_datatype>.
    1973
          UNASSIGN <l_datatype>.
    1974
        ENDIF.
    1975
        ASSIGN COMPONENT 'CTLENG' OF STRUCTURE ls_dd40v TO <l_dataleng>.
    1976
        IF <l_dataleng> IS ASSIGNED.
    1977
          ls_line_type-ctleng = <l_dataleng>.
    1978
          UNASSIGN <l_dataleng>.
    1979
        ENDIF.
    1980
        ASSIGN COMPONENT 'CTDECIMALS' OF STRUCTURE ls_dd40v
    1981
          TO <l_decimals>.
    1982
        IF <l_decimals> IS ASSIGNED.
    1983
          ls_line_type-ctdecimals = <l_decimals>.
    1984
          UNASSIGN <l_decimals>.
    1985
        ENDIF.
    1986
    *initaccess
    1987
        ASSIGN COMPONENT 'OCCURS' OF STRUCTURE ls_dd40v TO <l_occurs>.
    1988
        IF <l_occurs> IS ASSIGNED.
    1989
          ls_init_access-occurs = <l_occurs>.
    1990
          UNASSIGN <l_occurs>.
    1991
        ELSE.
    1992
          ls_init_access-unknown = abap_true.
    1993
        ENDIF.
    1994
    1995
        REFRESH lt_accessmode.
    1996
        LOOP AT lt_dom_value_accessmode ASSIGNING <ls_dom_value>.
    1997
          CLEAR ls_access.
    1998
          ls_access-ddtext = <ls_dom_value>-text.
    1999
          IF ls_dd40v-accessmode = <ls_dom_value>-value.
    2000
            ls_access-checked = abap_true.
    2001
          ENDIF.
    2002
          APPEND ls_access TO lt_accessmode.
    2003
        ENDLOOP.
    2004
    *key
    2005
        REFRESH lt_keydef.
    2006
        LOOP AT lt_dom_value_keydef ASSIGNING <ls_dom_value>.
    2007
          CLEAR ls_access.
    2008
          ls_access-ddtext = <ls_dom_value>-text.
    2009
          IF ls_dd40v-keydef = <ls_dom_value>-value.
    2010
            ls_access-checked = abap_true.
    2011
          ENDIF.
    2012
          APPEND ls_access TO lt_keydef.
    2013
        ENDLOOP.
    2014
    2015
        REFRESH lt_keykind.
    2016
        LOOP AT lt_dom_value_keykind ASSIGNING <ls_dom_value>.
    2017
          CLEAR ls_access.
    2018
          ls_access-ddtext = <ls_dom_value>-text.
    2019
          IF ls_dd40v-keykind = <ls_dom_value>-value.
    2020
            ls_access-checked = abap_true.
    2021
          ENDIF.
    2022
          APPEND ls_access TO lt_keykind.
    2023
        ENDLOOP.
    2024
    ***
    2025
        IF ls_dd40v-generic = abap_true.
    2026
          ls_line_type-info = txt_type_is_generic.
    2027
          ls_init_access-info1 = txt_type_is_generic.
    2028
          ls_key-info = txt_type_is_generic.
    2029
        ENDIF.
    2030
        IF l_ttypkind = 'R'.
    2031
          ls_init_access-info2 = txt_access_type_is_given_for_a.
    2032
          CONCATENATE
    2033
            txt_key_attribute_defined_for1
    2034
            txt_key_attribute_defined_for2
    2035
            INTO ls_key-info SEPARATED BY space.
    2036
        ENDIF.
    2037
    2038
    **************
    2039
        PERFORM html_main_header
    2040
          USING
    2041
            tpt_ddic_ttyp
    2042
            txt_table_type
    2043
            <ls_ztadir>-obj_name
    2044
            txt_active___1
    2045
            txt_short_text___2
    2046
            <ls_ztadir>-descript
    2047
            space
    2048
            lt_tabstrip
    2049
            gt_link
    2050
          CHANGING
    2051
            lt_html.
    2052
    *HTML attributes
    2053
        PERFORM html_add_attributes_1
    2054
          USING
    2055
            ls_attributes
    2056
            'ATTRIBUTES'
    2057
            abap_false
    2058
          CHANGING
    2059
            lt_html.
    2060
    *HTML line type
    2061
        IF l_ttypkind = 'R'.
    2062
          PERFORM html_add_line_type_2
    2063
            USING
    2064
              ls_line_type
    2065
              'LINETYPE'
    2066
              abap_true
    2067
            CHANGING
    2068
              lt_html.
    2069
        ELSE.
    2070
          PERFORM html_add_line_type_1
    2071
            USING
    2072
              ls_line_type
    2073
              'LINETYPE'
    2074
              abap_true
    2075
            CHANGING
    2076
              lt_html.
    2077
        ENDIF.
    2078
    *HTML init access
    2079
        PERFORM html_add_init_access
    2080
          USING
    2081
            ls_init_access
    2082
            lt_accessmode
    2083
            'INITACCESS'
    2084
            abap_false
    2085
          CHANGING
    2086
            lt_html.
    2087
    *HTML key
    2088
        PERFORM html_add_key
    2089
          USING
    2090
            ls_key
    2091
            lt_keydef
    2092
            lt_keykind
    2093
            'TTYP_DD42V'
    2094
            lt_dd42v
    2095
            'KEY'
    2096
            abap_false
    2097
          CHANGING
    2098
            lt_html.
    2099
    *
    2100
        PERFORM html_main_footer
    2101
          USING
    2102
            lt_html.
    2103
    2104
        PERFORM download
    2105
          USING
    2106
            lt_html
    2107
            <ls_ztadir>-pgmid
    2108
            <ls_ztadir>-object
    2109
            <ls_ztadir>-obj_name
    2110
            gc_extension_htm
    2111
            abap_true.
    2112
      ENDLOOP.
    2113
    ENDFORM.                                                    "r3tr_ttyp
    2114
    2115
    2116
    *-----------------------------------------------------------------------
    2117
    * ddic_r3tr_type                                 Suchhilfen
    2118
    *-----------------------------------------------------------------------
    2119
    FORM ddic_r3tr_type.
    2120
    2121
      DATA:
    2122
      lt_html TYPE it_string,
    2123
      l_progname TYPE progname,
    2124
      ls_trdir TYPE trdir,
    2125
      lt_source TYPE it_string,
    2126
      ls_attributes TYPE st_attributes,
    2127
      lt_tabstrip TYPE it_tabstrip.
    2128
    2129
      FIELD-SYMBOLS:
    2130
      <ls_ztadir> TYPE st_ztadir.
    2131
    2132
      PERFORM get_tabstrip
    2133
        USING 'DDIC_R3TR_TYPE' space
    2134
        CHANGING lt_tabstrip.
    2135
    2136
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    2137
          WHERE pgmid = 'R3TR'
    2138
          AND object = 'TYPE'
    2139
          AND downloaded = abap_false.
    2140
        <ls_ztadir>-downloaded = abap_true.
    2141
    2142
        CLEAR:
    2143
        ls_attributes.
    2144
    2145
        REFRESH:
    2146
        lt_html.
    2147
    2148
        CALL FUNCTION 'RS_TADIR_TO_PROGNAME'
    2149
          EXPORTING
    2150
            object   = 'TYPE'
    2151
            obj_name = <ls_ztadir>-obj_name
    2152
          IMPORTING
    2153
            progname = l_progname.
    2154
        SELECT SINGLE * FROM trdir
    2155
            INTO ls_trdir
    2156
            WHERE name = l_progname.
    2157
        IF sy-subrc <> 0.
    2158
          <ls_ztadir>-subrc = sy-subrc.
    2159
          CONTINUE.
    2160
        ENDIF.
    2161
        ls_attributes-bname = ls_trdir-unam.
    2162
        PERFORM get_date
    2163
          USING
    2164
            ls_trdir-udat
    2165
          CHANGING
    2166
            ls_attributes-date_last_changed.
    2167
        ls_attributes-devclass = <ls_ztadir>-devclass.
    2168
        PERFORM get_devclass
    2169
          USING
    2170
            <ls_ztadir>-devclass
    2171
          CHANGING
    2172
            ls_attributes-devclass_descr.
    2173
        IF ls_trdir-rload IS INITIAL.
    2174
          SELECT SINGLE masterlang FROM tadir INTO ls_trdir-rload
    2175
              WHERE pgmid = 'R3TR'
    2176
              AND object = 'TYPE'
    2177
              AND obj_name = <ls_ztadir>-obj_name.
    2178
        ENDIF.
    2179
        PERFORM get_spras
    2180
          USING
    2181
            ls_trdir-rload
    2182
          CHANGING
    2183
            ls_attributes-laiso
    2184
            ls_attributes-sptxt.
    2185
        PERFORM get_user
    2186
          USING
    2187
            ls_trdir-unam
    2188
          CHANGING
    2189
            ls_attributes-name_text.
    2190
        PERFORM try_read_report
    2191
          USING l_progname
    2192
          CHANGING lt_source.
    2193
    *HTML
    2194
        PERFORM html_main_header
    2195
          USING
    2196
            tpt_ddic_type
    2197
            txt_type_group
    2198
            <ls_ztadir>-obj_name
    2199
            txt_active___1
    2200
            txt_short_text___2
    2201
            <ls_ztadir>-descript
    2202
            'makeDivSize(''SOURCECODE'')'
    2203
            lt_tabstrip
    2204
            gt_link
    2205
          CHANGING
    2206
            lt_html.
    2207
        PERFORM html_add_attributes_1
    2208
          USING
    2209
            ls_attributes
    2210
            'ATTRIBUTES'
    2211
            abap_false
    2212
          CHANGING
    2213
            lt_html.
    2214
        PERFORM html_add_sourcecode
    2215
          USING
    2216
            lt_source
    2217
            <ls_ztadir>-obj_name
    2218
            space
    2219
            space
    2220
            gc_extension_txt
    2221
            'SOURCECODE'
    2222
            abap_true
    2223
          CHANGING
    2224
            lt_html.
    2225
        PERFORM html_main_footer
    2226
          USING
    2227
            lt_html.
    2228
    2229
        PERFORM download
    2230
          USING
    2231
            lt_html
    2232
            <ls_ztadir>-pgmid
    2233
            <ls_ztadir>-object
    2234
            <ls_ztadir>-obj_name
    2235
            gc_extension_htm
    2236
            abap_true.
    2237
        IF g_add_sourcecode = abap_true.
    2238
          PERFORM download
    2239
            USING
    2240
              lt_source
    2241
              <ls_ztadir>-pgmid
    2242
              <ls_ztadir>-object
    2243
              <ls_ztadir>-obj_name
    2244
              gc_extension_txt
    2245
              abap_false.
    2246
        ENDIF.
    2247
      ENDLOOP.
    2248
    ENDFORM.                                                    "r3tr_type
    2249
    2250
    2251
    *-----------------------------------------------------------------------
    2252
    * ddic_r3tr_view                                 Aggregat-Header
    2253
    *                               (Views, Matchcode-Objekte, Sperrobjekte)
    2254
    *-----------------------------------------------------------------------
    2255
    FORM ddic_r3tr_view.
    2256
    2257
      DATA:
    2258
      lt_html TYPE it_string,
    2259
      lt_tabstrip TYPE it_tabstrip,
    2260
      l_viewname TYPE viewname,
    2261
      ls_attributes TYPE st_attributes,
    2262
      ls_tabname TYPE st_tabname,
    2263
      lt_tabname TYPE it_tabname,
    2264
      ls_join_conditions TYPE st_join_conditions,
    2265
      lt_join_conditions TYPE it_join_conditions,
    2266
      lt_tables TYPE it_tables,
    2267
      ls_table TYPE st_table_structure,
    2268
      ls_deliv_maint TYPE st_deliv_maint,
    2269
      lt_dom_value_viewgrant TYPE it_dom_value,
    2270
      lt_access TYPE it_access,
    2271
      ls_access TYPE st_access,
    2272
      ls_dd09v TYPE dd09v,
    2273
      ls_dd09v_n TYPE dd09v,
    2274
      ls_dd25v TYPE dd25v,
    2275
      ls_dd25v_n TYPE dd25v,
    2276
      lt_dd26v TYPE STANDARD TABLE OF dd26v,
    2277
      lt_dd26v_n TYPE STANDARD TABLE OF dd26v,
    2278
      lt_dd27p TYPE STANDARD TABLE OF dd27p,
    2279
      lt_dd27p_n TYPE STANDARD TABLE OF dd27p,
    2280
      lt_dd28v TYPE STANDARD TABLE OF dd28v,
    2281
      lt_dd28v_n TYPE STANDARD TABLE OF dd28v,
    2282
      l_state TYPE dcviewget,
    2283
      l_id TYPE string,
    2284
      l_txt_viewclass TYPE as4text,
    2285
      lt_ts_buffer TYPE it_access,
    2286
      lt_ts_buffer_type_l TYPE it_textinput,
    2287
      lt_ts_buffer_type_r TYPE it_textinput,
    2288
      ls_textinput TYPE st_textinput,
    2289
      l_ddtext TYPE ddtext,
    2290
      lt_dom_value TYPE it_dom_value,
    2291
      lt_create TYPE it_string,
    2292
      l_filename TYPE string.
    2293
    2294
      FIELD-SYMBOLS:
    2295
      <ls_ztadir> TYPE st_ztadir,
    2296
      <ls_dom_value> TYPE st_dom_value,
    2297
      <ls_dd26v> TYPE dd26v,
    2298
      <ls_dd27p> TYPE dd27p,
    2299
      <ls_dd28v> TYPE dd28v,
    2300
      <ls_tabstrip> TYPE st_tabstrip.
    2301
    2302
      PERFORM get_dom_value_texts
    2303
        USING
    2304
          'VIEWGRANT'
    2305
        CHANGING
    2306
          lt_dom_value_viewgrant.
    2307
    2308
      LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
    2309
          WHERE pgmid = 'R3TR'
    2310
          AND object = 'VIEW'
    2311
          AND downloaded = abap_false.
    2312
        <ls_ztadir>-downloaded = abap_true.
    2313
    2314
        CLEAR:
    2315
        ls_attributes,
    2316
        l_txt_viewclass,
    2317
        ls_textinput,
    2318
        l_ddtext,
    2319
        l_filename.
    2320
    2321
        REFRESH:
    2322
        lt_html,
    2323
        lt_dd26v,
    2324
        lt_dd26v_n,
    2325
        lt_dd27p,
    2326
        lt_dd27p_n,
    2327
        lt_dd28v,
    2328
        lt_dd28v_n,
    2329
        lt_ts_buffer,
    2330
        lt_ts_buffer_type_l,
    2331
        lt_ts_buffer_type_r,
    2332
        lt_create.
    2333
    2334
        l_viewname = <ls_ztadir>-obj_name.
    2335
        CALL FUNCTION 'DD_VIEW_GET'
    2336
          EXPORTING
    2337
            view_name   = l_viewname
    2338
            langu       = sy-langu
    2339
            withtext    = abap_true
    2340
          IMPORTING
    2341
            dd25v_wa_a  = ls_dd25v
    2342
            dd25v_wa_n  = ls_dd25v_n
    2343
            dd09l_wa_a  = ls_dd09v
    2344
            dd09l_wa_n  = ls_dd09v_n
    2345
            got_state   = l_state
    2346
          TABLES
    2347
            dd26v_tab_a = lt_dd26v
    2348
            dd26v_tab_n = lt_dd26v_n
    2349
            dd27p_tab_a = lt_dd27p
    2350
            dd27p_tab_n = lt_dd27p_n
    2351
            dd28v_tab_a = lt_dd28v
    2352
            dd28v_tab_n = lt_dd28v_n
    2353
          EXCEPTIONS
    2354
            OTHERS      = 1.
    2355
        IF sy-subrc <> 0.
    2356
          <ls_ztadir>-subrc = sy-subrc.
    2357
          CONTINUE.
    2358
        ENDIF.
    2359
    *attributes
    2360
        ls_attributes-bname = ls_dd25v-as4user.
    2361
        PERFORM get_date
    2362
          USING
    2363
            ls_dd25v-as4date
    2364
          CHANGING
    2365
            ls_attributes-date_last_changed.
    2366
        ls_attributes-devclass = <ls_ztadir>-devclass.
    2367
        PERFORM get_devclass
    2368
          USING
    2369
            <ls_ztadir>-devclass
    2370
          CHANGING
    2371
            ls_attributes-devclass_descr.
    2372
        IF ls_dd25v-masterlang IS INITIAL.
    2373
          SELECT SINGLE masterlang FROM tadir INTO ls_dd25v-masterlang
    2374
              WHERE pgmid = 'R3TR'
    2375
              AND object = 'VIEW'
    2376
              AND obj_name = l_viewname.
    2377
        ENDIF.
    2378
        PERFORM get_spras
    2379
          USING
    2380
            ls_dd25v-masterlang
    2381
          CHANGING
    2382
            ls_attributes-laiso
    2383
            ls_attributes-sptxt.
    2384
        PERFORM get_user
    2385
          USING
    2386
            ls_dd25v-as4user
    2387
          CHANGING
    2388
            ls_attributes-name_text.
    2389
        IF ls_dd25v-viewclass CO 'A'.
    2390
          ls_attributes-display_appview = abap_true.
    2391
          ls_attributes-appview = ls_dd25v-roottab.
    2392
        ENDIF.
    2393
    *technical settings
    2394
        IF NOT ls_dd09v-tabname IS INITIAL.
    2395
    *     buffering
    2396
          PERFORM get_dom_value_texts
    2397
            USING 'BUFALLOW'
    2398
            CHANGING lt_dom_value.
    2399
          LOOP AT lt_dom_value ASSIGNING <ls_dom_value>.
    2400
            CLEAR ls_access.
    2401
            ls_access-ddtext = <ls_dom_value>-text.
    2402
            IF <ls_dom_value>-value = ls_dd09v-bufallow.
    2403
              ls_access-checked = abap_true.
    2404
            ENDIF.
    2405
            APPEND ls_access TO lt_ts_buffer.
    2406
          ENDLOOP.
    2407
    *     buffering type
    2408
          CLEAR ls_textinput.
    2409
          ls_textinput-name = txt_single_records_buff.
    2410
          IF ls_dd09v-pufferung = 'P'.
    2411
            ls_textinput-value = abap_true.
    2412
          ENDIF.
    2413
          ls_textinput-flag = abap_true.
    2414
          APPEND ls_textinput TO lt_ts_buffer_type_l.
    2415
          CLEAR ls_textinput.
    2416
          ls_textinput-name = txt_generic_area_buffered.
    2417
          IF ls_dd09v-pufferung = 'G'.
    2418
            ls_textinput-value = abap_true.
    2419
          ENDIF.
    2420
          ls_textinput-flag = abap_true.
    2421
          APPEND ls_textinput TO lt_ts_buffer_type_l.
    2422
          CLEAR ls_textinput.
    2423
          ls_textinput-name = txt_fully_buffered.
    2424
          IF ls_dd09v-pufferung = 'X'.
    2425
            ls_textinput-value = abap_true.
    2426
          ENDIF.
    2427
          ls_textinput-flag = abap_true.
    2428
          APPEND ls_textinput TO lt_ts_buffer_type_l.
    2429
          CLEAR ls_textinput.
    2430
          ls_textinput-space = abap_true.
    2431
          APPEND ls_textinput TO lt_ts_buffer_type_r.
    2432
          CLEAR ls_textinput.
    2433
          ls_textinput-name = txt_no_of_key_fields.
    2434
          PERFORM get_unpacked
    2435
            USING ls_dd09v-schfeldanz
    2436
            CHANGING ls_textinput-value.
    2437
          ls_textinput-input = abap_true.
    2438
          APPEND ls_textinput TO lt_ts_buffer_type_r.
    2439
          CLEAR ls_textinput.
    2440
          ls_textinput-space = abap_true.
    2441
          APPEND ls_textinput TO lt_ts_buffer_type_r.
    2442
        ENDIF.
    2443
    *CREATE Statement
    2444
        CALL FUNCTION 'DB_GET_VIEW_DEFINITION_RAW'
    2445
          EXPORTING
    2446
            viewname = l_viewname
    2447
          TABLES
    2448
            text_tab = lt_create
    2449
          EXCEPTIONS
    2450
            OTHERS   = 1.
    2451
    *tables for joining
    2452
        REFRESH lt_tabname.
    2453
    *  data
    2454
        LOOP AT lt_dd26v ASSIGNING <ls_dd26v>.
    2455
          ls_tabname-tabname = <ls_dd26v>-tabname.
    2456
          APPEND ls_tabname TO lt_tabname.
    2457
        ENDLOOP.
    2458
        SORT lt_tabname BY tabname.
    2459
        DELETE ADJACENT DUPLICATES FROM lt_tabname.
    2460
    2461
    *join conditions - data
    2462
        REFRESH lt_join_conditions.
    2463
        IF ls_dd25v-viewclass CO 'HDCV'.
    2464
    *  data
    2465
          REFRESH lt_join_conditions.
    2466
          SORT lt_dd28v BY position.
    2467
          LOOP AT lt_dd28v ASSIGNING <ls_dd28v>.
    2468
            IF <ls_dd28v>-negation = 'JL'.
    2469
              ls_join_conditions-tabname_l = <ls_dd28v>-tabname.
    2470
              ls_join_conditions-fieldname_l = <ls_dd28v>-fieldname.
    2471
              PERFORM get_gui_operator
    2472
                USING
    2473
                  <ls_dd28v>-operator
    2474
                CHANGING
    2475
                  ls_join_conditions-operator.
    2476
            ELSE.
    2477
              ls_join_conditions-tabname_r = <ls_dd28v>-tabname.
    2478
              ls_join_conditions-fieldname_r = <ls_dd28v>-fieldname.
    2479
              APPEND ls_join_conditions TO lt_join_conditions.
    2480
            ENDIF.
    2481
          ENDLOOP.
    2482
        ENDIF.
    2483
    2484
    *selection condition
    2485
        IF ls_dd25v-viewclass CO 'HDCV'.
    2486
          DELETE lt_dd28v WHERE constants = space.
    2487
        ENDIF.
    2488
    *maint status - access
    2489
        REFRESH lt_access.
    2490
        LOOP AT lt_dom_value_viewgrant ASSIGNING <ls_dom_value>.
    2491
          CLEAR ls_access.
    2492
          IF ls_dd25v-viewclass CO 'HCV'
    2493
          OR <ls_dom_value>-value NA 'MU'.
    2494
            ls_access-ddtext = <ls_dom_value>-text.
    2495
            IF ls_dd25v-viewgrant = <ls_dom_value>-value.
    2496
              ls_access-checked = abap_true.
    2497
            ENDIF.
    2498
            APPEND ls_access TO lt_access.
    2499
          ENDIF.
    2500
        ENDLOOP.
    2501
    *maint status - others
    2502
        CLEAR ls_deliv_maint.
    2503
        ls_deliv_maint-display_cont = abap_false.
    2504
        ls_deliv_maint-display_main = abap_false.
    2505
        IF ls_dd25v-viewclass CO 'CV'.
    2506
          ls_deliv_maint-display_cont = abap_true.
    2507
          ls_deliv_maint-contflag = ls_dd25v-customauth.
    2508
          PERFORM get_dom_value_text
    2509
            USING
    2510
              'CONTFLAG'
    2511
              ls_dd25v-customauth
    2512
            CHANGING
    2513
              ls_deliv_maint-contflag_text.
    2514
        ENDIF.
    2515
        IF ls_dd25v-viewclass CO 'DPCV'.
    2516
          ls_deliv_maint-display_main = abap_true.
    2517
          PERFORM get_dom_value_text
    2518
            USING
    2519
              'MAINTFLAG'
    2520
              ls_dd25v-globalflag
    2521
            CHANGING
    2522
              ls_deliv_maint-mainflag_text.
    2523
        ENDIF.
    2524
    ***Tabstrip
    2525
        PERFORM get_tabstrip
    2526
          USING 'DDIC_R3TR_VIEW' ls_dd25v-viewclass
    2527
          CHANGING lt_tabstrip.
    2528
        LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
    2529
          <ls_tabstrip>-empty = abap_false.
    2530
          CASE <ls_tabstrip>-id.
    2531
            WHEN 'CREATE'.
    2532
              IF lt_create IS INITIAL.
    2533
                <ls_tabstrip>-empty = abap_true.
    2534
              ENDIF.
    2535
            WHEN 'SELECTIONCONDITIONS'.
    2536
              IF lt_dd28v IS INITIAL.
    2537
                <ls_tabstrip>-empty = abap_true.
    2538
              ENDIF.
    2539
          ENDCASE.
    2540
        ENDLOOP.
    2541
    2542
    *HTML header
    2543
        PERFORM get_dom_value_text
    2544
          USING
    2545
            'VIEWCLASS'
    2546
            ls_dd25v-viewclass
    2547
          CHANGING
    2548
            l_txt_viewclass.
    2549
        PERFORM html_main_header
    2550
          USING
    2551
            tpt_ddic_view
    2552
            l_txt_viewclass
    2553
            <ls_ztadir>-obj_name
    2554
            txt_active___1
    2555
            txt_short_text___2
    2556
            <ls_ztadir>-descript
    2557
            space
    2558
            lt_tabstrip
    2559
            gt_link
    2560
          CHANGING
    2561
            lt_html.
    2562
    *HTML technical settings
    2563
        IF ls_dd25v-viewclass CO 'HDPSCV'.
    2564
          PERFORM html_add_box1rb_subbox2ti
    2565
            USING
    2566
              txt_buffering
    2567
              lt_ts_buffer
    2568
              txt_buffering_type
    2569
              lt_ts_buffer_type_l
    2570
              lt_ts_buffer_type_r
    2571
              'TECH_SETTINGS'
    2572
              abap_false
    2573
            CHANGING
    2574
              lt_html.
    2575
        ENDIF.
    2576
    *HTML CREATE Statement
    2577
        IF ls_dd25v-viewclass CO 'HDPSCV'.
    2578
          IF NOT lt_create IS INITIAL
    2579
          OR g_empty_tab = gc_empty_tab_display.
    2580
            CONCATENATE l_viewname '_CREATE' INTO l_filename.
    2581
            PERFORM html_add_sourcecode
    2582
              USING
    2583
                lt_create
    2584
                l_filename
    2585
                space
    2586
                space
    2587
                gc_extension_txt
    2588
                'CREATE'
    2589
                abap_false
    2590
              CHANGING
    2591
                lt_html.
    2592
            IF NOT lt_create IS INITIAL
    2593
            AND g_add_sourcecode = abap_true.
    2594
              PERFORM download
    2595
                USING
    2596
                  lt_create
    2597
                  <ls_ztadir>-pgmid
    2598
                  <ls_ztadir>-object
    2599
                  l_filename
    2600
                  gc_extension_txt
    2601
                  abap_false.
    2602
            ENDIF.
    2603
          ENDIF.
    2604
        ENDIF.
    2605
    *HTML attributes
    2606
        PERFORM html_add_attributes_1
    2607
          USING
    2608
            ls_attributes
    2609
            'ATTRIBUTES'
    2610
            abap_false
    2611
          CHANGING
    2612
            lt_html.
    2613
    *HTML table/join conditions
    2614
        IF ls_dd25v-viewclass CO 'HDCV'.
    2615
          PERFORM html_add_table2hor
    2616
            USING
    2617
              'VIEW_JOINT'
    2618
              lt_tabname
    2619
              lt_tabname
    2620
              'VIEW_JOINC'
    2621
              lt_join_conditions
    2622
              lt_join_conditions
    2623
              'TABJOINCONDITIONS'
    2624
              abap_false
    2625
            CHANGING
    2626
              lt_html.
    2627
        ENDIF.
    2628
    *HTML view fields
    2629
        PERFORM get_id
    2630
          USING 'VIEW_FIELD|' ls_dd25v-viewclass
    2631
          CHANGING l_id.
    2632
        IF ls_dd25v-viewclass CO 'HDPCV'.
    2633
          PERFORM html_add_table
    2634
            USING
    2635
              l_id
    2636
              lt_dd27p
    2637
              lt_dd27p
    2638
              'VIEWFIELDS'
    2639
              abap_true
    2640
            CHANGING
    2641
              lt_html.
    2642
        ELSEIF ls_dd25v-viewclass CO 'AS'.
    2643
          PERFORM html_add_table2hor
    2644
            USING
    2645
              'VIEW_JOINT'
    2646
              lt_tabname
    2647
              lt_tabname
    2648
              l_id
    2649
              lt_dd27p
    2650
              lt_dd27p
    2651
              'VIEWFIELDS'
    2652
              abap_true
    2653
            CHANGING
    2654
              lt_html.
    2655
        ENDIF.
    2656
    *HTML selection conditions
    2657
        IF ls_dd25v-viewclass CO 'HDCV'.
    2658
          IF NOT lt_dd28v IS INITIAL
    2659
          OR g_empty_tab = gc_empty_tab_display.
    2660
            PERFORM html_add_table
    2661
              USING
    2662
                'VIEW_SELEC'
    2663
                lt_dd28v
    2664
                lt_dd28v
    2665
                'SELECTIONCONDITIONS'
    2666
                abap_false
    2667
              CHANGING
    2668
                lt_html.
    2669
          ENDIF.
    2670
        ENDIF.
    2671
    *HTML maint status
    2672
        IF ls_dd25v-viewclass CO 'HDCV'.
    2673
          PERFORM html_add_deliv_maint
    2674
            USING
    2675
              ls_deliv_maint
    2676
              lt_access
    2677
              'DELIVMAINT'
    2678
              abap_false
    2679
            CHANGING
    2680
              lt_html.
    2681
        ENDIF.
    2682
    *HTML footer
    2683
        PERFORM html_main_footer
    2684
          USING
    2685
            lt_html.
    2686
    *download
    2687
        PERFORM download
    2688
          USING
    2689
            lt_html
    2690
            <ls_ztadir>-pgmid
    2691
            <ls_ztadir>-object
    2692
            <ls_ztadir>-obj_name
    2693
            gc_extension_htm
    2694
            abap_true.
    2695
      ENDLOOP.
    2696
    ENDFORM.                                                    "r3tr_view