Eberstein Consulting, SAP-Entwickler René Eberstein – Coding



























Coding

Das Gerüst

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
*&---------------------------------------------------------------------*
*& Report: ZREB_SE16
*& Autor:  René Eberstein, Eberstein Consulting, www.eberstein.de
*&---------------------------------------------------------------------*
*& This report shows the possibilities of generic/dynamic programming
*& Classical example for this: Functionality of SE16
*&---------------------------------------------------------------------*
 
report  zreb_se16.
 
****************
* Types & Data *
****************
 
type-pools: slis.
 
types: begin of ty_fields,
       tabname   type dfies-tabname,   "Table Name
       fieldname type dfies-fieldname, "Field Name
       langu     type dfies-langu,     "Language Key
       position  type dfies-position,  "Position of the field in the table
       domname   type dfies-domname,   "Domain name
       rollname  type dfies-rollname,  "Data element (semantic domain)
       scrtext_s type dfies-scrtext_s, "Short Field Label
       scrtext_m type dfies-scrtext_m, "Medium Field Label
       scrtext_l type dfies-scrtext_l, "Long Field Label
       selkz     type selkz,           "Selection flag
       end of ty_fields.
 
types: tty_fields type standard table of ty_fields.
data: gt_fields type standard table of ty_fields.
field-symbols: <fs_fields> type ty_fields.
 
types: tty_where type standard table of string,
       tty_sel   type standard table of string.
 
data: g_execute    type xfeld,
      g_alv(10)    type c.
 
data: gt_where type standard table of string,
      gt_sel   type standard table of string.
 
data: g_f1  type name_komp,
      g_f2  type name_komp,
      g_f3  type name_komp,
      g_f4  type name_komp,
      g_f5  type name_komp,
      g_f6  type name_komp,
      g_f7  type name_komp,
      g_f8  type name_komp,
      g_f9  type name_komp,
      g_f10 type name_komp,
      g_f11 type name_komp,
      g_f12 type name_komp,
      g_f13 type name_komp,
      g_f14 type name_komp,
      g_f15 type name_komp,
      g_f16 type name_komp,
      g_f17 type name_komp,
      g_f18 type name_komp,
      g_f19 type name_komp,
      g_f20 type name_komp,
      g_f21 type name_komp,
      g_f22 type name_komp,
      g_f23 type name_komp,
      g_f24 type name_komp,
      g_f25 type name_komp,
      g_f26 type name_komp,
      g_f27 type name_komp,
      g_f28 type name_komp,
      g_f29 type name_komp,
      g_f30 type name_komp,
      g_f31 type name_komp,
      g_f32 type name_komp,
      g_f33 type name_komp,
      g_f34 type name_komp,
      g_f35 type name_komp,
      g_f36 type name_komp,
      g_f37 type name_komp,
      g_f38 type name_komp,
      g_f39 type name_komp,
      g_f40 type name_komp,
      g_f41 type name_komp,
      g_f42 type name_komp,
      g_f43 type name_komp,
      g_f44 type name_komp,
      g_f45 type name_komp,
      g_f46 type name_komp,
      g_f47 type name_komp,
      g_f48 type name_komp,
      g_f49 type name_komp,
      g_f50 type name_komp.
 
* Define reference variable with dynamic type
data: pitab type ref to data.
 
field-symbols: <fs_table> type standard table.
 
 
************************************
* Selection-Screen Table Selection *
************************************
selection-screen: begin of block a1 with frame title text-001.
parameters: p_tab  type dd02l-tabname default 'SFLIGHT', "Selected table
            p_max  type tbmaxsel default 100,            "Number Data Records
            p_ausw as checkbox.                          "Option for selection fields of table
selection-screen: end of block a1.
 
 
*******************************************************
* Selection-Screen: field selection of selected table *
*******************************************************
selection-screen begin of screen 2000 title text-004.
 
