Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZSOFTCOPY_SYSTEM                                 *
3
*&                                                                     *
4
*&---------------------------------------------------------------------*
5
*&                                                                     *
6
*& This file is part of ZSOFTCOPY.                                     *
7
*&                                                                     *
8
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
9
*& it under the terms of the GNU General Public License as published   *
10
*& by the Free Software Foundation, either version 3 of the License,   *
11
*& or any later version.                                               *
12
*&                                                                     *
13
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
14
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16
*& GNU General Public License for more details.                        *
17
*&                                                                     *
18
*& You should have received a copy of the GNU General Public License   *
19
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
20
*&                                                                     *
21
*&---------------------------------------------------------------------*
22
*&                                                                     *
23
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
24
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
25
*&                                                                     *
26
*&---------------------------------------------------------------------*
27
 
28
 
29
*-----------------------------------------------------------------------
30
* system
31
*-----------------------------------------------------------------------
32
FORM system.
33
*System: Component Information
34
  PERFORM system_component.
35
*System: Kernel Information
36
  PERFORM system_kernel.
37
*System: Status
38
  PERFORM system_status.
39
 
40
ENDFORM.                    "system
41
 
42
 
43
*-----------------------------------------------------------------------
44
* component                                     System Component Info
45
*-----------------------------------------------------------------------
46
FORM system_component.
47
 
48
  DATA:
49
  lt_component TYPE it_component,
50
  ls_component TYPE st_component,
51
  lt_cvers TYPE STANDARD TABLE OF cvers,
52
  lt_html TYPE it_string.
53
 
54
  FIELD-SYMBOLS:
55
  <ls_cvers> TYPE cvers.
56
 
57
  SELECT * FROM cvers INTO TABLE lt_cvers.
58
  LOOP AT lt_cvers ASSIGNING <ls_cvers>.
59
    CLEAR ls_component.
60
    ls_component-component = <ls_cvers>-component.
61
    ls_component-release = <ls_cvers>-release.
62
    CALL FUNCTION 'OCS_GET_COMPONENT_STATE'
63
      EXPORTING
64
        iv_component  = <ls_cvers>-component
65
      IMPORTING
66
        ev_comp_level = ls_component-level
67
        ev_last_patch = ls_component-high_package
68
      EXCEPTIONS
69
        OTHERS        = 1.
70
    SELECT SINGLE desc_text FROM cvers_ref INTO ls_component-desc_text
71
        WHERE component = <ls_cvers>-component
72
        AND langu = sy-langu.
73
    APPEND ls_component TO lt_component.
74
  ENDLOOP.
75
 
76
*HTML
77
  PERFORM html_main_popupheader
78
    USING
79
      txt_component_information
80
    CHANGING
81
      lt_html.
82
* Content
83
  PERFORM html_add_tablenodiv
84
    USING
85
      'MENU_COMPO'
86
      lt_component
87
      lt_component
88
    CHANGING
89
      lt_html.
90
* Footer
91
  PERFORM html_main_popupfooter
92
    CHANGING lt_html.
93
*Download
94
  PERFORM download
95
    USING
96
      lt_html
97
      'MENU'
98
      'SYSTEM'
99
      'COMPONENT'
100
      gc_extension_htm
101
      abap_false.
102
 
103
ENDFORM.                    "system_component
104
 
105
 
106
*-----------------------------------------------------------------------
107
* kernel                                        System Kernel Info
108
*-----------------------------------------------------------------------
109
FORM system_kernel.
110
 
111
  DATA:
112
  ls_textinput TYPE st_textinput,
113
  lt_kernel TYPE it_textinput,
114
  lt_database TYPE it_textinput,
115
  lt_system TYPE it_textinput,
116
  lt_html TYPE it_string,
117
  ls_dbinfo TYPE dbrelinfo.
118
 
119
  FIELD-SYMBOLS:
120
  <l_patchlevel> TYPE ANY.
