-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathzsysrec_notelist_72_sp08.prog.abap
4417 lines (3799 loc) · 151 KB
/
zsysrec_notelist_72_sp08.prog.abap
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
*----------------------------------------------------------------------*
* This report is used to verify results from the application System
* Recommendations and to experiment with new features.
*----------------------------------------------------------------------*
*-----------------------------------------------------------------------
* Author: Frank Buchholz, SAP CoE Security Services
* Source: https://github.com/SAP-samples/security-services-tools
* Documentation:
* https://blogs.sap.com/2011/07/18/report-zsysrecnotelist-show-results-of-system-recommendation/
* https://community.sap.com/t5/application-development-blog-posts/report-zsysrec-notelist-show-results-of-system-recommendation/ba-p/13006390
*
* 28.03.2024 Restrict the size of the header (important for backgroud processing)
* 18.04.2023 Customizing SYSREC_MAX_RFC_TIME deactivatied, was added to AGSSN on 18.11.2022
* 17.02.2023 Some ABAPlint corrections, optimized value help
* 28.02.2019 perform DISPLAY_NOTE_TEXT updated for ST-A/PI Release 01T_731, SP 1
* 06.08.2018 Separation between SAP and user status
* 17.04.2018 Prepare for License Audit notes
* 07.08.2017 Show customizing
* 27.07.2017 Call /SDF/SCSI_GET_HARDWARE_INFO instead of SCSI_GET_HARDWARE_INFO
* 28.06.2017 Show Side-Effect Notes
* 06.12.2016 Initial version
* to do:
* - Use function AGSNO_GET_SFW_COMPS for ABAP to get active switched components
* - Use favorite within selection (not after reading the data)
*
*tables:
* AGSSR_CONFSYS " SysRec: Technical system (system + type)
* AGSSR_SYSNOTE " SysRec: Notes
* AGSSR_SYSNOTECI " SysRec: Correction instructions of notes
* AGSSR_SYSNOTES " SysRec: Latest note status
* New fields as of SolMan 7.2 SP 7 (see Class CL_AGS_SYSREC_DPC_EXT Method SYSTEMNOTECOMMEN_CREATE_ENTITY ):
* LAST_SSTATUS
* LAST_SUSER
* FLAG_REVIEW
* OLD_SSTATUS
* AGSSR_SYSNOTEC " SysRec: Note comments
* AGSSR_STATUS " SysRec: Status
* AGSSR_NOTE " Notes: Header
* AGSSR_NOTECIO " Notes: Object list
* AGSSR_NOTECIP " Notes: Required notes
* AGSSR_NOTESD " Notes: Side Effect Notes
* AGSSR_NOTEAUDITA " Notes: License Audit C_LAW, EMC, EMD, MTI, RFC_RT SM_USMM, [...]
*-----------------------------------------------------------------------
report RSYSREC_NOTELIST
message-id AGSNO_MESSAGE
line-size 1023.
constants C_PROGRAM_VERSION(30) type C value '28.03.2024 FBT'.
type-pools AGSNO.
type-pools: ICON, COL, SYM.
*----------------------------------------------------------------------*
tables SSCRFIELDS.
selection-screen: function key 1, "System Recommendations
function key 2, "Status Customizing
function key 3, "Joblist
function key 4, "Application log
function key 5. "BW Query
* FUNCTION KEY 6. "Show configuration
* Definitions for select-options
data: SL_SYS type AGSSR_CONFSYS-SYSTEM_NAME,
SL_TYPE type AGSSR_CONFSYS-SYSTEM_TYPE,
SL_NOTE type AGSSR_NOTE-NOTE_NUMBER,
SL_PRIO type AGSSR_NOTE-PRIORITY,
SL_STAT type AGSSR_STATUS-STATUS_ID,
SL_THEMK type AGSNOTE_API_S_THEMK-THEMK,
SL_COMP type AGSNO_API_S_COMPVERS-COMPONENT.
selection-screen begin of block SYS with frame title TEXT001.
* System name
selection-screen begin of line.
selection-screen comment 1(25) SS_SYS for field S_SYS.
select-options S_SYS for SL_SYS.
selection-screen end of line.
* System type
selection-screen begin of line.
selection-screen comment 1(25) SS_TYPE for field S_TYPE.
select-options S_TYPE for SL_TYPE.
selection-screen end of line.
* Favorite
selection-screen begin of line.
selection-screen comment 1(28) SS_FAVO for field S_FAVO.
parameters S_FAVO as checkbox. " System Favorite
selection-screen end of line.
selection-screen end of block SYS.
selection-screen begin of block NS with frame title TEXT002.
* Note
selection-screen begin of line.
selection-screen comment 1(25) SS_NOTE for field S_NOTE.
select-options S_NOTE for SL_NOTE.
selection-screen end of line.
* Priority
selection-screen begin of line.
selection-screen comment 1(25) SS_PRIO for field S_PRIO.
select-options S_PRIO for SL_PRIO.
selection-screen end of line.
* Application Component
selection-screen begin of line.
selection-screen comment 1(25) SS_THEMK for field S_THEMK.
select-options S_THEMK for SL_THEMK
matchcode object H_AKH_COMP. " AGS_AKH_COMPONENT or H_AKH_COMP or H_AKH_COMPONENT
selection-screen end of line.
* Software Component
selection-screen begin of line.
selection-screen comment 1(25) SS_COMP for field S_COMP.
select-options S_COMP for SL_COMP matchcode object H_CVERS.
selection-screen end of line.
* Release date from
selection-screen begin of line.
selection-screen comment 1(28) SS_FROM for field S_FROM.
parameters S_FROM type SY-DATUM.
selection-screen end of line.
* Release date to
selection-screen begin of line.
selection-screen comment 1(28) SS_TO for field S_TO.
parameters S_TO type SY-DATUM. " default sy-datum.
selection-screen end of line.
selection-screen end of block NS.
selection-screen begin of block SR with frame title TEXT004.
* User status
selection-screen begin of line.
selection-screen comment 1(25) SS_STAT for field S_STAT.
select-options S_STAT for SL_STAT.
selection-screen end of line.
selection-screen end of block SR.
selection-screen begin of block NT with frame title TEXT003.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP1 for field S_GROUP1.
parameters S_GROUP1 as checkbox default 'X'. " Security notes
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP2 for field S_GROUP2.
parameters S_GROUP2 as checkbox. " Hot News
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP3 for field S_GROUP3.
parameters S_GROUP3 as checkbox. " Performance notes
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP4 for field S_GROUP4.
parameters S_GROUP4 as checkbox. " Legal change notes
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP6 for field S_GROUP6.
parameters S_GROUP6 as checkbox. " License Audit relevant notes
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(28) SS_GRP5 for field S_GROUP5.
parameters S_GROUP5 as checkbox. " Correction notes
selection-screen end of line.
*selection-screen begin of line.
*SELECTION-SCREEN COMMENT 1(29) ss_grp6 for field s_group6.
*parameters s_group6 as checkbox. " Java patch notes
*selection-screen end of line.
selection-screen end of block NT.
** Check RFC destination to managed system (ABAP)
*SELECTION-SCREEN BEGIN OF LINE.
*PARAMETERS p_RFC AS CHECKBOX default space.
*SELECTION-SCREEN COMMENT 3(31) ps_RFC FOR FIELD p_RFC.
*SELECTION-SCREEN END OF LINE.
* Check implemented notes and Kernel via RFC
selection-screen begin of line.
selection-screen comment 1(30) PS_RFC for field P_RFC.
parameters P_RFC as checkbox default 'X'.
selection-screen comment 36(60) PS_RFC1 for field P_RFC.
selection-screen end of line.
* Get required notes
selection-screen begin of line.
selection-screen comment 1(30) PS_REQ for field P_REQ.
parameters P_REQ as checkbox default ' '.
selection-screen comment 36(60) PS_REQ1 for field P_REQ.
selection-screen end of line.
* Get side effect notes
selection-screen begin of line.
selection-screen comment 1(30) PS_SD for field P_SD.
parameters P_SD as checkbox default ' '.
selection-screen comment 36(60) PS_SD1 for field P_SD.
selection-screen end of line.
* Count of month for which UPL data get loaded (2)
selection-screen begin of line.
selection-screen comment 1(30) PS_UPL for field P_UPL.
parameters P_UPL(3) type N default 2.
selection-screen end of line.
* Layout of ALV output
selection-screen begin of line.
selection-screen comment 1(30) PS_LOUT for field P_LAYOUT.
parameters P_LAYOUT type DISVARIANT-VARIANT.
selection-screen end of line.
* Omit system list in header
selection-screen begin of line.
selection-screen comment 1(30) PS_HDR for field P_HDR.
parameters P_HDR as checkbox default ' '.
selection-screen end of line.
* Show configuration status
selection-screen begin of line.
selection-screen comment 1(30) PS_STAT1. " for field PS_STAT.
selection-screen pushbutton 32(40) PS_STAT user-command FC06 visible length 4.
parameters P_FC06(1) type C." no-display.
selection-screen end of line.
* Customizing table DNOC_USERCFG, Transaction SM30_DNOC_USERCFG_SR
selection-screen begin of line.
selection-screen comment 1(30) PS_DNOC1. " for field PS_DNOC.
selection-screen pushbutton 32(40) PS_DNOC user-command FC07 visible length 4.
parameters P_FC07(1) type C no-display.
selection-screen end of line.
* Customizing table AGSSR_OSDB, Transaction SM30_AGSSR_OSDB
selection-screen begin of line.
selection-screen comment 1(30) PS_OSDB1. " for field PS_OSDB.
selection-screen pushbutton 32(40) PS_OSDB user-command FC08 visible length 4.
parameters P_FC08(1) type C no-display.
selection-screen end of line.
* Show note user status and comments
selection-screen begin of line.
selection-screen comment 1(30) PS_COM1. " for field PS_COM.
selection-screen pushbutton 32(40) PS_COM user-command FC09 visible length 4.
parameters P_FC09(1) type C no-display.
selection-screen end of line.
selection-screen comment 1(60) SS_VERS.
*----------------------------------------------------------------------*
types:
* The order of the fields defines the order of columns of the ALV
begin of TS_NOTELIST, "based on type agsno_api_s_note
SYSTEM_NAME type AGSSR_CONFSYS-SYSTEM_NAME,
SYSTEM_TYPE type AGSSR_CONFSYS-SYSTEM_TYPE,
SYSTEM_ROLE type AGS_SR_S_LMDB_SYSTEM-ROLE,
SYSTEM_ROLE_TEXT type DD07T-DDTEXT,
SYSTEM_PRIORITY type AGS_SR_S_LMDB_SYSTEM-PRIORITY,
SYSTEM_PRIORITY_TEXT type DD07T-DDTEXT, "AGSSR_PRIORITY-PI_STEXT,
NOTE_NUMBER type AGSSR_NOTE-NOTE_NUMBER,
NOTE_VERSION type AGSSR_NOTE-NOTE_VERSION,
SHORT_TEXT type AGSSR_TNOTE-SHORT_TEXT,
THEMK type AGSSR_NOTE-THEMK, "agsno_api_s_note-themk,
THEMK_TEXT type AGSSR_THEMK-TK_LTEXT, "agsno_api_s_note-themk_text,
PRIORITY_ID type AGSSR_NOTE-PRIORITY,
PRIORITY type AGSSR_PRIORITY-PI_STEXT,
CATEGORY_ID type AGSSR_NOTE-CATEGORY,
CATEGORY type AGSSR_CATEGORY-CT_STEXT,
DISPLAY_URL type AGSNO_API_S_NOTE-DISPLAY_URL,
NOTEURL type S_URL, " t_hyperlink
RELEASE_DATE type AGSSR_NOTE-RELEASE_DATE,
SW_COMP_TBL type AGSNO_API_S_NOTE-SW_COMP_TBL,
* latest status and comment
SSTATUS type AGSSR_STATUS-STATUS_ID, "agsno_api_s_note-status,
SSTATUS_TEXT type AGSSR_STATUS-STATUS_TEXT,
* sstatus_ltext TYPE AGSSR_STATUS-STATUS_LTEXT,
SUSER type AGSSR_SYSNOTES-LAST_SUSER,
* latest status and comment
STATUS type AGSSR_STATUS-STATUS_ID, "agsno_api_s_note-status,
STATUS_TEXT type AGSSR_STATUS-STATUS_TEXT,
* status_ltext TYPE AGSSR_STATUS-STATUS_LTEXT,
USER type AGSSR_SYSNOTES-LAST_USER,
COMMENT_CREATED_AT(19) type C, " type AGSSR_SYSNOTEC-CREATED_AT,
LATEST_COMMENT type AGSSR_SYSNOTEC-COMMENT_TEXT,
* latest user status and comment
USER_STATUS type AGSSR_STATUS-STATUS_ID, "agsno_api_s_note-status,
USER_STATUS_TEXT type AGSSR_STATUS-STATUS_TEXT,
* user_status_ltext TYPE AGSSR_STATUS-STATUS_LTEXT,
USER_COMMENT_BY type AGSSR_SYSNOTES-LAST_USER,
USER_COMMENT_CREATED_AT(19) type C, " type AGSSR_SYSNOTEC-CREATED_AT,
USER_LATEST_COMMENT type AGSSR_SYSNOTEC-COMMENT_TEXT,
PROC_STATUS type AGS_SR_S_IMPL_NOTE-PROC_STATUS,
IMPL_STATUS type AGS_SR_S_IMPL_NOTE-IMPL_STATUS, "AGSNO_API_S_NOTE-IMPL_STATUS,
IMPL_NOTE_VERSION type AGS_SR_S_IMPL_NOTE-NOTE_VERSION, "AGSNO_API_S_NOTE-IMPL_VERSION,
AUTO type FLAG, "agsno_api_s_note-a,
M type FLAG, "agsno_api_s_note-m,
PRE type FLAG,
POST type FLAG,
MANUAL type FLAG,
SPN type AGSNO_API_S_NOTE-SPN,
IS_KERNEL type AGSNO_API_S_NOTE-IS_KERNEL,
KERN_REL(3) type C, "see include LSHSYTOP - KINFOSTRUC-KERNEL_RELEASE
KERN_PATCHLEVEL(5) type C, "see include LSHSYTOP - KINFOSTRUC-KERNEL_PATCH_LEVEL
IS_INDEP type AGSSR_NOTE-IS_INDEP,
REQUIRED_NOTES type STRING,
SIDEEFFECT_NOTES type STRING,
SEC_CATEGORY type AGSSR_NOTE-SEC_CATEGORY,
SEC_CATEGORY_TEXT type AGSSR_SEC_CAT-SC_STEXT,
* SEC_CATEGORY_LTEXT TYPE AGSSR_SEC_CAT-SC_LTEXT,
AUDIT_ATTRIBUTE type AGSSR_NOTEAUDITA-AUDIT_ATTRIBUTE,
AUDIT_ATTRIBUTE_TEXT type STRING,
NOTE_TYPE_S type C, " Security
NOTE_TYPE_H type C, " HotNews
NOTE_TYPE_P type C, " Performance
NOTE_TYPE_L type C, " Legal
NOTE_TYPE_A type C, " License Audit
NOTE_TYPE_C type C, " Correction
* t_color type lvc_t_scol,
* t_celltype type salv_t_int4_column,
T_HYPERLINK type SALV_T_INT4_COLUMN,
* t_dropdown type salv_t_int4_column,
end of TS_NOTELIST,
TT_NOTELIST type table of TS_NOTELIST
with key SYSTEM_NAME SYSTEM_TYPE NOTE_NUMBER NOTE_VERSION.
* Global data table for ALV
data: GT_NOTELIST type TT_NOTELIST.
types:
begin of TS_URLS_FOR_NOTES,
HANDLE type SALV_DE_HYPERLINK_HANDLE,
NOTENUM type AGSSR_NOTE-NOTE_NUMBER, "CWBNTSTEXT,
NOTEURL type SERVICE_RL,
end of TS_URLS_FOR_NOTES,
TT_URLS_FOR_NOTES type sorted table of TS_URLS_FOR_NOTES
with unique key NOTENUM.
data: LT_URLS_FOR_NOTES type TT_URLS_FOR_NOTES,
LT_T_HYPERLINK type SALV_T_INT4_COLUMN,
LS_T_HYPERLINK type SALV_S_INT4_COLUMN.
data GS_ALV_LOUT_VARIANT type DISVARIANT.
*----------------------------------------------------------------------*
initialization.
data FUNCTXT type SMP_DYNTXT.
FUNCTXT-ICON_ID = ICON_WD_APPLICATION.
FUNCTXT-QUICKINFO = 'System Recommendations'(001).
FUNCTXT-ICON_TEXT = 'SysRec'(002).
SSCRFIELDS-FUNCTXT_01 = FUNCTXT.
FUNCTXT-ICON_ID = ICON_TOOLS.
FUNCTXT-QUICKINFO = 'Status Customizing'(003).
FUNCTXT-ICON_TEXT = 'Status Customizing'(004).
SSCRFIELDS-FUNCTXT_02 = FUNCTXT.
FUNCTXT-ICON_ID = ICON_BACKGROUND_JOB. "ICON_JOB ICON_JOB_DETAIL
FUNCTXT-QUICKINFO = 'Job list'(034).
FUNCTXT-ICON_TEXT = 'List'(035).
SSCRFIELDS-FUNCTXT_03 = FUNCTXT.
FUNCTXT-ICON_ID = ICON_PROTOCOL. "ICON_ERROR_PROTOCOL
FUNCTXT-QUICKINFO = 'Application log'(040).
FUNCTXT-ICON_TEXT = 'Appl.Log'(041).
SSCRFIELDS-FUNCTXT_04 = FUNCTXT.
FUNCTXT-ICON_ID = ICON_BW_REPORT_SAP. "ICON_QUERY.
FUNCTXT-QUICKINFO = 'BW Query'(045).
FUNCTXT-ICON_TEXT = 'BW Query'(046).
SSCRFIELDS-FUNCTXT_05 = FUNCTXT.
* We only have 5 selection screen function buttons
* functxt-icon_id = ICON_STATUS_OVERVIEW.
* functxt-quickinfo = 'Show configuration'(043).
* functxt-icon_text = 'Show Config'(044).
* sscrfields-functxt_06 = functxt.
* functxt-icon_id = ICON_SYSTEM_SETTINGS. "or ICON_SETTINGS or ICON_PARAMETER
* functxt-quickinfo = 'Customizing'(089).
* functxt-icon_text = 'Customizing table DNOC_USERCFG'(090).
* sscrfields-functxt_07 = functxt.
TEXT001 = 'Systems'(005).
SS_SYS = 'System'(006).
SS_TYPE = 'System type'(007).
SS_FAVO = 'System Favorites only'(065).
TEXT002 = 'Notes'(008).
SS_NOTE = 'Note'(009).
SS_PRIO = 'Priority'(010).
SS_THEMK = 'Application area'(011).
SS_COMP = 'Software component'(012).
SS_FROM = 'Released from date'(014).
SS_TO = 'Released to date'(015).
TEXT004 = 'System Recommendations'(001).
SS_STAT = 'Status'(016).
TEXT003 = 'Note types'(017).
SS_GRP1 = 'Security notes'(018).
SS_GRP2 = 'HotNews'(019).
SS_GRP3 = 'Performance notes'(020).
SS_GRP4 = 'Legal change notes'(021).
SS_GRP6 = 'License Audit relevant notes'(103).
SS_GRP5 = 'Correction notes'(023).
* SS_GRP6 = 'Java Patch notes'(028).
PS_RFC = 'Check managed system via RFC'(082).
PS_RFC1 = 'SolMan-READ destination is used'(091).
* ps_RFC = 'Check RFC destination (ABAP)'(037).
PS_REQ = 'Get required notes (ABAP)'(092).
PS_REQ1 = '(might be slow)'(093).
PS_SD = 'Get side effect notes (ABAP)'(094).
PS_SD1 = '(might be slow)'(095).
PS_UPL = '# month to read UPL data'(042).
PS_STAT = ICON_STATUS_OVERVIEW. "'STAT'.
PS_STAT1 = 'Show configuration status'(043).
clear P_FC06.
PS_LOUT = 'Layout'(t18).
PS_HDR = 'Omit system list in header'(094).
PS_DNOC = ICON_SYSTEM_SETTINGS. " ICON_SYSTEM_SETTINGS or ICON_SETTINGS or ICON_PARAMETER (see report RSTXICON)
PS_DNOC1 = 'Customizing table DNOC_USERCFG'(090). "'Customizing'(089)
clear P_FC07.
PS_OSDB = ICON_SETTINGS. " ICON_SYSTEM_SETTINGS or ICON_SETTINGS or ICON_PARAMETER (see report RSTXICON)
PS_OSDB1 = 'Customizing table AGSSR_OSDB'(022). "'Customizing'(089)
clear P_FC08.
* Show note user status and comments
PS_COM = ICON_LIST. " ICON_LIST or ICON_VIEW_LIST (see report RSTXICON)
PS_COM1 = 'Show note user status and comments'.
clear P_FC09.
concatenate 'Program version:'(VER) C_PROGRAM_VERSION into SS_VERS
separated by SPACE.
* SysRec: Count of month for which UPL data get loaded (default = 2)
data: L_MONTH_CNT_C(3) type C.
* get parameter id 'SYSREC_UPL_MONTH' field L_MONTH_CNT_C.
L_MONTH_CNT_C = CL_AGS_SYSREC_CONFIG=>GET_UPL_CHECKED_MONTH( ).
* if SY-SUBRC = 0.
P_UPL = L_MONTH_CNT_C.
* endif.
* Get System Roles
data GT_SYSTEM_ROLES type AGS_SR_T_KV.
call function 'AGSNO_GET_ROLE'
importing
ROLE = GT_SYSTEM_ROLES.
* Get System Priorities
data GT_SYSTEM_PRIORITIES type AGS_SR_T_KV.
call function 'AGSNO_GET_PRIORITY'
importing
PRIORITY = GT_SYSTEM_PRIORITIES.
*----------------------------------------------------------------------*
at selection-screen.
data: LS_BDC type BDCDATA,
LT_BDC type table of BDCDATA,
L_DATE like SY-DATUM,
L_DATUM_C(10).
case SSCRFIELDS-UCOMM.
when 'FC01'.
* System Recommendations
perform CALL_URL
using '/sap/bc/ui5_ui5' " Application
'/ui2/ushell/shells/abap/FioriLaunchpad.html' " Service: Fiori Launchpad
'#Action-UISMMySAPNotes' " Action: System Recommendations
ABAP_TRUE. " Add sap-client
when 'FC02'.
* System Recommendations Customizing
call function 'VIEW_MAINTENANCE_CALL'
exporting
ACTION = 'U' "Update
* CORR_NUMBER = ' '
* GENERATE_MAINT_TOOL_IF_MISSING = ' '
* SHOW_SELECTION_POPUP = ' '
VIEW_NAME = 'AGSSR_STATUS'
NO_WARNING_FOR_CLIENTINDEP = 'X'
* RFC_DESTINATION_FOR_UPGRADE = ' '
* CLIENT_FOR_UPGRADE = ' '
* VARIANT_FOR_SELECTION = ' '
* COMPLEX_SELCONDS_USED = ' '
CHECK_DDIC_MAINFLAG = 'X'
* SUPPRESS_WA_POPUP = ' '
* TABLES
* DBA_SELLIST =
* EXCL_CUA_FUNCT =
exceptions
CLIENT_REFERENCE = 1
FOREIGN_LOCK = 2
INVALID_ACTION = 3
NO_CLIENTINDEPENDENT_AUTH = 4
NO_DATABASE_FUNCTION = 5
NO_EDITOR_FUNCTION = 6
NO_SHOW_AUTH = 7
NO_TVDIR_ENTRY = 8
NO_UPD_AUTH = 9
ONLY_SHOW_ALLOWED = 10
SYSTEM_FAILURE = 11
UNKNOWN_FIELD_IN_DBA_SELLIST = 12
VIEW_NOT_FOUND = 13
MAINTENANCE_PROHIBITED = 14
others = 15.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
when 'FC03'.
* Show job log
* call function 'AUTHORITY_CHECK_TCODE'
* exporting
* TCODE = 'SM37'
* exceptions
* OK = 0
* NOT_OK = 2
* others = 3.
* if SY-SUBRC <> 0.
* message S119(ED) with 'SM37'.
* RETURN.
* endif.
clear: LS_BDC, LT_BDC.
LS_BDC-PROGRAM = 'SAPLBTCH'.
LS_BDC-DYNPRO = '2170'.
LS_BDC-DYNBEGIN = 'X'.
LS_BDC-FNAM = 'BTCH2170-JOBNAME'.
LS_BDC-FVAL = 'SM:SYSTEM RECOMMENDATIONS'.
append LS_BDC to LT_BDC.
LS_BDC-DYNBEGIN = ' '.
LS_BDC-FNAM = 'BTCH2170-USERNAME'.
LS_BDC-FVAL = '*'.
append LS_BDC to LT_BDC.
L_DATE = SY-DATUM - 90.
write L_DATE to L_DATUM_C dd/mm/yyyy.
LS_BDC-FNAM = 'BTCH2170-FROM_DATE'.
LS_BDC-FVAL = L_DATUM_C.
append LS_BDC to LT_BDC.
L_DATE = SY-DATUM + 30.
write L_DATE to L_DATUM_C dd/mm/yyyy.
LS_BDC-FNAM = 'BTCH2170-TO_DATE'.
LS_BDC-FVAL = L_DATUM_C.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-PRELIM'. "Scheduled
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-SCHEDUL'. "Released
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-READY'. "Ready
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-RUNNING'. "Active
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-FINISHED'. "Finished
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
LS_BDC-FNAM = 'BTCH2170-ABORTED'. "Canceled
LS_BDC-FVAL = 'X'.
append LS_BDC to LT_BDC.
* ls_bdc-FNAM = 'OKCODE'. "Submit
* ls_bdc-FVAL = 'DOIT'.
* append ls_bdc to lt_bdc.
try.
call transaction 'SM37' WITH AUTHORITY-CHECK
using LT_BDC.
catch cx_sy_authorization_error.
message S119(ED) with 'SM37'.
RETURN.
endtry.
when 'FC04'.
* Show application log
* call function 'AUTHORITY_CHECK_TCODE'
* exporting
* TCODE = 'SLG1'
* exceptions
* OK = 0
* NOT_OK = 2
* others = 3.
* if SY-SUBRC <> 0.
* message S119(ED) with 'SLG1'.
* RETURN.
* endif.
clear: LS_BDC, LT_BDC.
LS_BDC-PROGRAM = 'SAPLSLG3'.
LS_BDC-DYNPRO = '0100'.
LS_BDC-DYNBEGIN = 'X'.
LS_BDC-FNAM = 'BALHDR-OBJECT'.
LS_BDC-FVAL = 'AGS_SR'.
append LS_BDC to LT_BDC.
LS_BDC-DYNBEGIN = ' '.
L_DATE = SY-DATUM - 90.
write L_DATE to L_DATUM_C dd/mm/yyyy.
LS_BDC-FNAM = 'BALHDR-ALDATE'.
LS_BDC-FVAL = L_DATUM_C.
append LS_BDC to LT_BDC.
L_DATE = SY-DATUM.
write L_DATE to L_DATUM_C dd/mm/yyyy.
LS_BDC-FNAM = '*BALHDR-ALDATE'.
LS_BDC-FVAL = L_DATUM_C.
append LS_BDC to LT_BDC.
* ls_bdc-FNAM = 'OK_CODE'. "Submit
* ls_bdc-FVAL = 'SELE'.
* append ls_bdc to lt_bdc.
try.
call transaction 'SLG1' WITH AUTHORITY-CHECK
using LT_BDC.
catch cx_sy_authorization_error.
message S119(ED) with 'SLG1'.
RETURN.
endtry.
when 'FC05'.
* Call BW query
data: L_T_URL type TIHTTPURLS2,
L_S_URL type line of TIHTTPURLS2,
L_URL type STRING.
clear L_T_URL.
call function 'HTTP_GET_URL2'
* DESTINATION 'NONE'
exporting
HANDLERCLASS = 'CL_RSR_WWW_HTTP'
importing
URLLIST = L_T_URL
exceptions
others = 0.
read table L_T_URL into L_S_URL index 1. "1=http, 2=https
if SY-SUBRC = 0.
* concatenate
* L_S_URL-PROTOCOL '://' L_S_URL-HOST ':' L_S_URL-PORT
* L_S_URL-URL "/sap/bw/BEx
* '?QUERY=' '0SMD_VCA2_SYS_RECOM_NOTES'
* '&CMD=PROCESS_VARIABLES&VARIABLE_SCREEN=X' "Show selection screen
** '&VAR_NAME_1=' <name> "Selection Variable Name
** '&VAR_VALUE_EXT_1=' <value> "Selection Variable Name value
** '&VAR_OPERATOR_1=' <value>
** '&VAR_SIGN_1=' <value>
** '&VAR_VALUE_LOW_EXT_1=' <value>
** '&VAR_VALUE_HIGH_EXT_1=' <value>
** '&SAP-LANGUAGE=' <language>
* into L_URL.
* call method CL_GUI_FRONTEND_SERVICES=>EXECUTE
* exporting
* DOCUMENT = L_URL
* exceptions
* FILE_NOT_FOUND = 1
* others = 2.
perform CALL_URL
using L_S_URL-URL " Application /sap/bw/BEx
'?QUERY=0SMD_VCA2_SYS_RECOM_NOTES' " Query
'&CMD=PROCESS_VARIABLES&VARIABLE_SCREEN=X' " Parameters
ABAP_FALSE. " do not add sap-client
endif.
when 'FC06'.
* Show configuration status
* PERFORM SHOW_CONFIGURATION.
* We need the main list screen
submit (SY-REPID)
with P_FC06 = 'X'
with s_SYS in S_SYS
with s_TYPE in s_TYPE
and return.
when 'FC07'.
* System Recommendations Customizing
* call function 'VIEW_MAINTENANCE_CALL'
* exporting
* ACTION = 'U' "Update
** CORR_NUMBER = ' '
** GENERATE_MAINT_TOOL_IF_MISSING = ' '
** SHOW_SELECTION_POPUP = ' '
* VIEW_NAME = 'DNOC_USERCFG'
* NO_WARNING_FOR_CLIENTINDEP = 'X'
** RFC_DESTINATION_FOR_UPGRADE = ' '
** CLIENT_FOR_UPGRADE = ' '
** VARIANT_FOR_SELECTION = ' '
** COMPLEX_SELCONDS_USED = ' '
* CHECK_DDIC_MAINFLAG = 'X'
** SUPPRESS_WA_POPUP = ' '
** TABLES
** DBA_SELLIST =
** EXCL_CUA_FUNCT =
* exceptions
* CLIENT_REFERENCE = 1
* FOREIGN_LOCK = 2
* INVALID_ACTION = 3
* NO_CLIENTINDEPENDENT_AUTH = 4
* NO_DATABASE_FUNCTION = 5
* NO_EDITOR_FUNCTION = 6
* NO_SHOW_AUTH = 7
* NO_TVDIR_ENTRY = 8
* NO_UPD_AUTH = 9
* ONLY_SHOW_ALLOWED = 10
* SYSTEM_FAILURE = 11
* UNKNOWN_FIELD_IN_DBA_SELLIST = 12
* VIEW_NOT_FOUND = 13
* MAINTENANCE_PROHIBITED = 14
* others = 15.
* if SY-SUBRC <> 0.
* message id SY-MSGID type SY-MSGTY number SY-MSGNO
* with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* endif.
CL_AGS_SYSREC_UTIL=>SM30_DNOC_USERCFG_SYSREC( ).
when 'FC08'.
* Customizing table AGSSR_OSDB, Transaction SM30_AGSSR_OSDB
call function 'VIEW_MAINTENANCE_CALL'
exporting
ACTION = 'U' "Update
* CORR_NUMBER = ' '
* GENERATE_MAINT_TOOL_IF_MISSING = ' '
* SHOW_SELECTION_POPUP = ' '
VIEW_NAME = 'AGSSR_OSDB'
NO_WARNING_FOR_CLIENTINDEP = 'X'
* RFC_DESTINATION_FOR_UPGRADE = ' '
* CLIENT_FOR_UPGRADE = ' '
* VARIANT_FOR_SELECTION = ' '
* COMPLEX_SELCONDS_USED = ' '
CHECK_DDIC_MAINFLAG = 'X'
* SUPPRESS_WA_POPUP = ' '
* TABLES
* DBA_SELLIST =
* EXCL_CUA_FUNCT =
exceptions
CLIENT_REFERENCE = 1
FOREIGN_LOCK = 2
INVALID_ACTION = 3
NO_CLIENTINDEPENDENT_AUTH = 4
NO_DATABASE_FUNCTION = 5
NO_EDITOR_FUNCTION = 6
NO_SHOW_AUTH = 7
NO_TVDIR_ENTRY = 8
NO_UPD_AUTH = 9
ONLY_SHOW_ALLOWED = 10
SYSTEM_FAILURE = 11
UNKNOWN_FIELD_IN_DBA_SELLIST = 12
VIEW_NOT_FOUND = 13
MAINTENANCE_PROHIBITED = 14
others = 15.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* Show note user status and comments
when 'FC09'.
submit (SY-REPID)
with P_FC09 = 'X'
with S_SYS in S_SYS
with S_TYPE in S_TYPE
with S_NOTE in S_NOTE
with S_STAT in S_STAT
and return.
endcase.
form CALL_URL
using LV_APPLICATION type STRING " Fiory Launchpad: /sap/bc/ui5_ui5
LV_SERVICE type STRING " Fiory Launchpad: /ui2/ushell/shells/abap/FioriLaunchpad.html
LV_ACTION type STRING " Fiory Launchpad: <empty>, Sysrec: '#Action-UISMMySAPNotes'
LV_CLIENT type ABAP_BOOL.
* URL generation see report /UI2/START_URL
* <https>://<server>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html<action>?sap-client=<client>
* get start url
data LV_URL type STRING.
data LV_PARAM type STRING.
data LV_PROTOCOL type STRING.
data LV_HOST type STRING.
data LV_PORT type STRING.
* data LV_APPLICATION type STRING.
**********************************************************************
* create entries in table HTTPURLLOC for the below application string.
* these entries have to point to the reverse proxy (e.g. SAP WebDispatcher).
**********************************************************************
* LV_APPLICATION = '/sap/bc/ui5_ui5'.
CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
exporting
APPLICATION = LV_APPLICATION
* for_domain = for_domain
importing
HOST = LV_HOST
PORT = LV_PORT
OUT_PROTOCOL = LV_PROTOCOL ).
concatenate LV_PROTOCOL '://' LV_HOST ':' LV_PORT LV_APPLICATION into LV_URL.
translate LV_URL to lower case.
* concatenate LV_URL '/ui2/ushell/shells/abap/FioriLaunchpad.html' LV_ACTION into LV_URL.
concatenate LV_URL LV_SERVICE LV_ACTION into LV_URL.
* if access = abap_true.
* perform add_url_param using 'sap-accessibility=X' "#EC NOTEXT
* changing lv_url.
* endif.
* if langu is not initial.
* concatenate 'sap-language=' langu into lv_param. "#EC NOTEXT
* perform add_url_param using lv_param
* changing lv_url.
* endif.
if LV_CLIENT = 'X'.
do 1 times.
concatenate 'sap-client=' SY-MANDT into LV_PARAM. "#EC NOTEXT
perform ADD_URL_PARAM using LV_PARAM
changing LV_URL.
enddo.
endif.
** Activate External Debugging
* if extdebug = abap_true.
*
** Determine GUI IP address
* data: ls_rfcsi type rfcsi,
* lv_gui_ip type rfcipaddr.
* call function 'RFC_SYSTEM_INFO' destination 'SAPGUI'
* importing
* rfcsi_export = ls_rfcsi
* exceptions
* communication_failure = 1
* system_failure = 2
* others = 3.
* if sy-subrc eq 0.
* lv_gui_ip = ls_rfcsi-rfcipaddr.
* endif.
*
** Reset external debugging for current user to reduce side effects
** ... as a consequence in table ICFATTRIB the entries for the current user get deleted
* call function 'HTTP_DEBUG_UPDATE'
* exporting
* action = ' ' "Deactivate external debugging
* authority_check = 'X'
* gui_ipaddress = lv_gui_ip
* gui_ipaddress_flag = ' '
* no_message = ' '
* user = sy-uname
* exceptions
* internal_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
* display like 'S'.
* endif.
*
** Activate external debugging for the current user
** ... as a consequence in table ICFATTRIB an entry for the current user is created
* call function 'HTTP_DEBUG_UPDATE'
* exporting
* action = 'X' "Activate external Debugging
* authority_check = 'X'
* gui_ipaddress = lv_gui_ip
* gui_ipaddress_flag = ' '
* no_message = ' '
** SYSDEBUG = ' '
* timeout = '020000'
* user = sy-uname
* exceptions
* internal_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
* display like 'S'.
* endif.
* endif.
* single sign-on
constants LC_ICF_URL type STRING value '/sap/public/myssocntl'. "#EC SYNTCHAR
data LV_SSO_ACTIVE type ABAP_BOOL.
call method CL_ICF_TREE=>IF_ICF_TREE~SERVICE_FROM_URL
exporting
URL = LC_ICF_URL
HOSTNUMBER = 0
AUTHORITY_CHECK = ABAP_FALSE
importing
ICFACTIVE = LV_SSO_ACTIVE
exceptions
WRONG_APPLICATION = 1
NO_APPLICATION = 2
NOT_ALLOW_APPLICATION = 3
WRONG_URL = 4
NO_AUTHORITY = 5
others = 6.
if SY-SUBRC ne 0.
LV_SSO_ACTIVE = ABAP_FALSE.
endif.
* if lv_sso_active eq abap_false.
* message e027(bsp_wd) with lc_icf_url.
* endif.
data LV_URLC type C length 1024.
LV_URLC = LV_URL.
* start browser with single sign-on
if LV_SSO_ACTIVE = ABAP_TRUE.
data LV_CONTAINER type ref to CL_GUI_CONTAINER. "#EC NEEDED
data LV_VIEWER type ref to CL_GUI_HTML_VIEWER.
create object LV_VIEWER
exporting
PARENT = LV_CONTAINER
exceptions
CNTL_ERROR = 1
CNTL_INSTALL_ERROR = 2
DP_INSTALL_ERROR = 3
DP_ERROR = 4
others = 5.
if SY-SUBRC ne 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
display like 'E'.
endif.
call method LV_VIEWER->ENABLE_SAPSSO
exporting
ENABLED = ABAP_TRUE
exceptions
CNTL_ERROR = 1
others = 2.
if SY-SUBRC ne 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
display like 'E'.
endif.
call method LV_VIEWER->DETACH_URL_IN_BROWSER
exporting
URL = LV_URLC
exceptions
CNTL_ERROR = 1
others = 2.
if SY-SUBRC ne 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4