* Select-Options are built up dynamically, types with value of g_f1, g_f2, ..
* modif id is needed to set fields invisible, if the parameter is not filled
select-options: s_o1  for (g_f1)  modif id r01,
                s_o2  for (g_f2)  modif id r02,
                s_o3  for (g_f3)  modif id r03,
                s_o4  for (g_f4)  modif id r04,
                s_o5  for (g_f5)  modif id r05,
                s_o6  for (g_f6)  modif id r06,
                s_o7  for (g_f7)  modif id r07,
                s_o8  for (g_f8)  modif id r08,
                s_o9  for (g_f9)  modif id r09,
                s_o10 for (g_f10) modif id r10,
                s_o11 for (g_f11) modif id r11,
                s_o12 for (g_f12) modif id r12,
                s_o13 for (g_f13) modif id r13,
                s_o14 for (g_f14) modif id r14,
                s_o15 for (g_f15) modif id r15,
                s_o16 for (g_f16) modif id r16,
                s_o17 for (g_f17) modif id r17,
                s_o18 for (g_f18) modif id r18,
                s_o19 for (g_f19) modif id r19,
                s_o20 for (g_f20) modif id r20,
                s_o21 for (g_f21) modif id r21,
                s_o22 for (g_f22) modif id r22,
                s_o23 for (g_f23) modif id r23,
                s_o24 for (g_f24) modif id r24,
                s_o25 for (g_f25) modif id r25,
                s_o26 for (g_f26) modif id r26,
                s_o27 for (g_f27) modif id r27,
                s_o28 for (g_f28) modif id r28,
                s_o29 for (g_f29) modif id r29,
                s_o30 for (g_f30) modif id r30,
                s_o31 for (g_f31) modif id r31,
                s_o32 for (g_f32) modif id r32,
                s_o33 for (g_f33) modif id r33,
                s_o34 for (g_f34) modif id r34,
                s_o35 for (g_f35) modif id r35,
                s_o36 for (g_f36) modif id r36,
                s_o37 for (g_f37) modif id r37,
                s_o38 for (g_f38) modif id r38,
                s_o39 for (g_f39) modif id r39,
                s_o40 for (g_f40) modif id r40,
                s_o41 for (g_f41) modif id r41,
                s_o42 for (g_f42) modif id r42,
                s_o43 for (g_f43) modif id r43,
                s_o44 for (g_f44) modif id r44,
                s_o45 for (g_f45) modif id r45,
                s_o46 for (g_f46) modif id r46,
                s_o47 for (g_f47) modif id r47,
                s_o48 for (g_f48) modif id r48,
                s_o49 for (g_f49) modif id r49,
                s_o50 for (g_f50) modif id r50.
selection-screen end of screen 2000.
 
 
 
**********************
* Start-Of-Selection *
**********************
start-of-selection.
 
* Check if maintained table exist on database (in table DD02L)
  perform check_existence_table
    using p_tab.
 
* Creation of dynamically typed internal table in field-symbol <FS_TABLE>
  create data pitab type standard table of (p_tab).
  assign pitab->* to <fs_table>.
 
* Read fieldcatalog for p_tab in internal table gt_fields
  perform read_fields
    changing gt_fields.
 
* Show ALV-Grid to select fields to show them as Select-Options in Dynpro 2000
  if p_ausw = 'X'.
    perform alv_selection.
  endif.
 
* Fill global variables to type Select-Options
  perform fill_g_fields
    using gt_fields.
 
* Call selection-screen with dynamically filled Select-Options of p_tab
  call selection-screen 2000.
 
  check g_execute = 'X'.
 
* Fill dynamically Where-Condition to select data from P_TAB with Select-Options
  perform fill_where_itab
    using    gt_fields
    changing gt_where
             gt_sel.
 
* Read dynamically data from Parameter Table into Field-Symbol bable
  select *
    from (p_tab)
    into corresponding fields of table <fs_table>
    up to p_max rows
    where (gt_where).
 
* Show result in ALV-Grid
  perform alv_display.
 
 
*&---------------------------------------------------------------------
*& Form alv_display
*&---------------------------------------------------------------------
* ALV Function Mod. 'REUSE_ALV_GRID_DISPLAY'
*----------------------------------------------------------------------
form alv_display.
 
  type-pools: slis.
 
  data: l_repid type sy-repid,
        lt_fcat type slis_t_fieldcat_alv,
        ls_layout type slis_layout_alv.
 
  g_alv = 'Display'.
 
  l_repid = sy-repid.
 