121
 
122
  CALL FUNCTION 'DB_DBRELINFO'
123
    IMPORTING
124
      dbinfo = ls_dbinfo.
125
 
126
*Kernel information
127
* Kernel release
128
  CLEAR ls_textinput.
129
  ls_textinput-name = txt_kernel_release.
130
  ls_textinput-input = abap_true.
131
  PERFORM get_version_info
132
    USING 'kernel release'
133
    CHANGING ls_textinput-value.
134
  APPEND ls_textinput TO lt_kernel.
135
* Compilation
136
  CLEAR ls_textinput.
137
  ls_textinput-name = txt_compilation.
138
  ls_textinput-input = abap_true.
139
  PERFORM get_version_info
140
    USING 'kernel compiled'
141
    CHANGING ls_textinput-value.
142
  APPEND ls_textinput TO lt_kernel.
143
* Sup.Pkg lvl.
144
  CLEAR ls_textinput.
145
  ls_textinput-name = txt_sup_pkg_lvl.
146
  ls_textinput-input = abap_true.
147
  PERFORM get_version_info
148
    USING 'kernel patch level'
149
    CHANGING ls_textinput-value.
150
  APPEND ls_textinput TO lt_kernel.
151
* ABAP Load
152
  CLEAR ls_textinput.
153
  ls_textinput-name = txt_abap_load.
154
  ls_textinput-input = abap_true.
155
  PERFORM get_version_info
156
    USING 'ABAP load version'
157
    CHANGING ls_textinput-value.
158
  APPEND ls_textinput TO lt_kernel.
159
* CUA load
160
  CLEAR ls_textinput.
161
  ls_textinput-name = txt_cua_load.
162
  ls_textinput-input = abap_true.
163
  PERFORM get_version_info
164
    USING 'CUA load version'
165
    CHANGING ls_textinput-value.
166
  APPEND ls_textinput TO lt_kernel.
167
* Mode
168
  CLEAR ls_textinput.
169
  ls_textinput-name = txt_mode.
170
  ls_textinput-input = abap_true.
171
  PERFORM get_version_info
172
    USING 'kernel kind'
173
    CHANGING ls_textinput-value.
174
  APPEND ls_textinput TO lt_kernel.
175
* Rsyn file
176
  CLEAR ls_textinput.
177
  ls_textinput-name = txt_rsyn_file.
178
  ls_textinput-input = abap_true.
179
  PERFORM get_version_info
180
    USING 'rsyn'
181
    CHANGING ls_textinput-value.
182
  APPEND ls_textinput TO lt_kernel.
183
 
184
*Database information
185
* DB client lib.
186
  CLEAR ls_textinput.
187
  ls_textinput-name = txt_db_client_lib.
188
  ls_textinput-input = abap_true.
189
  ls_textinput-value = ls_dbinfo-clirel.
190
  APPEND ls_textinput TO lt_database.
191
* DB releases
192
  CLEAR ls_textinput.
193
  ls_textinput-name = txt_db_releases.
194
  ls_textinput-input = abap_true.
195
  ls_textinput-value = ls_dbinfo-releases.
196
  APPEND ls_textinput TO lt_database.
197
* DBSL version
198
  CLEAR ls_textinput.
199
  ls_textinput-name = txt_dbsl_version.
200
  ls_textinput-input = abap_true.
201
  ls_textinput-value = ls_dbinfo-dbsl_vers.
202
  APPEND ls_textinput TO lt_database.
203
* DBSL Patch Level
204
  ASSIGN COMPONENT 'PATCHLEVEL' OF STRUCTURE ls_dbinfo
205
    TO <l_patchlevel>.
206
  IF <l_patchlevel> IS ASSIGNED.
207
    CLEAR ls_textinput.
208
    ls_textinput-name = txt_dbsl_patch_level.
209
    ls_textinput-input = abap_true.
210
    ls_textinput-value = <l_patchlevel>.
