Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM F4_POSITIONIEREN                                         *
3
*---------------------------------------------------------------------*
4
*       called externally from POPUP_GET_VALUES_USER_HELP             *
5
*---------------------------------------------------------------------*
6
FORM f4_positionieren USING value(tabname) TYPE tabname
7
                            value(fieldname) TYPE fieldname
8
                            value(display)
9
                      CHANGING returncode
10
                               value TYPE any.
11
  STATICS: field_tab TYPE TABLE OF dfies INITIAL SIZE 20.
12
 
13
  DATA: tabval(132) TYPE c,
14
        v_tab LIKE TABLE OF tabval INITIAL SIZE 500,
15
        w_dfies TYPE dfies,
16
        return_tab TYPE TABLE OF ddshretval INITIAL SIZE 1,
17
        BEGIN OF out_conv_function,
18
         prefix(16) TYPE c VALUE 'CONVERSION_EXIT_',
19
         exit LIKE vimnamtab-convexit,
20
         suffix(7) TYPE c VALUE '_OUTPUT',
21
        END OF out_conv_function,
22
        f4_length TYPE i.    "total length of to be displayed fields
23
  FIELD-SYMBOLS: <hf1>, <dfies> TYPE dfies, <retval> TYPE ddshretval.
24
 
25
  READ TABLE field_tab INDEX 1 ASSIGNING <dfies>.
26
  IF sy-subrc <> 0 OR <dfies>-tabname <> x_header-maintview.
27
    REFRESH field_tab.
28
 
29
* xb  06.02 csn ext.237151 2002, BCEK061005 ---------begin----------
30
* check the total display length of F4-List
31
    f4_length = 0.
32
    IF x_header-tablen > 1000.
33
      LOOP AT x_namtab.
34
        IF x_header-clidep NE space.       "ignore client field
35
          CHECK sy-tabix NE 1.
36
        ENDIF.
37
        IF x_namtab-keyflag NE space OR    "all key fields or
38
           x_namtab-datatype EQ 'CHAR' AND "all possibly text fields
39
           x_namtab-flength  GE 10     AND
40
           x_namtab-lowercase  NE space.
41
 
42
          f4_length = f4_length + x_namtab-outputlen.
43
        ENDIF.
44
      ENDLOOP.
45
    ENDIF.
46
 
47
    IF f4_length < 1000.          "check the fields length
48
* xb  06.02 csn ext.237151 2002, BCEK061005 ----------end-----------
49
    LOOP AT x_namtab.
50
      IF x_header-clidep NE space.       "ignore client field
51
        CHECK sy-tabix NE 1.
52
      ENDIF.
53
      CHECK x_namtab-readonly <> vim_hidden.                  "Subviews
54
      IF x_header-bastab NE space AND x_header-texttbexst NE space.
55
        CHECK x_namtab-keyflag NE space AND   "all entity keyfields
56
              x_namtab-texttabfld EQ space OR                 "or
57
            x_namtab-keyflag EQ space AND   "all texttab function fields
58
              x_namtab-texttabfld NE space.
59
      ELSE.
60
        CHECK x_namtab-keyflag NE space OR    "all key fields or
61
              x_namtab-datatype EQ 'CHAR' AND "all possibly text fields
62
              x_namtab-flength  GE 10     AND
63
              x_namtab-lowercase  NE space.
64
        ENDIF.
65
        IF x_namtab-texttabfld NE space.
66
          w_dfies-tabname = x_header-texttab.
67
        ELSE.
68
          w_dfies-tabname = x_header-maintview.              "Subviews
69
        ENDIF.
70
        w_dfies-fieldname = x_namtab-viewfield.
71
        APPEND w_dfies TO field_tab.
72
      ENDLOOP.
73
    ELSE.
74
* xb  06.02 csn ext.237151 2002, BCEK061005 ---------begin----------
75
      MESSAGE I810(SV) WITH x_header-viewname.
76
*   Die gesamte Länge der View & ist mehr als 1000 Charakter. Nur Key
77
*   Field wird gezeigt.
78
      LOOP AT x_namtab.
79
        IF x_header-clidep NE space.       "ignore client field
80
          CHECK sy-tabix NE 1.
81
        ENDIF.
82
       CHECK x_namtab-readonly <> vim_hidden.                  "Subviews