***************
* Fill Layout *
***************
  ls_layout-colwidth_optimize = 'X'.
  ls_layout-info_fieldname = 'C41'.
 
  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
      i_program_name         = l_repid
      i_structure_name       = p_tab
    changing
      ct_fieldcat            = lt_fcat
    exceptions
      inconsistent_interface = 1
      program_error          = 2
      others                 = 3.
 
  if sy-subrc <> 0.
    message e208(00) with 'Error calling REUSE_ALV_FIELDCATALOG_MERGE'.
  endif.
 
 
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_interface_check        = 'I'
      i_callback_program       = l_repid
      i_callback_pf_status_set = slis_ev_pf_status_set
      i_callback_user_command  = 'USER_COMMAND'
      i_callback_top_of_page   = slis_ev_top_of_page
      is_layout                = ls_layout
      it_fieldcat              = lt_fcat
    tables
      t_outtab                 = <fs_table>
    exceptions
      program_error            = 1
      others                   = 2.
 
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.
 
 
endform.    "alv-display
 
 
*&---------------------------------------------------------------------
*& Form USER_COMMAND_SELECTION
*&---------------------------------------------------------------------
*  User-Command ALV-Grid: Delete all fields, where fields are not
*  selected
*----------------------------------------------------------------------
form user_command_selection                                 "#EC CALLED
  using r_ucomm type sy-ucomm
  rs_selfield type slis_selfield.
 
  case r_ucomm.
    when 'SAVE'.
 
      read table gt_fields with key selkz = 'X' transporting no fields.
      if sy-subrc <> 0.
        message i208(00) with 'Select at least one column'.
        exit.
      endif.
 
*     Show in Selection-Screen (Selection-Options) only marked fields
      delete gt_fields where selkz = space.
      set screen 0.
  endcase.
 
endform.                    "user_command_Selection
 
*&---------------------------------------------------------------------
*& Form USER_COMMAND
*&---------------------------------------------------------------------
*  User-Command ALV-Grid
*----------------------------------------------------------------------
form user_command                                           "#EC CALLED
  using r_ucomm type sy-ucomm
 rs_selfield type slis_selfield.
 
  data: bdcdata type standard table of bdcdata,
        wa_bdcdata type bdcdata,
        l_tabname type dd02l-tabname.
 
* Check double click
  case r_ucomm.
    when '&BACK'.
      clear g_execute.
      set screen 0.
      call selection-screen 2000.
 
      check g_execute = 'X'.
 
      clear gt_where.
 
*     Fill where-condition of selection
      perform fill_where_itab
        using    gt_fields
        changing gt_where
                 gt_sel.
 
      clear <fs_table>.
 
*     Read dynamically Data from Parameter Table into Field-Symbol Table
      select *
        from (p_tab)
        into table <fs_table>
        up to p_max rows
        where (gt_where).
 
*     Darstellung in einer ALV-Liste
      perform alv_display.
    when 'SE11'.
 
      l_tabname = p_tab.
 
*     Fill first screen of SE11
      wa_bdcdata-program = 'SAPMSRD0'.
      wa_bdcdata-dynpro = '0102'.
      wa_bdcdata-dynbegin = 'X'.
      append wa_bdcdata to bdcdata.
      clear wa_bdcdata.
 
      wa_bdcdata-fnam = 'RSRD1-TBMA'.
      wa_bdcdata-fval = 'X'.
      append wa_bdcdata to bdcdata.
      clear wa_bdcdata.
 
      wa_bdcdata-fnam = 'RSRD1-TBMA_VAL'.
      wa_bdcdata-fval = l_tabname.
      append wa_bdcdata to bdcdata.
      clear wa_bdcdata.
 
*     Fill OK-Code
      clear wa_bdcdata.
      wa_bdcdata-fnam = 'BDC_OKCODE'.
      wa_bdcdata-fval = '=SHOW'.
      append wa_bdcdata to bdcdata.
 