211
    APPEND ls_textinput TO lt_database.
212
  ENDIF.
213
 
214
*System information
215
* IP address
216
  CLEAR ls_textinput.
217
  ls_textinput-name = txt_ip_address.
218
  ls_textinput-input = abap_true.
219
  PERFORM get_version_info
220
    USING 'IP address'
221
    CHANGING ls_textinput-value.
222
  APPEND ls_textinput TO lt_system.
223
* SAP versions
224
  CLEAR ls_textinput.
225
  ls_textinput-name = txt_sap_versions.
226
  ls_textinput-input = abap_true.
227
  PERFORM get_version_info
228
    USING 'supported SAP vers.'
229
    CHANGING ls_textinput-value.
230
  APPEND ls_textinput TO lt_system.
231
* Operating System
232
  CLEAR ls_textinput.
233
  ls_textinput-name = txt_operating_system.
234
  ls_textinput-input = abap_true.
235
  PERFORM get_version_info
236
    USING 'valid OP system'
237
    CHANGING ls_textinput-value.
238
  APPEND ls_textinput TO lt_system.
239
* OP release
240
  CLEAR ls_textinput.
241
  ls_textinput-name = txt_op_release.
242
  ls_textinput-input = abap_true.
243
  PERFORM get_version_info
244
    USING 'OP system release'
245
    CHANGING ls_textinput-value.
246
  APPEND ls_textinput TO lt_system.
247
 
248
*HTML
249
  PERFORM html_main_popupheader
250
    USING
251
      txt_component_information
252
    CHANGING
253
      lt_html.
254
* Content
255
  PERFORM html_add_box1ti_2tivernodiv
256
    USING
257
      txt_kernel_information___2
258
      lt_kernel
259
      txt_database_information
260
      lt_database
261
      txt_system_information
262
      lt_system
263
    CHANGING
264
      lt_html.
265
* Footer
266
  PERFORM html_main_popupfooter
267
    CHANGING lt_html.
268
*Download
269
  PERFORM download
270
    USING
271
      lt_html
272
      'MENU'
273
      'SYSTEM'
274
      'KERNEL'
275
      gc_extension_htm
276
      abap_false.
277
 
278
ENDFORM.                    "system_kernel
279
 
280
 
281
*-----------------------------------------------------------------------
282
* status                                        System Status
283
*-----------------------------------------------------------------------
284
FORM system_status.
285
 
286
  DATA:
287
  ls_textinput TYPE st_textinput,
288
  lt_usage_data_r TYPE it_textinput,
289
  lt_usage_data_l TYPE it_textinput,
290
  lt_repository_data TYPE it_textinput,
291
  lt_sap_system_data TYPE it_textinput,
292
  lt_host_data TYPE it_textinput,
293
  lt_database_data TYPE it_textinput,
294
  lt_html TYPE it_string,
295
  ls_last_logon TYPE st_last_logon,
296
  l_name TYPE ad_namtext,
297
  l_laiso TYPE laiso,
298
  l_sptxt TYPE sptxt,
299
  l_title TYPE rs38m-repti,
300
  l_date TYPE sydatum,
301
  l_db_release(10) TYPE c,
302
  l_servername(40) TYPE c,
303
  l_unicode TYPE c,
304
  l_exists TYPE flag,
305
  l_ttext TYPE ttext_stct,
306
  l_stext(40) TYPE c,
307
  l_repid TYPE syrepid,
308
  lt_list TYPE STANDARD TABLE OF msxxlist.
309
 
310
  FIELD-SYMBOLS:
311
  <ls_list> TYPE msxxlist.
312
 
313
*Last logon
314
  GET PARAMETER ID 'US2' FIELD ls_last_logon.
315
 
316
*Usage data
317
* Client
318
  CLEAR ls_textinput.
319
  ls_textinput-name = txt_client.
320
  ls_textinput-input = abap_true.
