Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM SELECT                                                   *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
*  -->  PARAM                                                         *
7
*  <--  SY-SUBRC                                                      *
8
*---------------------------------------------------------------------*
9
FORM select USING param.
10
  FIELD-SYMBOLS: <vim_tot_txt_struc_loc> TYPE ANY.
11
 
12
  sy-subrc = 8.
13
  IF param EQ space AND status-action NE transportieren.
14
    "normal selection (not deleted entries)
15
    PERFORM normal_select.
16
  ELSE.
17
    CASE param.
18
      WHEN geloescht.
19
        CHECK <action>         EQ geloescht
20
        OR    <action>         EQ neuer_geloescht
21
        OR    <action>         EQ update_geloescht.
22
        CLEAR sy-subrc.
23
        IF x_header-selection NE space.
24
          IF x_header-bastab <> space AND x_header-texttbexst <> space.
25
            ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>.
26
          ELSE.
27
            ASSIGN <vim_total_struc> TO <vim_tot_txt_struc_loc>.
28
          ENDIF.
29
          CALL FUNCTION 'TABLE_RANGE_CHECK'
30
            EXPORTING
31
              tabname                   = x_header-maintview
32
              entry                     = total
33
              entry_text                = <vim_tot_txt_struc_loc>
34
              ddic                      = 'N'
35
              key                       = 'N'
36
              ignore_blank_subsetfields = 'N'
37
            TABLES
38
              x_namtab                  = x_namtab
39
              x_header                  = x_header
40
              sellist                   = dpl_sellist
41
            EXCEPTIONS
42
              entry_not_fits            = 1
43
              no_value_for_subset_ident = 2.
44
          IF sy-subrc EQ 2.
45
            RAISE no_value_for_subset_ident.
46
          ENDIF.
47
        ENDIF.
48
      WHEN markiert.
49
        IF status-delete EQ geloescht.
50
          CHECK <action> EQ geloescht OR <action> EQ neuer_geloescht OR
51
                <action> EQ update_geloescht.
52
        ENDIF.
53
        CHECK <mark>   EQ param.
54
        CLEAR sy-subrc.
55
        IF x_header-selection NE space.
56
          IF x_header-bastab <> space AND x_header-texttbexst <> space.
57
            ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>.
58
          ELSE.
59
            ASSIGN <vim_total_struc> TO <vim_tot_txt_struc_loc>.
60
          ENDIF.
61
 
62
          CALL FUNCTION 'TABLE_RANGE_CHECK'
63
            EXPORTING
64
              tabname                   = x_header-maintview
65
              entry                     = total
66
              entry_text                = <vim_tot_txt_struc_loc>
67
              ddic                      = 'N'
68
              key                       = 'N'
69
              ignore_blank_subsetfields = 'N'
70
            TABLES
71
              x_namtab                  = x_namtab
72
              x_header                  = x_header
73
              sellist                   = dpl_sellist
74
            EXCEPTIONS
75
              entry_not_fits            = 1
76
              no_value_for_subset_ident = 2.
77
          IF sy-subrc EQ 2.
78
            RAISE no_value_for_subset_ident.
79
          ENDIF.
80
        ENDIF.
81
      WHEN bcset_only.               "HCG Display only data from BC-Set
82
        READ TABLE vim_bc_entry_list INTO vim_bc_entry_list_wa
83
                   WITH TABLE KEY viewname = x_header-viewname
84
                                  keys = <vim_xtotal_key>.
85
        IF sy-subrc NE 0. sy-subrc = 8. ENDIF.
86
        CHECK sy-subrc EQ 0.
87
        IF x_header-selection NE space.
88
          IF x_header-bastab <> space AND x_header-texttbexst <> space.
89
            ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>.
90
          ELSE.
91
            ASSIGN <vim_total_struc> TO <vim_tot_txt_struc_loc>.
92
          ENDIF.
93
          CALL FUNCTION 'TABLE_RANGE_CHECK'
94
            EXPORTING
95
              tabname                   = x_header-maintview
96
              entry                     = total
97
              entry_text                = <vim_tot_txt_struc_loc>
98
              ddic                      = 'N'
99
              key                       = 'N'
100
              ignore_blank_subsetfields = 'N'
101
            TABLES
102
              x_namtab                  = x_namtab
103
              x_header                  = x_header
104
              sellist                   = dpl_sellist
105
            EXCEPTIONS
106
              entry_not_fits            = 1
107
              no_value_for_subset_ident = 2.
108
          IF sy-subrc EQ 2.
109
            RAISE no_value_for_subset_ident.
110
          ENDIF.
111
        ENDIF.
112
      WHEN by_field_contents.
113
        PERFORM normal_select.
114
        CHECK sy-subrc EQ 0.
115
        IF x_header-bastab NE space AND x_header-texttbexst NE space.
116
* table with texttable
117
          CALL FUNCTION 'QUERY_CHECK'
118
            EXPORTING
119
              record            = <vim_total_struc>
120
              textrecord        = <vim_tot_txt_struc>
121
            EXCEPTIONS
122
              no_hits_in_record = 4
123
              parameter_error   = 8.
124
        ELSE.
125
* view or single table
126
          CALL FUNCTION 'QUERY_CHECK'
127
               EXPORTING
128
                    record            = <vim_total_struc>
129
*                  record            = total
130
               EXCEPTIONS
131
                    no_hits_in_record = 4
132
                    parameter_error   = 8.
133
        ENDIF.
134
      WHEN OTHERS.                     "neuer_eintrag or aendern
135
       IF x_header-bastab NE space AND x_header-texttbexst NE space AND
136
                  param EQ aendern.
137
          CHECK <action> EQ param OR <action_text> EQ param OR
138
                <action> NE neuer_eintrag AND
139
                <action_text> EQ neuer_eintrag.
140
        ELSE.
141
          CHECK <action> EQ param.
142
        ENDIF.
143
        CLEAR sy-subrc.
144
        IF x_header-selection NE space.
145
          IF x_header-bastab <> space AND x_header-texttbexst <> space.
146
            ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>.
147
          ELSE.
148
            ASSIGN <vim_total_struc> TO <vim_tot_txt_struc_loc>.
149
          ENDIF.
150
 
151
          CALL FUNCTION 'TABLE_RANGE_CHECK'
152
            EXPORTING
153
              tabname                   = x_header-maintview
154
              entry                     = total
155
              entry_text                = <vim_tot_txt_struc_loc>
156
              ddic                      = 'N'
157
              key                       = 'N'
158
              ignore_blank_subsetfields = 'N'
159
            TABLES
160
              x_namtab                  = x_namtab
161
              x_header                  = x_header
162
              sellist                   = dpl_sellist
163
            EXCEPTIONS
164
              entry_not_fits            = 1
165
              no_value_for_subset_ident = 2.
166
          IF sy-subrc EQ 2.
167
            RAISE no_value_for_subset_ident.
168
          ENDIF.
169
        ENDIF.
170
    ENDCASE.
171
  ENDIF."param eq space and status-action ne transportieren
172
ENDFORM.                    "select