*     Execute SE11
      call transaction 'SE11' using bdcdata mode 'E'.
 
  endcase.
 
endform. " USER_COMMAND
 
*---------------------------------------------------------------------
*      FORM top_of_page
*---------------------------------------------------------------------
*      Fülle Header für ALV-Listen
*---------------------------------------------------------------------
form top_of_page.                                           "#EC CALLED
 
  data: listheader type slis_t_listheader,
        w_listheader type slis_listheader,
        l_datum(10) type c,
        l_lines type i.
 
  if g_alv = 'Display'.
*   Schreibe Anzahl Datensätze Reporte in Grid Titel
    describe table <fs_table> lines l_lines.
  elseif g_alv = 'Selection'.
    describe table gt_fields lines l_lines.
  endif.
 
* Datum in Ausgabeform bringen
  write sy-datum to l_datum.
 
  w_listheader-typ = 'S'.
  w_listheader-key = 'Date'.
  w_listheader-info = l_datum.
  append w_listheader to listheader.
 
  w_listheader-typ = 'S'.
  w_listheader-key = 'Number data records'.
  w_listheader-info = l_lines.
  append w_listheader to listheader.
 
  w_listheader-typ = 'S'.
  w_listheader-key = 'Selected table'.
  w_listheader-info = p_tab.
  append w_listheader to listheader.
 
  call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
      it_list_commentary = listheader.
 
 
endform.                    "top_of_page
 
 
*&--------------------------------------------------------------------*
*&      FORM  PF_STATUS_SET
*&--------------------------------------------------------------------*
*       Es wird ein neuer GUI-Status gesetzt
*---------------------------------------------------------------------*
 
* KOPIE DES STANDARDSTATUS STANDARD AUS DER FUNKTIONSGRUPPE SALV
form pf_status_set
    using rt_extab type slis_t_extab.                       "#EC CALLED
 
  if g_alv = 'Selection'.
    set pf-status 'AUSWAHL' excluding rt_extab.
  elseif g_alv = 'Display'.
    set pf-status 'STANDARD' excluding rt_extab.
  endif.
 
endform.                    "PF_STATUS_SET
 
 
*&-------------------------------------------------------------------*
*&      Form  read_fields
*&-------------------------------------------------------------------*
*       Fill field descriptions in internal table
*--------------------------------------------------------------------*
form read_fields changing p_ct_fields type tty_fields.
 
  data: lt_dfies  type standard table of dfies,
        ls_fields type ty_fields.
 
  field-symbols: <fs_dfies> type dfies.
 
* Fill field descriptions in internal table LT_DFIES
  call function 'DDIF_FIELDINFO_GET'
    exporting
      tabname        = p_tab
      langu          = sy-langu
      all_types      = 'X'
    tables
      dfies_tab      = lt_dfies
    exceptions
      not_found      = 1
      internal_error = 2
      others         = 3.
 
  if sy-subrc <> 0.
    message e208(00) with 'Error calling DDIF_FIELDINFO_GET'.
  endif.
 
* Fill important fields in internal table P_CT_FIELDS
  loop at lt_dfies assigning <fs_dfies>.
    ls_fields-tabname   = <fs_dfies>-tabname.
    ls_fields-fieldname = <fs_dfies>-fieldname.
    ls_fields-langu     = <fs_dfies>-langu.
    ls_fields-position  = <fs_dfies>-position.
    ls_fields-domname   = <fs_dfies>-domname.
    ls_fields-rollname  = <fs_dfies>-rollname.
    ls_fields-scrtext_s = <fs_dfies>-scrtext_s.
    ls_fields-scrtext_m = <fs_dfies>-scrtext_m.
    ls_fields-scrtext_l = <fs_dfies>-scrtext_l.
    check ls_fields-fieldname <> 'MANDT'.
    append ls_fields to p_ct_fields.
  endloop.
 
endform.                    " read_fields
 
 
*&-------------------------------------------------------------------*
*&      Form  fill_g_fields
*&-------------------------------------------------------------------*
*       Fill type of Select-Options-Field in global variables
*--------------------------------------------------------------------*
form fill_g_fields
    using ut_fields type tty_fields.
 