321
  ls_textinput-value = sy-mandt.
322
  APPEND ls_textinput TO lt_usage_data_l.
323
* User
324
  CLEAR ls_textinput.
325
  ls_textinput-name = txt_user.
326
  ls_textinput-input = abap_true.
327
  ls_textinput-value = sy-uname.
328
  PERFORM get_user
329
    USING sy-uname
330
    CHANGING l_name.
331
  ls_textinput-value_text = l_name.
332
  APPEND ls_textinput TO lt_usage_data_l.
333
* Language
334
  CLEAR ls_textinput.
335
  ls_textinput-name = txt_language.
336
  ls_textinput-input = abap_true.
337
  PERFORM get_spras
338
    USING sy-langu
339
    CHANGING l_laiso l_sptxt.
340
  ls_textinput-value = l_laiso.
341
  ls_textinput-value_text = l_sptxt.
342
  APPEND ls_textinput TO lt_usage_data_l.
343
* Previous logon
344
  CLEAR ls_textinput.
345
  ls_textinput-name = txt_previous_logon.
346
  ls_textinput-input = abap_true.
347
  ls_textinput-has_value_ext = abap_true.
348
  PERFORM get_date
349
    USING ls_last_logon-date
350
    CHANGING ls_textinput-value.
351
  PERFORM get_time
352
    USING ls_last_logon-time
353
    CHANGING ls_textinput-value_ext.
354
  APPEND ls_textinput TO lt_usage_data_r.
355
* Logon
356
  CLEAR ls_textinput.
357
  ls_textinput-name = txt_logon.
358
  ls_textinput-input = abap_true.
359
  ls_textinput-has_value_ext = abap_true.
360
  PERFORM get_date
361
    USING ls_last_logon-date_now
362
    CHANGING ls_textinput-value.
363
  PERFORM get_time
364
    USING ls_last_logon-time_now
365
    CHANGING ls_textinput-value_ext.
366
  APPEND ls_textinput TO lt_usage_data_r.
367
* System time
368
  CLEAR ls_textinput.
369
  ls_textinput-name = txt_system_time.
370
  ls_textinput-input = abap_true.
371
  ls_textinput-has_value_ext = abap_true.
372
  PERFORM get_date
373
    USING sy-datum
374
    CHANGING ls_textinput-value.
375
  PERFORM get_time
376
    USING sy-uzeit
377
    CHANGING ls_textinput-value_ext.
378
  APPEND ls_textinput TO lt_usage_data_r.
379
 
380
*SAP data - Repository data
381
  l_repid = sy-repid.
382
* Transition
383
  CLEAR ls_textinput.
384
  ls_textinput-name = txt_transaction.
385
  ls_textinput-input = abap_true.
386
  ls_textinput-value = sy-tcode.
387
  SELECT SINGLE ttext FROM tstct INTO l_ttext
388
    WHERE sprsl = sy-langu
389
    AND tcode = sy-tcode.
390
  ls_textinput-value_text = l_ttext.
391
  APPEND ls_textinput TO lt_repository_data.
392
* Program (screen)
393
  CLEAR ls_textinput.
394
  ls_textinput-name = txt_program_screen.
395
  ls_textinput-input = abap_true.
396
  ls_textinput-value = l_repid.
397
  CALL FUNCTION 'PROGRAM_TITLE'
398
    EXPORTING
399
      program  = l_repid
400
      language = sy-langu
401
    IMPORTING
402
      title    = l_title.
403
  ls_textinput-value_text = l_title.
404
  APPEND ls_textinput TO lt_repository_data.
405
* Screen number
406
  CLEAR ls_textinput.
407
  ls_textinput-name = txt_screen_number.
408
  ls_textinput-input = abap_true.
409
  ls_textinput-value = sy-dynnr.
410
  APPEND ls_textinput TO lt_repository_data.
411
* Program (GUI)
412
  CLEAR ls_textinput.
