1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | FORM get_profiles USING p_selected TYPE c. |
15 | |
16 | DATA: cobj_type VALUE 'V'. "customizing-objecttype |
17 | |
18 | IF x_header-bastab NE space. |
19 | cobj_type = vim_tabl. |
20 | ENDIF. |
21 | CLEAR vim_pr_activating. |
22 | CALL FUNCTION 'SCPR_SHOW_OUT_OF_VIEW' |
23 | EXPORTING |
24 | tabname = x_header-viewname |
25 | tabtype = cobj_type |
26 | preselection = p_selected |
27 | cluster = vim_called_by_cluster |
28 | TABLES |
29 | header = x_header |
30 | namtab = x_namtab |
31 | sellist = <vim_ck_sellist> |
32 | EXCEPTIONS |
33 | user_abort = 1 |
34 | no_profile_found = 2 |
35 | profile_dont_exist = 3 |
36 | no_data = 4 |
37 | OTHERS = 5. |
38 | CASE sy-subrc. |
39 | WHEN 2. |
40 | MESSAGE s820(sv). |
41 |
42 | WHEN 3. |
43 | IF cobj_type = 'S'. |
44 | MESSAGE s822(sv) WITH x_header-viewname. |
45 |
46 | ELSE. |
47 | MESSAGE s821(sv) WITH x_header-viewname. |
48 |
49 | ENDIF. |
50 | ENDCASE. |
51 | ENDFORM. " GET_PROFILES |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | FORM import_profile USING actopts TYPE scpractopt. |
60 | |
61 | DATA: ext_field(1000), |
62 | pr_field(1000), |
63 | next, |
64 | i TYPE i VALUE 1, |
65 | extr_lin TYPE i, |
66 | len_text TYPE i, profile_used, |
67 | imported_to_all VALUE 'X'. |
68 | FIELD-SYMBOLS: <pr_field>, <bc_total_key>, |
69 | <bc_total>, <bc_total_action>, <bc_total_mark>, |
70 | <w_record> TYPE vim_pr_tab_type. |
71 | |
72 | len_text = x_header-texttablen - x_header-textkeylen. |
73 | CASE status-action. |
74 | WHEN aendern. |
75 |
76 | IF status-mode = list_bild. |
77 |
78 | LOOP AT vim_pr_tab ASSIGNING <w_record>. |
79 | IF <w_record>-action = aendern. |
80 |
81 | LOOP AT extract. |
82 | CHECK <w_record>-keys = <vim_xextract_key>. |
83 | PERFORM bcset_force_into_entry USING <w_record> |
84 | aendern actopts. |
85 | MODIFY extract. |
86 | EXIT. |
87 | ENDLOOP. |
88 | ELSE. |
89 |
90 | MOVE <initial_x> TO <vim_xextract>. |
91 | <vim_xextract_key> = <w_record>-keys. |
92 | PERFORM bcset_force_into_entry USING <w_record> |
93 | neuer_eintrag actopts. |
94 | APPEND extract. |
95 | ADD 1 TO maxlines. |
96 | ENDIF. |
97 | ENDLOOP. |
98 | SORT extract BY <vim_xextract_key>. |
99 | ELSE. |
100 |
101 | LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE |
102 | action = neuer_eintrag. |
103 | MOVE <initial_x> TO <vim_xextract>. |
104 | <vim_xextract_key> = <w_record>-keys. |
105 | PERFORM bcset_force_into_entry USING <w_record> |
106 | neuer_eintrag actopts. |
107 | APPEND extract. |
108 | ADD 1 TO maxlines. |
109 | ENDLOOP. |
110 |
111 | LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE action = aendern. |
112 | CLEAR profile_used. |
113 | LOOP AT extract. |
114 | CHECK <w_record>-keys = <vim_xextract_key>. |
115 | PERFORM bcset_force_into_entry USING <w_record> |
116 | aendern actopts. |
117 | MODIFY extract. |
118 | profile_used = 'X'. |
119 | EXIT. |
120 | ENDLOOP. |
121 | IF profile_used = space. |
122 | LOOP AT total INTO extract. |
123 | CHECK <w_record>-keys = <vim_xextract_key>. |
124 | PERFORM bcset_force_into_entry USING <w_record> |
125 | aendern actopts. |
126 | APPEND extract. |
127 | ADD 1 TO maxlines. |
128 | EXIT. |
129 | ENDLOOP. |
130 | ENDIF. |
131 | ENDLOOP. |
132 | SORT extract BY <vim_xextract_key>. |
133 | ENDIF. |
134 | WHEN hinzufuegen. |
135 |
136 | IF status-mode = list_bild. |
137 |
138 | DESCRIBE TABLE extract LINES extr_lin. |
139 | LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE |
140 | action = neuer_eintrag. |
141 | IF extr_lin LE i. |
142 |
143 | CLEAR extract. MOVE leer TO <xact>. |
144 | APPEND extract. |
145 | ENDIF. |
146 |
147 | LOOP AT extract FROM i. |
148 | CHECK <xact> = leer. |
149 | i = sy-tabix + 1. |
150 | ADD 1 TO maxlines. |
151 | <vim_xextract_key> = <w_record>-keys. |
152 | PERFORM bcset_force_into_entry USING <w_record> |
153 | neuer_eintrag actopts. |
154 | MODIFY extract. |
155 | EXIT. |
156 | ENDLOOP. |
157 | ENDLOOP. |
158 | ELSE. |
159 |
160 | MOVE <initial_x> TO <vim_xextract>. |
161 | LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE |
162 | action = neuer_eintrag. |
163 | <vim_xextract_key> = <w_record>-keys. |
164 | PERFORM bcset_force_into_entry USING <w_record> |
165 | neuer_eintrag actopts. |
166 | APPEND extract. |
167 | ADD 1 TO maxlines. |
168 | ENDLOOP. |
169 | ENDIF. |
170 |
171 | LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE action = aendern. |
172 | LOOP AT total INTO extract. |
173 | CHECK <w_record>-keys = <vim_xextract_key>. |
174 | PERFORM bcset_force_into_entry USING <w_record> |
175 | aendern actopts. |
176 | APPEND extract. |
177 | EXIT. |
178 | ENDLOOP. |
179 | ENDLOOP. |
180 | SORT extract BY <vim_xextract_key>. |
181 | ENDCASE. |
182 | ENDFORM. " IMPORT_PROFILE |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | FORM get_profile_status CHANGING vim_pr_tab LIKE vim_pr_tab |
198 | vim_pr_fields LIKE vim_pr_fields[]. |
199 | |
200 | DATA: w_profile TYPE scpr_vals, |
201 | w_vim_pr_tab TYPE vim_pr_tab_type, |
202 | w_vim_pr_fields TYPE vim_pr_fields_type, |
203 | recnumber LIKE scprvals-recnumber, |
204 | text(1000), value LIKE vimsellist-value, |
205 | gottext, first, rc LIKE sy-subrc, |
206 | fieldname TYPE fnam_____4. |
207 | FIELD-SYMBOLS: <pr_key>, <x_keys> TYPE x, <x_text> TYPE x, |
208 | <bc_val> TYPE ANY, <imp_val> TYPE ANY, |
209 | <keys_struc> TYPE ANY, <text_struc> TYPE ANY. |
210 | |
211 | ASSIGN: w_vim_pr_tab-keys TO <x_keys> CASTING, |
212 | <x_keys> TO <keys_struc> CASTING TYPE (x_header-maintview). |
213 | IF x_header-bastab <> space AND x_header-texttbexst <> space. |
214 | ASSIGN: w_vim_pr_tab-textrecord TO <x_text> CASTING, |
215 | <x_text> TO <text_struc> CASTING TYPE (x_header-texttab). |
216 | ENDIF. |
217 | RANGES dont_use FOR scprvals-recnumber. |
218 | dont_use-sign = 'E'. dont_use-option = 'EQ'. |
219 | |
220 | LOOP AT vim_pr_tab INTO w_vim_pr_tab. |
221 | READ TABLE vim_pr_fields INTO w_vim_pr_fields WITH KEY |
222 | recnumber = w_vim_pr_tab-recnumber. |
223 | <x_keys> = <initial_x>(x_header-keylen). |
224 |
225 | IF x_header-bastab <> space AND x_header-texttbexst <> space. |
226 | <x_text> = <initial_textkey_x>. |
227 |
228 | ENDIF. |
229 |
230 | LOOP AT x_namtab WHERE keyflag = 'X' AND texttabfld IS INITIAL. |
231 | IF x_namtab-datatype = 'CLNT' AND x_header-clidep <> space. |
232 |
233 |
234 | DELETE TABLE w_vim_pr_fields-fields WITH TABLE KEY |
235 | fieldname = x_namtab-viewfield. |
236 | MODIFY TABLE vim_pr_fields FROM w_vim_pr_fields. |
237 |
238 |
239 |
240 |
241 | ELSE. |
242 | CLEAR w_profile. |
243 | READ TABLE vim_profile_values INTO w_profile WITH KEY |
244 | tablename = x_header-viewname |
245 | fieldname = x_namtab-viewfield |
246 | recnumber = w_vim_pr_tab-recnumber. |
247 | IF w_profile-flag = vim_profile_fixkey. |
248 | CASE w_vim_pr_tab-keys_fix. |
249 | WHEN space. |
250 | w_vim_pr_tab-keys_fix = vim_pr_all_fix. |
251 | WHEN vim_pr_open. |
252 | w_vim_pr_tab-keys_fix = vim_pr_some_fix. |
253 | ENDCASE. |
254 | ELSE. |
255 | CASE w_vim_pr_tab-keys_fix. |
256 | WHEN space. |
257 | w_vim_pr_tab-keys_fix = vim_pr_open. |
258 | WHEN vim_pr_all_fix. |
259 | w_vim_pr_tab-keys_fix = vim_pr_some_fix. |
260 | ENDCASE. |
261 | ENDIF. |
262 | IF x_namtab-readonly <> subset."subsetf. already in <initial> |
263 |
264 | CONCATENATE x_header-maintview x_namtab-viewfield |
265 | INTO fieldname SEPARATED BY '-'. |
266 | ASSIGN: w_profile-value TO <bc_val> CASTING TYPE (fieldname), |
267 | COMPONENT x_namtab-viewfield |
268 | OF STRUCTURE <keys_struc> TO <imp_val>. |
269 | <imp_val> = <bc_val>. |
270 |
271 |
272 | IF x_header-bastab <> space AND x_header-texttbexst <> space. |
273 |
274 | ASSIGN COMPONENT x_namtab-txttabfldn |
275 | OF STRUCTURE <text_struc> TO <imp_val>. |
276 | <imp_val> = <bc_val>. |
277 |
278 |
279 | ENDIF. |
280 | ENDIF. "x_namtab-readonly <> subset |
281 | w_vim_pr_fields-keys_fix = w_vim_pr_tab-keys_fix. |
282 | MODIFY vim_pr_fields FROM w_vim_pr_fields TRANSPORTING keys_fix |
283 | WHERE recnumber = w_vim_pr_fields-recnumber. |
284 | ENDIF. "x_namtab-datatype = 'CLNT' |
285 | ENDLOOP. |
286 | IF x_header-bastab <> space AND x_header-texttbexst <> space AND |
287 | w_vim_pr_tab-keys_fix <> vim_pr_error. |
288 |
289 | CLEAR recnumber. |
290 | IF vim_pr_records > 1. |
291 | WHILE gottext = space. |
292 | gottext = 'X'. |
293 | first = 'X'. |
294 | LOOP AT vim_profile_values INTO w_profile WHERE |
295 | tablename = x_header-texttab |
296 | AND recnumber IN dont_use[]. |
297 | IF first = 'X'. |
298 | recnumber = w_profile-recnumber. |
299 | CLEAR first. |
300 | ELSE. |
301 | IF recnumber <> w_profile-recnumber. |
302 | IF gottext <> space. EXIT. ENDIF. |
303 | recnumber = w_profile-recnumber. |
304 | ENDIF. |
305 | ENDIF. |
306 | IF w_profile-flag+2 = 'Y'. "keY, ukY or fkY -> Key fields |
307 |
308 | IF w_profile-fieldname = x_header-sprasfield. |
309 | IF w_profile-value(1) <> sy-langu. |
310 | dont_use-low = recnumber. |
311 | APPEND dont_use. |
312 | CLEAR: text, gottext. |
313 | CONTINUE. |
314 | ENDIF. |
315 | ELSE. |
316 | READ TABLE x_namtab WITH KEY |
317 | viewfield = w_profile-fieldname |
318 | keyflag = 'X' texttabfld = 'X'. |
319 | CONCATENATE x_header-texttab x_namtab-txttabfldn |
320 | INTO fieldname SEPARATED BY '-'. |
321 | ASSIGN: w_profile-value TO <bc_val> |
322 | CASTING TYPE (fieldname), |
323 | COMPONENT x_namtab-txttabfldn |
324 | OF STRUCTURE <text_struc> TO <imp_val>. |
325 |
326 |
327 |
328 |
329 | IF <imp_val> <> <bc_val>. |
330 | CLEAR gottext. |
331 | dont_use-low = recnumber. |
332 | APPEND dont_use. |
333 |
334 | CONTINUE. |
335 | ENDIF. |
336 | ENDIF. |
337 |
338 |
339 |
340 |
341 | ENDIF. "key field |
342 | ENDLOOP. |
343 | ENDWHILE. |
344 | IF gottext <> space. |
345 | recnumber = w_profile-recnumber. |
346 | ENDIF. |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 | ELSEIF vim_pr_records = 1. |
355 |
356 |
357 |
358 | ASSIGN COMPONENT x_header-sprasfield |
359 | OF STRUCTURE <text_struc> TO <imp_val>. |
360 | <imp_val> = sy-langu. |
361 |
362 |
363 | READ TABLE vim_profile_values INTO w_profile WITH KEY |
364 | tablename = x_header-texttab |
365 | fieldname = x_header-sprasfield |
366 | value = sy-langu. |
367 | IF sy-subrc = 0. |
368 |
369 | recnumber = w_profile-recnumber. |
370 | ENDIF. |
371 | ENDIF. "lines = 1 |
372 | IF NOT recnumber IS INITIAL. |
373 |
374 | LOOP AT x_namtab WHERE keyflag = space AND |
375 | texttabfld = 'X'. |
376 | CONCATENATE x_header-texttab x_namtab-viewfield |
377 | INTO fieldname SEPARATED BY '-'. |
378 | READ TABLE vim_profile_values INTO w_profile WITH KEY |
379 | tablename = x_header-texttab |
380 | recnumber = recnumber |
381 | fieldname = x_namtab-viewfield. |
382 | ASSIGN: w_profile-value TO <bc_val> |
383 | CASTING TYPE (fieldname), |
384 | COMPONENT x_namtab-viewfield |
385 | OF STRUCTURE <text_struc> TO <imp_val>. |
386 | <imp_val> = <bc_val>. |
387 |
388 |
389 | APPEND w_profile-fieldname TO w_vim_pr_fields-fields. |
390 | ENDLOOP. |
391 | ELSE. |
392 |
393 | MOVE <text_initial_x> TO <x_text>. |
394 | ENDIF. |
395 | ENDIF. "text table exists |
396 | MODIFY vim_pr_tab FROM w_vim_pr_tab. |
397 | MODIFY TABLE vim_pr_fields FROM w_vim_pr_fields. |
398 | ENDLOOP. |
399 | ENDFORM. "get_profile_status |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 | FORM activate_profile CHANGING p_selected |
410 | TYPE c. |
411 | |
412 | DATA: pr_rc TYPE i, pr_funcsafe(4), pr_counter TYPE i, |
413 | pr_mark_entries VALUE 'X', hf1 TYPE i, hf TYPE i, |
414 | cobj_type VALUE 'V', pr_key_da, pr_recnumber TYPE scpr_recnr, |
415 | bc_id TYPE scpr_id, bc_rec_found(1) TYPE c, |
416 | actopts TYPE scpractopt."HCG always empty, only nec. 46C 610 |
417 | STATICS: viewname LIKE vimdesc-viewname. |
418 | FIELD-SYMBOLS: <pr_f1> TYPE x, <w_record> TYPE vim_pr_tab_type, |
419 | <bc_key> TYPE x. |
420 | |
421 | CHECK status-action NE anzeigen AND "ignore wrong setted requestflags |
422 | status-action NE transportieren. "due to individual F4 modules |
423 | CLEAR vim_pr_activating. |
424 | IF p_selected IS INITIAL. |
425 |
426 | REFRESH: vim_profile_values, vim_pr_tab. |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 | ELSE. |
473 | IF vim_called_by_cluster <> space AND |
474 | viewname <> x_header-viewname. |
475 |
476 | viewname = x_header-viewname. |
477 | IF 'AU' CA status-action. |
478 |
479 | PERFORM get_pr_nbr_records USING vim_profile_values |
480 | x_header |
481 | CHANGING pr_rc |
482 | bc_id |
483 | vim_pr_records |
484 | vim_pr_tab |
485 | vim_pr_fields. |
486 |
487 | PERFORM get_profile_status CHANGING vim_pr_tab |
488 | vim_pr_fields. |
489 | ENDIF. |
490 | ENDIF. |
491 | ENDIF. |
492 |
493 | PERFORM bcset_key_check_in_total. |
494 | PERFORM markiere_alle USING nicht_markiert. |
495 | PERFORM import_profile USING actopts. |
496 |
497 | IF vim_called_by_cluster <> space. |
498 | CALL FUNCTION 'VIEWCLUSTER_PR_IMPORT_CTRL' |
499 | EXPORTING |
500 | viewname = x_header-viewname |
501 | action = 'M' |
502 | TABLES |
503 | profile_values = vim_profile_values |
504 | EXCEPTIONS |
505 | wrong_parameter = 1 |
506 | OTHERS = 2. |
507 | ENDIF. |
508 | replace_mode = 'X'. |
509 | vim_special_mode = vim_upgrade. |
510 |
511 | ASSIGN <vim_xtotal>(x_header-tablen) TO <pr_f1> CASTING. |
512 | LOOP AT extract. |
513 | CHECK <xact> = aendern OR <xact> = neuer_eintrag. |
514 | CLEAR vim_bc_entry_list_wa. |
515 | vim_bc_entry_list_wa-id = bc_id. |
516 | vim_bc_entry_list_wa-viewname = x_header-viewname. |
517 | hf = sy-tabix. |
518 | READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. |
519 | IF sy-subrc EQ 0. "entry exists in current client |
520 | hf1 = sy-tabix. |
521 | IF <xact> EQ neuer_eintrag AND |
522 | <action> EQ geloescht OR <action> EQ neuer_geloescht OR |
523 | <action> EQ update_geloescht. |
524 | status-delete = geloescht. |
525 |
526 | <xact> = <action>. |
527 | MODIFY extract. |
528 | pr_funcsafe = function. |
529 | clear pr_rc. |
530 | PERFORM vim_mark_and_process USING hf 'UNDO' hf1 |
531 | pr_rc. |
532 | CLEAR status-delete. function = pr_funcsafe. |
533 | CHECK pr_rc NE 4. |
534 | IF pr_rc EQ 8. |
535 | EXIT. |
536 | ENDIF. |
537 | READ TABLE extract INDEX hf. |
538 | READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. |
539 | hf1 = sy-tabix. |
540 | <xact> = aendern. MODIFY extract. |
541 | ENDIF. |
542 | IF <vim_xtotal_key> = <vim_xextract_key>. |
543 |
544 | <action> = aendern. |
545 | MODIFY total INDEX hf1. |
546 | IF x_header-bastab NE space AND x_header-texttbexst NE space. |
547 | TRANSLATE <status>-upd_flag USING ' ETX'. |
548 | ELSE. |
549 | <status>-upd_flag = 'X'. |
550 | ENDIF. |
551 | ENDIF. |
552 | ENDIF. "sy-subrc eq 0. |
553 | CLEAR vim_pr_fields_wa. |
554 | CLEAR bc_rec_found. |
555 | LOOP AT vim_pr_tab ASSIGNING <w_record>. |
556 | ASSIGN <w_record>-keys(x_header-keylen) TO <bc_key>. |
557 | CHECK <bc_key> = <vim_xextract_key>. |
558 | bc_rec_found = 'X'. |
559 | READ TABLE vim_pr_fields INTO vim_pr_fields_wa WITH KEY |
560 | recnumber = <w_record>-recnumber. |
561 | vim_bc_entry_list_wa-id = bc_id. |
562 | vim_bc_entry_list_wa-recnumber = <w_record>-recnumber. |
563 | vim_bc_entry_list_wa-keys = <bc_key>. |
564 |
565 |
566 |
567 |
568 |
569 | vim_bc_entry_list_wa-action = neuer_eintrag. |
570 | INSERT LINES OF vim_pr_fields_wa-fields INTO TABLE |
571 | vim_bc_entry_list_wa-fields. |
572 | EXIT. |
573 | ENDLOOP. |
574 | CHECK NOT bc_rec_found IS INITIAL. |
575 | IF <xact> <> aendern OR <pr_f1> <> <table2_x>. |
576 |
577 | CHECK NOT vim_pr_fields_wa IS INITIAL. |
578 | <status>-prof_found = vim_pr_into_view. |
579 | PERFORM vim_modify_view_entry USING hf pr_rc. |
580 | <status>-prof_found = vim_profile_found. |
581 | CHECK pr_rc NE 4. |
582 | IF pr_rc EQ 8. |
583 | EXIT. |
584 | ENDIF. |
585 | ENDIF. |
586 | READ TABLE total WITH KEY <vim_xtotal_key> BINARY SEARCH |
587 | TRANSPORTING NO FIELDS. |
588 | IF <mark> EQ nicht_markiert. |
589 | <mark> = markiert. ADD 1 TO mark_total. |
590 | MODIFY total INDEX sy-tabix. |
591 | ENDIF. |
592 | extract = total. |
593 | MODIFY extract. |
594 | INSERT vim_bc_entry_list_wa INTO TABLE vim_bc_entry_list. |
595 | IF sy-subrc = 4. |
596 | MODIFY TABLE vim_bc_entry_list FROM vim_bc_entry_list_wa. |
597 | ENDIF. |
598 | ADD 1 TO pr_counter. |
599 | ENDLOOP. |
600 | IF pr_counter < vim_pr_records. |
601 | MESSAGE s818(sv) WITH pr_counter vim_pr_records. |
602 |
603 | ELSE. |
604 | MESSAGE s819(sv). |
605 |
606 | ENDIF. |
607 | nextline = 1. |
608 | CLEAR: vim_special_mode, replace_mode. |
609 | PERFORM fill_extract. |
610 | IF status-action EQ hinzufuegen. |
611 | status-action = aendern. |
612 | title-action = aendern. |
613 | CLEAR <status>-selected. |
614 | ENDIF. |
615 | IF status-mode = detail_bild. |
616 |
617 | vim_next_screen = liste. vim_leave_screen = 'X'. |
618 | ENDIF. |
619 | ENDFORM. " ACTIVATE_PROFILE |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 | FORM set_profile_key_attributes |
630 | USING p_name LIKE vim_objfield |
631 | CHANGING p_screen_input LIKE screen-input |
632 | p_modify_screen LIKE vim_modify_screen. |
633 | |
634 | DATA: w_field TYPE vimty_fields_type. |
635 | |
636 | p_screen_input = '0'. |
637 | CASE vim_pr_fields_wa-keys_fix. |
638 | WHEN vim_pr_open. |
639 | p_screen_input = '1'. p_modify_screen = 'X'. |
640 | WHEN vim_pr_all_fix. |
641 | p_screen_input = '0'. |
642 | WHEN vim_pr_some_fix. |
643 | READ TABLE vim_pr_fields_wa-fields INTO w_field |
644 | WITH KEY fieldname = p_name. |
645 | IF w_field-flag <> vim_profile_fixkey. |
646 | p_screen_input = '1'. p_modify_screen = 'X'. |
647 | ENDIF. |
648 | ENDCASE. |
649 | ENDFORM. " SET_PROFILE_KEY_ATTRIBUTES |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 | FORM profile_put_into_wa USING p_bc_set LIKE vim_profile_values |
661 | p_record TYPE vim_pr_tab_type |
662 | p_header TYPE vimdesc |
663 | p_namtab LIKE x_namtab[] |
664 | p_subset TYPE xfeld |
665 | p_action TYPE char1 |
666 | actopts type scpractopt |
667 | CHANGING p_field. |
668 | DATA: w_profile TYPE scpr_vals, |
669 | fieldname TYPE fnam_____4, |
670 | old_guid TYPE REF TO data, |
671 | tabname_wa TYPE objs-tabname, |
672 | objecttype TYPE objs-objecttype VALUE 'S'. |
673 | STATICS: loc_viewname TYPE objs-objectname, |
674 | piecelist TYPE TABLE OF objs-tabname. |
675 | |
676 | FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <field> TYPE ANY, |
677 | <old_guid> TYPE ANY, <work_area> TYPE ANY, |
678 | <bc_value> type any. |
679 | |
680 | CONSTANTS: no_standard(1) TYPE c VALUE 'F', |
681 | stan(3) TYPE c VALUE 'USE'. |
682 | |
683 | ASSIGN p_field TO <work_area> CASTING TYPE (p_header-maintview). |
684 | LOOP AT p_namtab ASSIGNING <namtab> WHERE keyflag = space |
685 | AND texttabfld = space. |
686 | ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE <work_area> |
687 | TO <field>. |
688 | CONCATENATE p_header-maintview <namtab>-viewfield |
689 | INTO fieldname SEPARATED BY '-'. |
690 | IF <namtab>-domname IN vim_guid_domain. |
691 |
692 | IF p_action = neuer. |
693 |
694 | ELSE. |
695 | IF p_record-keys_fix = vim_pr_all_fix. |
696 | IF p_header-frm_af_uid <> space. |
697 |
698 | CREATE DATA old_guid TYPE (fieldname). |
699 |
700 |
701 | ASSIGN: old_guid->* TO <old_guid>. |
702 | <old_guid> = <field>. |
703 | ENDIF. |
704 | ELSE. |
705 | CONTINUE. |
706 |
707 | ENDIF. |
708 | ENDIF. |
709 | ENDIF. |
710 | CASE <namtab>-readonly. |
711 | WHEN space. |
712 | READ TABLE p_bc_set INTO w_profile WITH KEY |
713 | tablename = p_header-viewname fieldname = <namtab>-viewfield |
714 | recnumber = p_record-recnumber TRANSPORTING flag value. |
715 | CHECK sy-subrc = 0. |
716 | ASSIGN w_profile-value TO <bc_value> CASTING TYPE (fieldname). |
717 |
718 |
719 | if actopts-no_standrd NE no_standard OR w_profile-flag NE stan. |
720 | <field> = <bc_value>. |
721 | endif. |
722 |
723 |
724 | WHEN rdonly OR vim_hidden. "HCG Check if table in piece list |
725 | IF p_header-viewname NE loc_viewname. |
726 | loc_viewname = p_header-viewname. |
727 | REFRESH piecelist. |
728 | IF p_header-bastab EQ space. objecttype = 'V'. ENDIF. |
729 | SELECT tabname FROM objs INTO tabname_wa "Get info from OBJS |
730 | WHERE objectname = p_header-viewname |
731 | AND objecttype = objecttype. |
732 | APPEND tabname_wa TO piecelist. |
733 | ENDSELECT. |
734 | ENDIF. |
735 | READ TABLE p_bc_set INTO w_profile WITH KEY |
736 | tablename = p_header-viewname fieldname = <namtab>-viewfield |
737 | recnumber = p_record-recnumber TRANSPORTING flag value. |
738 | CHECK sy-subrc = 0. |
739 | READ TABLE piecelist INTO tabname_wa WITH KEY |
740 | <namtab>-bastabname. |
741 | IF sy-subrc EQ 0. "HCG If table is not in piecelist: skip field |
742 | ASSIGN w_profile-value TO <bc_value> CASTING TYPE (fieldname). |
743 |
744 |
745 | IF actopts-no_standrd NE no_standard OR |
746 | w_profile-flag NE stan. |
747 | <field> = <bc_value>. |
748 | ENDIF. |
749 | ENDIF. |
750 | WHEN subset. |
751 | CHECK p_subset <> space. |
752 | ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE <initial> |
753 | TO <bc_value>. |
754 |
755 |
756 | ENDCASE. |
757 | IF <namtab>-domname IN vim_guid_domain |
758 | AND p_record-keys_fix = vim_pr_all_fix |
759 | AND p_header-frm_af_uid <> space. |
760 |
761 | PERFORM (p_header-frm_af_uid) IN PROGRAM (p_header-fpoolname) |
762 | USING <old_guid> |
763 | CHANGING <field> |
764 | <work_area>. |
765 | ENDIF. |
766 | ENDLOOP. |
767 | ENDFORM. " PROFILE_PUT_INTO_WA |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 | FORM get_pr_nbr_records USING vim_profile_values |
782 | LIKE vim_profile_values |
783 | x_header TYPE vimdesc |
784 | CHANGING p_rc like sy-subrc |
785 | p_bc_id TYPE scpr_id |
786 | vim_pr_records TYPE i |
787 | vim_pr_tab LIKE vim_pr_tab |
788 | vim_pr_fields LIKE vim_pr_fields. |
789 | |
790 | DATA: w_vim_pr_tab TYPE vim_pr_tab_type, first VALUE 'X', |
791 | w_vim_pr_fields TYPE vim_pr_fields_type, |
792 | w_fields TYPE vimty_fields_type, recnumber TYPE scpr_recnr. |
793 | FIELD-SYMBOLS: <profile_value> LIKE LINE OF vim_profile_values. |
794 | |
795 | REFRESH: vim_pr_tab, vim_pr_fields. |
796 | CLEAR: vim_pr_records, p_rc. |
797 | LOOP AT vim_profile_values ASSIGNING <profile_value> |
798 | WHERE tablename = x_header-viewname. |
799 | IF <profile_value>-recnumber <> recnumber. |
800 | recnumber = <profile_value>-recnumber. |
801 | IF first = space. |
802 | APPEND w_vim_pr_tab TO vim_pr_tab. |
803 | APPEND w_vim_pr_fields TO vim_pr_fields. CLEAR w_vim_pr_fields. |
804 | ENDIF. |
805 | CLEAR first. |
806 | w_vim_pr_fields-recnumber = w_vim_pr_tab-recnumber |
807 | = <profile_value>-recnumber. |
808 | ADD 1 TO vim_pr_records. |
809 | ENDIF. |
810 | w_fields-fieldname = <profile_value>-fieldname. |
811 | w_fields-flag = <profile_value>-flag. |
812 | APPEND w_fields TO w_vim_pr_fields-fields. |
813 | ENDLOOP. |
814 | p_rc = sy-subrc. |
815 | CHECK sy-subrc = 0. |
816 | APPEND w_vim_pr_tab TO vim_pr_tab. |
817 | APPEND w_vim_pr_fields TO vim_pr_fields. |
818 | p_bc_id = <profile_value>-id. |
819 |
820 |
821 |
822 |
823 | ENDFORM. " GET_PR_NBR_RECORDS |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 | FORM get_pr_field_from_sel |
839 | USING p_pr_sellist TYPE vimsellist_type |
840 | p_pr_namtab LIKE vimnamtab |
841 | CHANGING p_sel_value LIKE dpl_sellist-value |
842 | p_rc LIKE sy-subrc. |
843 | |
844 | DATA: w_sellist LIKE vimsellist, first. |
845 | |
846 | p_rc = 1. first = 'X'. |
847 | LOOP AT p_pr_sellist INTO w_sellist. |
848 | CHECK w_sellist-viewfield = p_pr_namtab-viewfield. |
849 | IF first = space OR w_sellist-operator <> 'EQ'. |
850 | CLEAR p_sel_value. p_rc = 2. EXIT. |
851 | ELSE. |
852 | MOVE w_sellist-value(p_pr_namtab-flength) TO |
853 | p_sel_value(p_pr_namtab-flength). |
854 | p_rc = 0. |
855 | ENDIF. |
856 | CLEAR first. |
857 | ENDLOOP. |
858 | ENDFORM. " GET_PR_FIELD_FROM_SEL |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 | FORM vim_pr_mand_fields. |
867 | LOOP AT SCREEN. |
868 | CHECK screen-required <> '0'. |
869 | vim_pr_activating = 'X'. |
870 | SET SCREEN detail. LEAVE SCREEN. |
871 | ENDLOOP. |
872 | ENDFORM. " VIM_PR_AT_EXIT_COM |
873 |
874 |
875 |
876 |
877 |
878 |
879 | FORM bcset_key_check_in_total. |
880 | |
881 | DATA: w_record TYPE vim_pr_tab_type. |
882 | FIELD-SYMBOLS: <bc_key> TYPE x. |
883 | |
884 | ASSIGN w_record-keys(x_header-keylen) TO <bc_key>. |
885 | LOOP AT vim_pr_tab INTO w_record. |
886 | CLEAR w_record-action. |
887 | READ TABLE total WITH KEY <bc_key> BINARY SEARCH |
888 | TRANSPORTING NO FIELDS. |
889 | IF sy-subrc = 0. |
890 | w_record-action = aendern. |
891 | ELSE. |
892 | w_record-action = neuer_eintrag. |
893 | ENDIF. |
894 | MODIFY vim_pr_tab FROM w_record. |
895 | ENDLOOP. |
896 | ENDFORM. " bcset_key_check_in_total |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 | FORM bcset_force_into_entry USING p_record TYPE vim_pr_tab_type |
906 | p_action TYPE char1 |
907 | actopts TYPE scpractopt. |
908 | |
909 | field-symbols: <textrec_x> type x. |
910 | |
911 | IF <xmark> = nicht_markiert. |
912 | <xmark> = markiert. ADD 1 TO mark_extract. |
913 | ENDIF. |
914 | <xact> = p_action. |
915 | PERFORM profile_put_into_wa USING vim_profile_values |
916 | p_record |
917 | x_header |
918 | x_namtab[] |
919 | 'X' |
920 | p_action |
921 | actopts |
922 | CHANGING <vim_xextract>. |
923 |
924 | IF x_header-texttbexst <> space AND x_header-bastab <> space. |
925 | assign p_record-textrecord(x_header-texttablen) |
926 | to <textrec_x> casting. |
927 | move <textrec_x> to <vim_xextract_text>. |
928 |
929 |
930 | ENDIF. |
931 | ENDFORM. " bcset_force_into_entry |