* Fill type of Select-Options-Field in global variables
  loop at ut_fields assigning <fs_fields>.
    case sy-tabix.
      when 1.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f1.
      when 2.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f2.
      when 3.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f3.
      when 4.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f4.
      when 5.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f5.
      when 6.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f6.
      when 7.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f7.
      when 8.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f8.
      when 9.
        concatenate  <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f9.
      when 10.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f10.
      when 11.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f11.
      when 12.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f12.
      when 13.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f13.
      when 14.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f14.
      when 15.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f15.
      when 16.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f16.
      when 17.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f17.
      when 18.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f18.
      when 19.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f19.
      when 20.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f20.
      when 21.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f21.
      when 22.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f22.
      when 23.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f23.
      when 24.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f24.
      when 25.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f25.
      when 26.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f26.
      when 27.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f27.
      when 28.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f28.
      when 29.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f29.
      when 30.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f30.
      when 31.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f31.
      when 32.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f32.
      when 33.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f33.
      when 34.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f34.
      when 35.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f35.
      when 36.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f36.
      when 37.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f37.
      when 38.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f38.
      when 39.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f39.
      when 40.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f40.
      when 41.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f41.
      when 42.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f42.
      when 43.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f43.
      when 44.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f44.
      when 45.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f45.
      when 46.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f46.
      when 47.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f47.
      when 48.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f48.
      when 49.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f49.
      when 50.
        concatenate <fs_fields>-tabname '-' <fs_fields>-fieldname
        into g_f50.
    endcase.
 
  endloop.
 
endform.                    " fill_g_fields
 
 
*&---------------------------------------------------------------------*
*&      Module  ausblenden_2000  OUTPUT
*&---------------------------------------------------------------------*
*       Not filled Selection-Options set to invisible
*----------------------------------------------------------------------*
module screen_output output.
  perform screen_output_2000.