413
  ls_textinput-name = txt_program_gui.
414
  ls_textinput-input = abap_true.
415
  ls_textinput-value = l_repid.
416
  CALL FUNCTION 'PROGRAM_TITLE'
417
    EXPORTING
418
      program  = l_repid
419
      language = sy-langu
420
    IMPORTING
421
      title    = l_title.
422
  ls_textinput-value_text = l_title.
423
  APPEND ls_textinput TO lt_repository_data.
424
* GUI status
425
  CLEAR ls_textinput.
426
  ls_textinput-name = txt_gui_status.
427
  ls_textinput-input = abap_true.
428
  ls_textinput-value = sy-pfkey.
429
  APPEND ls_textinput TO lt_repository_data.
430
 
431
*SAP data - SAP System data
432
* Component version
433
  CLEAR ls_textinput.
434
  ls_textinput-name = txt_component_version.
435
  ls_textinput-input = abap_true.
436
  SELECT SINGLE stext FROM cvers_txt INTO l_stext
437
    WHERE langu = sy-langu.
438
  IF sy-subrc <> 0.
439
    SELECT SINGLE stext FROM cvers_txt INTO l_stext
440
      WHERE langu = 'EN'.
441
  ENDIF.
442
  ls_textinput-value = l_stext.
443
  APPEND ls_textinput TO lt_sap_system_data.
444
* Space row
445
  CLEAR ls_textinput.
446
  ls_textinput-space = abap_true.
447
  APPEND ls_textinput TO lt_sap_system_data.
448
* Installation number
449
  CLEAR ls_textinput.
450
  ls_textinput-name = txt_installation_number.
451
  ls_textinput-input = abap_true.
452
  CALL FUNCTION 'SLIC_GET_LICENCE_NUMBER'
453
    IMPORTING
454
      license_number = ls_textinput-value.
455
  APPEND ls_textinput TO lt_sap_system_data.
456
* License expiration
457
  CLEAR ls_textinput.
458
  ls_textinput-name = txt_license_expiration.
459
  ls_textinput-input = abap_true.
460
  CALL FUNCTION 'SLIC_GET_LICENCE_DATE'
461
    IMPORTING
462
      licence_date = l_date.
463
  PERFORM get_date
464
    USING l_date
465
    CHANGING ls_textinput-value.
466
  APPEND ls_textinput TO lt_sap_system_data.
467
* Unicode System
468
  PERFORM get_fuba_exists
469
    USING 'SLDAG_CHECK_FOR_UNICODE'
470
    CHANGING l_exists.
471
  IF l_exists = abap_true.
472
    CLEAR ls_textinput.
473
    ls_textinput-name = txt_unicode_system.
474
    ls_textinput-input = abap_true.
475
    CALL FUNCTION 'SLDAG_CHECK_FOR_UNICODE'
476
      IMPORTING
477
        unicode = l_unicode.
478
    IF l_unicode = 1.
479
      ls_textinput-value = txt_yes.
480
    ELSE.
481
      ls_textinput-value = txt_no.
482
    ENDIF.
483
    APPEND ls_textinput TO lt_sap_system_data.
484
  ENDIF.
485
 
486
*Host data
487
* Operating system
488
  CLEAR ls_textinput.
489
  ls_textinput-name = txt_operating_system.
490
  ls_textinput-input = abap_true.
491
  ls_textinput-value = sy-opsys.
492
  APPEND ls_textinput TO lt_host_data.
493
* Machine type
494
  CLEAR ls_textinput.
495
  ls_textinput-name = txt_machine_type.
496
  ls_textinput-input = abap_true.
497
  PERFORM get_version_info
498
    USING 'machine type'
499
    CHANGING ls_textinput-value.
500
  APPEND ls_textinput TO lt_host_data.
501
* Server name
502
  CLEAR ls_textinput.
503
  ls_textinput-name = txt_server_name.
504
  ls_textinput-input = abap_true.