83
        IF x_header-bastab NE space AND x_header-texttbexst NE space.
84
          CHECK x_namtab-keyflag NE space AND   "all entity keyfields
85
                x_namtab-texttabfld EQ space OR                 "or
86
            x_namtab-keyflag EQ space AND   "all texttab function fields
87
                x_namtab-texttabfld NE space.
88
        ELSE.
89
          CHECK x_namtab-keyflag NE space.    "all key fields
90
      ENDIF.
91
      IF x_namtab-texttabfld NE space.
92
        w_dfies-tabname = x_header-texttab.
93
      ELSE.
94
        w_dfies-tabname = x_header-maintview.                  "Subviews
95
      ENDIF.
96
      w_dfies-fieldname = x_namtab-viewfield.
97
      append w_dfies to field_tab.
98
    ENDLOOP.
99
* xb  06.02 csn ext.237151 2002, BCEK061005 ----------end-----------
100
    ENDIF.
101
  ENDIF.
102
 
103
 
104
  LOOP AT extract.
105
    LOOP AT field_tab ASSIGNING <dfies>.
106
      READ TABLE x_namtab WITH KEY viewfield = <dfies>-fieldname.
107
      IF x_header-bastab NE space AND x_header-texttbexst NE space.
108
        IF x_namtab-keyflag EQ space AND x_namtab-texttabfld NE space.
109
* Type S: text field
110
          ASSIGN COMPONENT x_namtab-viewfield
111
           OF STRUCTURE <vim_ext_txt_struc> TO <hf1>.
112
        ELSEIF x_namtab-keyflag NE space
113
         AND x_namtab-texttabfld EQ space.
114
* Type S: key field
115
          ASSIGN COMPONENT x_namtab-viewfield
116
           OF STRUCTURE <vim_extract_struc> TO <hf1>.
117
        ENDIF.
118
      ELSE.
119
* viewfield
120
        ASSIGN COMPONENT x_namtab-viewfield
121
         OF STRUCTURE <vim_extract_struc> TO <hf1>.
122
      ENDIF.
123
      CHECK <hf1> IS ASSIGNED.
124
*        IF X_HEADER-BASTAB NE SPACE AND X_HEADER-TEXTTBEXST NE SPACE.
125
*          CHECK X_NAMTAB-KEYFLAG NE SPACE AND   "all entity keyfields
126
*                X_NAMTAB-TEXTTABFLD EQ SPACE OR             "or
127
*                X_NAMTAB-KEYFLAG EQ SPACE AND   "all texttab function
128
*                X_NAMTAB-TEXTTABFLD NE SPACE.
129
*        ENDIF.
130
*        ASSIGN EXTRACT+X_NAMTAB-POSITION(X_NAMTAB-FLENGTH) TO <HF1>
131
*               TYPE 'C'.
132
      WRITE <hf1> TO tabval(x_namtab-outputlen).
133
      APPEND tabval TO v_tab.
134
      CLEAR tabval.
135
    ENDLOOP.
136
  ENDLOOP.
137
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
138
    EXPORTING
139
*     DDIC_STRUCTURE         = ' '
140
      retfield               = fieldname
141
*     PVALKEY                = ' '
142
*     DYNPPROG               = ' '
143
*     DYNPNR                 = ' '
144
*     DYNPROFIELD            = ' '
145
*     STEPL                  = 0
146
*     WINDOW_TITLE           =
147
*     VALUE                  = ' '
148
*     VALUE_ORG              = 'C'
149
*     MULTIPLE_CHOICE        = ' '
150
      display                = display
151
*     CALLBACK_PROGRAM       = ' '
152
*     CALLBACK_FORM          = ' '
153
*     MARK_TAB               =
154
    TABLES
155
      value_tab              = v_tab
156
      field_tab              = field_tab
157
      return_tab             = return_tab
158
*     DYNPFLD_MAPPING        =
159
    EXCEPTIONS
160
      parameter_error        = 1
161
      no_values_found        = 2
162
      OTHERS                 = 3.
163
  IF sy-subrc = 0.
164
    READ TABLE return_tab INDEX 1 ASSIGNING <retval>.
165
    IF sy-subrc = 0.
166
      value = <retval>-fieldval.
167
    ENDIF.
168
  ELSE.
169
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
170
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
171
  ENDIF.
172
 
173
ENDFORM.                               "f4_positionieren