endmodule.                 "screen_output  OUTPUT
 
 
*&-------------------------------------------------------------------*
*&      Form  fill_where_itab
*&-------------------------------------------------------------------*
*       Fill Where-Conding of selection
*--------------------------------------------------------------------*
form fill_where_itab
    using    ut_fields type tty_fields
    changing ct_where type tty_where
             ct_sel   type tty_sel.
 
  data: l_where type string,
        l_tabix type sy-tabix.
 
  loop at ut_fields assigning <fs_fields>.
    case sy-tabix.
      when 1.
        concatenate <fs_fields>-fieldname 'in s_o1 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 2.
        concatenate <fs_fields>-fieldname 'in s_o2 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 3.
        concatenate <fs_fields>-fieldname 'in s_o3 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 4.
        concatenate <fs_fields>-fieldname 'in s_o4 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 5.
        concatenate <fs_fields>-fieldname 'in s_o5 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 6.
        concatenate <fs_fields>-fieldname 'in s_o6 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 7.
        concatenate <fs_fields>-fieldname 'in s_o7 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 8.
        concatenate <fs_fields>-fieldname 'in s_o8 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 9.
        concatenate <fs_fields>-fieldname 'in s_o9 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 10.
        concatenate <fs_fields>-fieldname 'in s_o10 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 11.
        concatenate <fs_fields>-fieldname 'in s_o11 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 12.
        concatenate <fs_fields>-fieldname 'in s_o12 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 13.
        concatenate <fs_fields>-fieldname 'in s_o13 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 14.
        concatenate <fs_fields>-fieldname 'in s_o14 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 15.
        concatenate <fs_fields>-fieldname 'in s_o15 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 16.
        concatenate <fs_fields>-fieldname 'in s_o16 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 17.
        concatenate <fs_fields>-fieldname 'in s_o17 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 18.
        concatenate <fs_fields>-fieldname 'in s_o18 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 19.
        concatenate <fs_fields>-fieldname 'in s_o19 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 20.
        concatenate <fs_fields>-fieldname 'in s_o20 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 21.
        concatenate <fs_fields>-fieldname 'in s_o21 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 22.
        concatenate <fs_fields>-fieldname 'in s_o22 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 23.
        concatenate <fs_fields>-fieldname 'in s_o23 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 24.
        concatenate <fs_fields>-fieldname 'in s_o24 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 25.
        concatenate <fs_fields>-fieldname 'in s_o25 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 26.
        concatenate <fs_fields>-fieldname 'in s_o26 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 27.
        concatenate <fs_fields>-fieldname 'in s_o27 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 28.
        concatenate <fs_fields>-fieldname 'in s_o28 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 29.
        concatenate <fs_fields>-fieldname 'in s_o29 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 30.
        concatenate <fs_fields>-fieldname 'in s_o30 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 31.
        concatenate <fs_fields>-fieldname 'in s_o31 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 32.
        concatenate <fs_fields>-fieldname 'in s_o32 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 33.
        concatenate <fs_fields>-fieldname 'in s_o33 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 34.
        concatenate <fs_fields>-fieldname 'in s_o34 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 35.
        concatenate <fs_fields>-fieldname 'in s_o35 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 36.
        concatenate <fs_fields>-fieldname 'in s_o36 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 37.
        concatenate <fs_fields>-fieldname 'in s_o37 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 38.
        concatenate <fs_fields>-fieldname 'in s_o38 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 39.
        concatenate <fs_fields>-fieldname 'in s_o39 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 40.
        concatenate <fs_fields>-fieldname 'in s_o40 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 41.
        concatenate <fs_fields>-fieldname 'in s_o41 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 42.
        concatenate <fs_fields>-fieldname 'in s_o42 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 43.
        concatenate <fs_fields>-fieldname 'in s_o43 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 44.
        concatenate <fs_fields>-fieldname 'in s_o44 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 45.
        concatenate <fs_fields>-fieldname 'in s_o45 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 46.
        concatenate <fs_fields>-fieldname 'in s_o46 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 47.
        concatenate <fs_fields>-fieldname 'in s_o47 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 48.
        concatenate <fs_fields>-fieldname 'in s_o48 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 49.
        concatenate <fs_fields>-fieldname 'in s_o49 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
 
      when 50.
        concatenate <fs_fields>-fieldname 'in s_o50 and'
                    into l_where
                    separated by space.
        append l_where to ct_where.
        append <fs_fields>-fieldname to ct_sel.
        exit.
 
    endcase.
    l_tabix = sy-tabix.
  endloop.
 
  replace 'and' in l_where with '.'.
 
  modify ct_where index l_tabix from l_where.
 
endform.                    " fill_where_itab
 
*&-------------------------------------------------------------------*
*&      Module  execute  INPUT
*&-------------------------------------------------------------------*
*       Set variable to recognize if program will be executed
*--------------------------------------------------------------------*
module execute input.
  if sy-ucomm = 'CRET'.
    g_execute = 'X'.
  endif.
endmodule.                 " break_point  INPUT
 
 
*&-------------------------------------------------------------------*
*&      Form  alv_Selection
*&-------------------------------------------------------------------*
*       Selection fields in selection-screen
*--------------------------------------------------------------------*
form alv_selection.
 
  type-pools: slis.
 
  data: l_repid type sy-repid,
        ls_fcat type slis_fieldcat_alv,
        lt_fcat type slis_t_fieldcat_alv,
        ls_layout type slis_layout_alv.
 
* Set global Variant for Top-Of-Page of ALV-Grid
  g_alv = 'Selection'.
 
  l_repid = sy-repid.
 
***************
* Fill Layout *
***************
  ls_layout-colwidth_optimize = 'X'.
  ls_layout-info_fieldname    = 'C41'.
  ls_layout-box_fieldname     = 'SELKZ'.
  ls_layout-box_rollname      = 'SELKZ'.
 
*********************
* Fill fieldcatalog *
*********************
* Field = Fieldname
  ls_fcat-fieldname   = 'FIELDNAME'.
  ls_fcat-key         = 'X'.
  ls_fcat-seltext_m   = 'Fieldname'.
  append ls_fcat to lt_fcat.
  clear ls_fcat.
 