505
***
506
  CALL FUNCTION 'TH_SERVER_LIST'
507
    TABLES
508
      list   = lt_list
509
    EXCEPTIONS
510
      OTHERS = 1.
511
  READ TABLE lt_list ASSIGNING <ls_list> INDEX 1.
512
  IF <ls_list> IS ASSIGNED.
513
    l_servername = <ls_list>-name.
514
  ELSE.
515
*  call 'C_SAPGPARAM'
516
*    id 'NAME'  field 'rdisp/myname'
517
*    id 'VALUE' field l_servername.
518
*  if sy-subrc <> 0.
519
    CLEAR l_servername.
520
  ENDIF.
521
  ls_textinput-value = l_servername.
522
  APPEND ls_textinput TO lt_host_data.
523
* Platform ID
524
  CLEAR ls_textinput.
525
  ls_textinput-name = txt_platform_id.
526
  ls_textinput-input = abap_true.
527
  PERFORM get_version_info
528
    USING 'SAP system id'
529
    CHANGING ls_textinput-value.
530
  APPEND ls_textinput TO lt_host_data.
531
 
532
*Database data
533
* Database system
534
  CLEAR ls_textinput.
535
  ls_textinput-name = txt_database_system.
536
  ls_textinput-input = abap_true.
537
  PERFORM get_version_info
538
    USING 'database system'
539
    CHANGING ls_textinput-value.
540
  APPEND ls_textinput TO lt_database_data.
541
* Release
542
  CLEAR ls_textinput.
543
  ls_textinput-name = txt_release.
544
  ls_textinput-input = abap_true.
545
  CALL FUNCTION 'DB_GET_RELEASE'
546
    IMPORTING
547
      release = l_db_release.
548
  ls_textinput-value = l_db_release.
549
  APPEND ls_textinput TO lt_database_data.
550
* Name
551
  CLEAR ls_textinput.
552
  ls_textinput-name = txt_name.
553
  ls_textinput-input = abap_true.
554
  PERFORM get_version_info
555
    USING 'database name'
556
    CHANGING ls_textinput-value.
557
  APPEND ls_textinput TO lt_database_data.
558
* Host
559
  CLEAR ls_textinput.
560
  ls_textinput-name = txt_host.
561
  ls_textinput-input = abap_true.
562
  PERFORM get_version_info
563
    USING 'database host'
564
    CHANGING ls_textinput-value.
565
  ls_textinput-value = sy-host.
566
  TRANSLATE ls_textinput-value TO UPPER CASE.
567
  APPEND ls_textinput TO lt_database_data.
568
* Owner
569
  CLEAR ls_textinput.
570
  ls_textinput-name = txt_owner.
571
  ls_textinput-input = abap_true.
572
  PERFORM get_version_info
573
    USING 'database owner'
574
    CHANGING ls_textinput-value.
575
  APPEND ls_textinput TO lt_database_data.
576
 
577
*HTML
578
  PERFORM html_main_popupheader
579
    USING
580
      txt_status
581
    CHANGING
582
      lt_html.
583
* Content
584
  PERFORM html_add_box1tidbl_box2ti_2tix
585
    USING
586
      txt_usage_data
587
      lt_usage_data_l
588
      lt_usage_data_r
589
      txt_sap_data
590
      txt_repository_data
591
      txt_sap_system_data
592
      lt_repository_data
593
      lt_sap_system_data
594
      txt_host_data
595
      txt_database_data
596
      lt_host_data
597
      lt_database_data
598
    CHANGING
599
      lt_html.
600
* Footer
601
  PERFORM html_main_popupfooter
602
    CHANGING lt_html.
603
*Download
604
  PERFORM download
605
    USING
606
      lt_html
607
      'MENU'
608
      'SYSTEM'
609
      'STATUS'
610
      gc_extension_htm
611
      abap_false.
612
 
613
ENDFORM.                    "system_status