Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM UPDATE_CORR_KEYTAB
3
*---------------------------------------------------------------------*
4
*       update CORR_KEYTAB
5
*---------------------------------------------------------------------*
6
* UET_ACTION ---> action: A - add to, D - delete from CORR_KEYTAB     *
7
*                         P - check if entry exists in CORR_KEYTAB    *
8
*                         W - do nothing
9
* CORR_KEYTAB (global) ---> header of CORR_KEYTAB with current entry  *
10
*---------------------------------------------------------------------*
11
FORM update_corr_keytab USING value(uet_action) uet_rc.
12
  DATA: e071k_safe LIKE e071k,
13
        asteriskpos TYPE i.
14
  MOVE: 1 TO uet_rc,
15
        corr_keytab TO e071k_safe.
16
* modify tabkey if only generic transport allowed
17
  IF vim_exit_11_12_active EQ space.
18
    IF e071k_safe-objname EQ x_header-texttab.
19
      IF x_header-genertxtrp NE space.
20
        asteriskpos
21
         = x_header-trtxgkpos / cl_abap_char_utilities=>charsize.
22
        CHECK e071k_safe-tabkey NE space.
23
        e071k_safe-tabkey+asteriskpos = '*'.
24
      ENDIF.
25
    ELSE.
26
      asteriskpos
27
       = x_header-trgkeypos / cl_abap_char_utilities=>charsize.
28
      IF x_header-generictrp NE space.
29
        e071k_safe-tabkey+asteriskpos = '*'.
30
      ENDIF.
31
    ENDIF.
32
  ELSE. "exits active - clear VIEWNAME for non-ddic-viewtables.
33
    CLEAR e071k_safe-viewname.
34
  ENDIF.
35
  CASE uet_action.
36
    WHEN hinzufuegen.
37
      IF e071k_safe-object EQ transp_object.     "table keys
38
        LOOP AT corr_keytab WHERE objname    EQ e071k_safe-objname
39
                              AND tabkey     EQ e071k_safe-tabkey
40
                              AND mastername EQ e071k_safe-mastername.
41
          IF corr_keytab-pgmid EQ vim_deleted_key.
42
            MOVE e071k_safe TO corr_keytab.
43
            MODIFY corr_keytab.
44
            CLEAR uet_rc.
45
          ENDIF.
46
          EXIT.
47
        ENDLOOP.
48
      ELSE.                            "other objects
49
        LOOP AT corr_keytab WHERE pgmid      EQ e071k_safe-pgmid
50
                              AND object     EQ e071k_safe-object
51
                              AND objname    EQ e071k_safe-objname
52
                              AND tabkey     EQ e071k_safe-tabkey
53
                              AND mastername EQ e071k_safe-mastername.
54
          IF corr_keytab-objfunc EQ 'D'.
55
            MOVE e071k_safe TO corr_keytab.
56
            MODIFY corr_keytab.
57
            CLEAR uet_rc.
58
          ENDIF.
59
          EXIT.
60
        ENDLOOP.
61
      ENDIF.
62
      IF sy-subrc NE 0.
63
        MOVE e071k_safe TO corr_keytab.
64
        APPEND corr_keytab.
65
        CLEAR uet_rc.
66
      ENDIF.
67
    WHEN geloescht.
68
      IF e071k_safe-object EQ transp_object.     "table keys
69
        LOOP AT corr_keytab WHERE objname    EQ e071k_safe-objname
70
                              AND tabkey     EQ e071k_safe-tabkey
71
                              AND mastername EQ e071k_safe-mastername
72
                              AND pgmid      NE vim_deleted_key.
73
          corr_keytab-pgmid = vim_deleted_key.
74
          MODIFY corr_keytab.
75
          CLEAR uet_rc.
76
          EXIT.
77
        ENDLOOP.
78
      ELSE.                            "other objects
79
        IF e071k_safe-mastername EQ space. "avoid error in exit rout.
80
          e071k_safe-mastername = master_name.
81
        ENDIF.
82
        LOOP AT corr_keytab WHERE pgmid      EQ e071k_safe-pgmid
83
                              AND object     EQ e071k_safe-object
84
                              AND objname    EQ e071k_safe-objname
85
                              AND tabkey     EQ e071k_safe-tabkey
86
                              AND mastername EQ e071k_safe-mastername.
87
*                             AND OBJFUNC    NE 'D'.
88
          IF corr_keytab-objfunc NE 'D'.
89
            corr_keytab-objfunc = 'D'.
90
            MODIFY corr_keytab.
91
            CLEAR uet_rc.
92
          ENDIF.
93
          EXIT.
94
        ENDLOOP.
95
* << Übergangslösung, da objekte zum Tabkey noch nicht eingelesen werden
96
        IF sy-subrc NE 0.
97
          MOVE e071k_safe TO corr_keytab.
98
          corr_keytab-objfunc = 'D'.
99
          APPEND corr_keytab.
100
          CLEAR uet_rc.
101
        ENDIF.
102
* >> Übergangslösung, da objekte zum Tabkey noch nicht eingelesen werden
103
      ENDIF.
104
    WHEN pruefen.
105
      IF e071k_safe-object EQ transp_object.     "table keys
106
        LOOP AT corr_keytab WHERE objname    EQ e071k_safe-objname
107
                              AND tabkey     EQ e071k_safe-tabkey
108
                              AND mastername EQ e071k_safe-mastername
109
                              AND pgmid      NE vim_deleted_key.
110
          CLEAR uet_rc.
111
          EXIT.
112
        ENDLOOP.
113
      ELSE.                            "other objects
114
        LOOP AT corr_keytab WHERE pgmid      EQ e071k_safe-pgmid
115
                              AND object     EQ e071k_safe-object
116
                              AND objname    EQ e071k_safe-objname
117
                              AND tabkey     EQ e071k_safe-tabkey
118
                              AND mastername EQ e071k_safe-mastername
119
                              AND objfunc    NE 'D'.
120
          CLEAR uet_rc.
121
          EXIT.
122
        ENDLOOP.
123
      ENDIF.
124
    WHEN vim_writing_bc_imp_log.
125
      APPEND corr_keytab.
126
  ENDCASE.
127
  IF uet_rc EQ 0 AND uet_action NE pruefen.
128
    MOVE 'X' TO <status>-keytbmodfd.
129
  ENDIF.
130
ENDFORM.                    "UPDATE_CORR_KEYTAB