* Field = Text medium length
  ls_fcat-fieldname = 'SCRTEXT_M'.
  ls_fcat-seltext_m = 'Description'.
  ls_fcat-emphasize = 'C300'.
  append ls_fcat to lt_fcat.
  clear ls_fcat.
 
* Field = Data element
  ls_fcat-fieldname = 'ROLLNAME'.
  ls_fcat-seltext_m = 'Data Element'.
  append ls_fcat to lt_fcat.
  clear ls_fcat.
 
* Field = Domain name
  ls_fcat-fieldname = 'DOMNAME'.
  ls_fcat-seltext_m = 'Domain Name'.
  append ls_fcat to lt_fcat.
  clear ls_fcat.
 
 
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = l_repid
      i_callback_pf_status_set = slis_ev_pf_status_set
      i_callback_user_command  = 'USER_COMMAND_SELECTION'
      i_callback_top_of_page   = slis_ev_top_of_page
      is_layout                = ls_layout
      it_fieldcat              = lt_fcat
    tables
      t_outtab                 = gt_fields
    exceptions
      program_error            = 1
      others                   = 2.
 
  if sy-subrc <> 0.
    message i208(00) with 'Error calling REUSE_ALV_GRID_DISPLAY'.
  endif.
 
endform.                    " alv_Selection
 
 
*&---------------------------------------------------------------------*
*&      Form  check_existence_table
*&---------------------------------------------------------------------*
*       Check existence of maintained table
*----------------------------------------------------------------------*
form check_existence_table
  using p_i_tab type dd02l-tabname.
 
  data: l_tabname type dd02l-tabname.
 
  select single
    tabname
    into l_tabname
    from dd02l
    where tabname = p_i_tab
     and  as4local = 'A'
     and  as4vers  = 0
     and  tabclass in ('TRANSP', 'CLUSTER', 'POOL').
 
  if sy-subrc <> 0.
    message i001(rscv) with 'Table'
                          p_i_tab
                          'does not exist'.
    leave list-processing.
  endif.
 
endform.                    " check_existence_table
 
 
*&---------------------------------------------------------------------*
*&      Form  screen_output_2000
*&---------------------------------------------------------------------*
*       Not filled Selection-Options set to invisible
*----------------------------------------------------------------------*
form screen_output_2000 .
 
  loop at screen.
    case screen-group1.
      when 'R01'.
        if g_f1 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R02'.
        if g_f2 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R03'.
        if g_f3 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R04'.
        if g_f4 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R05'.
        if g_f5 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R06'.
        if g_f6 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R07'.
        if g_f7 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R08'.
        if g_f8 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R09'.
        if g_f9 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R10'.
        if g_f10 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R11'.
        if g_f11 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R12'.
        if g_f12 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R13'.
        if g_f13 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R14'.
        if g_f14 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R15'.
        if g_f15 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R16'.
        if g_f16 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R17'.
        if g_f17 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R18'.
        if g_f18 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R19'.
        if g_f19 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R20'.
        if g_f20 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R21'.
        if g_f21 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R22'.
        if g_f22 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R23'.
        if g_f23 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R24'.
        if g_f24 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R25'.
        if g_f25 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R26'.
        if g_f26 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R27'.
        if g_f27 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R28'.
        if g_f28 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R29'.
        if g_f29 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R30'.
        if g_f30 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R31'.
        if g_f31 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R32'.
        if g_f32 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R33'.
        if g_f33 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R34'.
        if g_f34 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R35'.
        if g_f35 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R36'.
        if g_f36 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R37'.
        if g_f37 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R38'.
        if g_f38 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R39'.
        if g_f39 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R40'.
        if g_f40 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R41'.
        if g_f41 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R42'.
        if g_f42 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R43'.
        if g_f43 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R44'.
        if g_f44 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R45'.
        if g_f45 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R46'.
        if g_f46 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R47'.
        if g_f47 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R48'.
        if g_f48 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R49'.
        if g_f49 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
      when 'R50'.
        if g_f50 <> space.
          screen-active = 1.
        else.
          screen-active = 0.
        endif.
    endcase.
    modify screen.
  endloop.
 
endform.                    " screen_output_2000