Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZSOFTCOPY_GET                                    *
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
* get_class_attribute_value
31
*-----------------------------------------------------------------------
32
FORM get_class_attribute_value
33
  USING
34
    value(i_clsname) TYPE seoclsname
35
    value(i_cmpname) TYPE seocmpname
36
  CHANGING
37
    c_attvalue TYPE seovalue.
38
 
39
  DATA:
40
  l_len TYPE i.
41
 
42
  CLEAR c_attvalue.
43
  SELECT SINGLE attvalue FROM seocompodf INTO c_attvalue
44
      WHERE clsname = i_clsname
45
      AND cmpname = i_cmpname
46
      AND version = 1.
47
  IF sy-subrc = 0.
48
    IF c_attvalue+0(1) = ''''.
49
      l_len = strlen( c_attvalue ) - 2.
50
      c_attvalue = c_attvalue+1(l_len).
51
    ENDIF.
52
  ENDIF.
53
 
54
ENDFORM.                    "get_class_attvalue
55
 
56
 
57
*-----------------------------------------------------------------------
58
* get_class_exists
59
*-----------------------------------------------------------------------
60
FORM get_class_exists
61
  USING
62
    value(i_clsname) TYPE seoclsname
63
  CHANGING
64
    c_class_exists TYPE flag.
65
 
66
  DATA:
67
  l_clsname TYPE seoclsname.
68
 
69
  c_class_exists = abap_false.
70
  SELECT SINGLE clsname FROM seoclass INTO l_clsname
71
    WHERE clsname = i_clsname.
72
  IF sy-subrc = 0.
73
    c_class_exists = abap_true.
74
  ENDIF.
75
 
76
ENDFORM.                    "get_class_exists
77
 
78
 
79
*-----------------------------------------------------------------------
80
* get_date
81
*-----------------------------------------------------------------------
82
FORM get_date
83
  USING
84
    value(i_date) TYPE sydatum
85
  CHANGING
86
    c_date TYPE string.
87
 
88
  CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
89
    EXPORTING
90
      date_internal = i_date
91
    IMPORTING
92
      date_external = c_date.
93
ENDFORM.                    "get_date
94
 
95
 
96
*-----------------------------------------------------------------------
97
* get_devClass
98
*-----------------------------------------------------------------------
99
FORM get_devclass
100
  USING
101
    value(i_devclass) TYPE devclass
102
  CHANGING
103
    c_text TYPE as4text.
104
 
105
  CLEAR c_text.
106
  SELECT SINGLE ctext FROM tdevct INTO c_text
107
      WHERE devclass = i_devclass
108
      AND spras = sy-langu.
109
ENDFORM.                    "get_devClass
110
 
111
 
112
*-----------------------------------------------------------------------
113
* get_docu
114
*-----------------------------------------------------------------------
115
FORM get_docu
116
  USING
117
    value(i_id) TYPE doku_id
118
    value(i_object) TYPE any
119
    value(i_typ) TYPE doku_typ
120
  CHANGING
121
    ct_str TYPE it_string.
122
 
123
  DATA:
124
  lt_html TYPE STANDARD TABLE OF htmlline,
125
  l_object TYPE doku_obj,
126
  lt_line TYPE STANDARD TABLE OF tline,
127
  ls_entry TYPE glos_entry,
128
  l_pos TYPE i.
129
 
130
  FIELD-SYMBOLS:
131
  <ls_html> TYPE htmlline.
132
 
133
  REFRESH ct_str.
134
  l_object = i_object.
135
 
136
  CALL FUNCTION 'DOCU_GET'
137
    EXPORTING
138
      id     = i_id
139
      langu  = sy-langu
140
      object = l_object
141
      typ    = i_typ
142
    TABLES
143
      line   = lt_line
144
    EXCEPTIONS
145
      OTHERS = 1.
146
  CHECK sy-subrc = 0.
147
 
148
  ls_entry-langu = sy-langu.
149
  CALL FUNCTION 'DOC_SAPSCRIPT_TO_HTML_FORMAT'
150
    EXPORTING
151
      entry          = ls_entry
152
    TABLES
153
      sapscript_text = lt_line
154
      html_text      = lt_html.
155
 
156
  CLEAR l_pos.
157
  LOOP AT lt_html ASSIGNING <ls_html>.
158
    IF <ls_html>+0(5) = '<BODY'.
159
      l_pos = sy-tabix.
160
    ENDIF.
161
    PERFORM replace_all
162
      USING '</BODY>' space
163
      CHANGING <ls_html>.
164
    PERFORM replace_all
165
      USING '</HTML>' space
166
      CHANGING <ls_html>.
167
  ENDLOOP.
168
  DO l_pos TIMES.
169
    DELETE lt_html INDEX 1.
170
  ENDDO.
171
 
172
  LOOP AT lt_html ASSIGNING <ls_html>.
173
    APPEND <ls_html>-tdline TO ct_str.
174
  ENDLOOP.
175
ENDFORM.                    "get_docu
176
 
177
 
178
*-----------------------------------------------------------------------
179
* get_dom
180
*-----------------------------------------------------------------------
181
FORM get_dom
182
  USING
183
    value(i_domname) TYPE domname
184
  CHANGING
185
    c_text TYPE as4text.
186
 
187
  CLEAR c_text.
188
  SELECT SINGLE ddtext FROM dd01t INTO c_text
189
      WHERE domname = i_domname
190
      AND ddlanguage = sy-langu
191
      AND as4local = 'A'.
192
ENDFORM.                    "get_dom
193
 
194
 
195
*-----------------------------------------------------------------------
196
* get_dom_value_text
197
*-----------------------------------------------------------------------
198
FORM get_dom_value_text
199
  USING
200
    value(i_domname) TYPE domname
201
    value(i_domvalue) TYPE any
202
  CHANGING
203
    c_text TYPE any.
204
 
205
  DATA:
206
  l_domvalue TYPE domvalue_l,
207
  l_text TYPE val_text.
208
 
209
  CLEAR c_text.
210
  l_domvalue = i_domvalue.
211
 
212
  SELECT SINGLE ddtext FROM dd07t INTO l_text
213
      WHERE domname = i_domname
214
      AND ddlanguage = sy-langu
215
      AND as4local = 'A'
216
      AND domvalue_l = l_domvalue.
217
  IF sy-subrc = 0.
218
    c_text = l_text.
219
  ENDIF.
220
ENDFORM.                    "getDomValueText
221
 
222
 
223
*-----------------------------------------------------------------------
224
* get_dom_value_texts
225
*-----------------------------------------------------------------------
226
FORM get_dom_value_texts
227
  USING
228
    value(i_domname) TYPE domname
229
  CHANGING
230
    ct_dom_value TYPE it_dom_value.
231
 
232
  DATA:
233
  lt_dd07t TYPE STANDARD TABLE OF dd07t,
234
  ls_dom_value TYPE st_dom_value.
235
 
236
  FIELD-SYMBOLS:
237
  <ls_dd07t> TYPE dd07t.
238
 
239
  REFRESH ct_dom_value.
240
  SELECT * FROM dd07t INTO TABLE lt_dd07t
241
      WHERE domname = i_domname
242
      AND ddlanguage = sy-langu
243
      AND as4local = 'A'
244
      ORDER BY domvalue_l DESCENDING.
245
  LOOP AT lt_dd07t ASSIGNING <ls_dd07t>.
246
    ls_dom_value-text = <ls_dd07t>-ddtext.
247
    ls_dom_value-value = <ls_dd07t>-domvalue_l.
248
    APPEND ls_dom_value TO ct_dom_value.
249
  ENDLOOP.
250
ENDFORM.                    "get_dom_value_texts
251
 
252
 
253
*-----------------------------------------------------------------------
254
* get_dtel_text
255
*-----------------------------------------------------------------------
256
FORM get_dtel_text
257
  USING
258
    value(i_rollname) TYPE rollname
259
    value(i_field) TYPE c
260
  CHANGING
261
    c_text TYPE any.
262
 
263
  DATA:
264
  ls_dd04t TYPE dd04t,
265
  l_field TYPE fieldname.
266
 
267
  FIELD-SYMBOLS:
268
  <l_text> TYPE ANY.
269
 
270
  CLEAR c_text.
271
  CASE i_field.
272
    WHEN 'D'.
273
      l_field = 'DDTEXT'.
274
    WHEN 'T'.
275
      l_field = 'REPTEXT'.
276
    WHEN 'S'.
277
      l_field = 'SCRTEXT_S'.
278
    WHEN 'M'.
279
      l_field = 'SCRTEXT_M'.
280
    WHEN 'L'.
281
      l_field = 'SCRTEXT_L'.
282
    WHEN OTHERS.
283
      l_field = 'SCRTEXT_M'.
284
  ENDCASE.
285
  SELECT SINGLE * FROM dd04t INTO ls_dd04t
286
      WHERE rollname = i_rollname
287
      AND ddlanguage = sy-langu
288
      AND as4local = 'A'.
289
  IF sy-subrc = 0.
290
    ASSIGN COMPONENT l_field OF STRUCTURE ls_dd04t TO <l_text>.
291
    IF <l_text> IS ASSIGNED.
292
      c_text = <l_text>.
293
    ENDIF.
294
  ENDIF.
295
ENDFORM.                    "get_dtel_text
296
 
297
 
298
*-----------------------------------------------------------------------
299
* get_fuba_exists
300
*-----------------------------------------------------------------------
301
FORM get_fuba_exists
302
  USING
303
    value(i_funcname) TYPE rs38l_fnam
304
  CHANGING
305
    c_fuba_exists TYPE flag.
306
 
307
  DATA:
308
  l_funcname TYPE rs38l_fnam.
309
 
310
  c_fuba_exists = abap_false.
311
  SELECT SINGLE funcname FROM tfdir INTO l_funcname
312
    WHERE funcname = i_funcname.
313
  IF sy-subrc = 0.
314
    c_fuba_exists = abap_true.
315
  ENDIF.
316
 
317
ENDFORM.                    "get_class_exists
318
 
319
 
320
*-----------------------------------------------------------------------
321
* get_GUI_kind
322
*-----------------------------------------------------------------------
323
FORM get_gui_kind
324
  USING
325
    value(i_kind) TYPE c
326
  CHANGING
327
    c_gui_kind TYPE string.
328
 
329
  DATA l_kind.
330
  CLEAR c_gui_kind.
331
  l_kind = i_kind.
332
  TRANSLATE l_kind TO UPPER CASE.
333
  CASE l_kind.
334
    WHEN 'P'.
335
      c_gui_kind = txt_parameters.
336
    WHEN 'S'.
337
      c_gui_kind = txt_selection_criteria.
338
    WHEN OTHERS.
339
      c_gui_kind = l_kind.
340
  ENDCASE.
341
ENDFORM.                    "get_GUI_kind
342
 
343
 
344
*-----------------------------------------------------------------------
345
* get_GUI_operator
346
*-----------------------------------------------------------------------
347
FORM get_gui_operator
348
  USING
349
    value(i_operator) TYPE char2
350
  CHANGING
351
    c_gui_operator TYPE string.
352
 
353
  DATA l_operator(2) TYPE c.
354
  CLEAR c_gui_operator.
355
  l_operator = i_operator.
356
  TRANSLATE l_operator TO UPPER CASE.
357
  CASE l_operator.
358
    WHEN 'BT'.
359
      c_gui_operator = '[]'.
360
    WHEN 'CP'.
361
      c_gui_operator = '[*]'.
362
    WHEN 'EQ'.
363
      c_gui_operator = '='.
364
    WHEN 'GE'.
365
      c_gui_operator = '>='.
366
    WHEN 'GT'.
367
      c_gui_operator = '>'.
368
    WHEN 'LE'.
369
      c_gui_operator = '<='.
370
    WHEN 'LK'.
371
      c_gui_operator = 'like'.
372
    WHEN 'LT'.
373
      c_gui_operator = '<'.
374
    WHEN 'NB'.
375
      c_gui_operator = ']['.
376
    WHEN 'NE'.
377
      c_gui_operator = '<>'.
378
    WHEN 'NP'.
379
      c_gui_operator = ']*['.
380
    WHEN OTHERS.
381
      c_gui_operator = l_operator.
382
  ENDCASE.
383
ENDFORM.                    "get_GUI_operator
384
 
385
 
386
*-----------------------------------------------------------------------
387
* get_GUI_sign
388
*-----------------------------------------------------------------------
389
FORM get_gui_sign
390
  USING
391
    value(i_sign) TYPE c
392
  CHANGING
393
    c_gui_sign TYPE string.
394
 
395
  DATA l_sign.
396
  CLEAR c_gui_sign.
397
  l_sign = i_sign.
398
  TRANSLATE l_sign TO UPPER CASE.
399
  CASE l_sign.
400
    WHEN 'E'.
401
      c_gui_sign = txt_exclusive.
402
    WHEN 'I'.
403
      c_gui_sign = txt_inclusive.
404
    WHEN OTHERS.
405
      c_gui_sign = l_sign.
406
  ENDCASE.
407
ENDFORM.                    "get_GUI_sign
408
 
409
 
410
*-----------------------------------------------------------------------
411
* get_hardwarekey
412
*-----------------------------------------------------------------------
413
FORM get_hardwarekey
414
  CHANGING
415
    c_hwkey TYPE custkey_t.
416
 
417
  DATA:
418
  l_rc TYPE sysubrc.
419
 
420
  CALL FUNCTION 'SLIC_LOCAL_HWKEY'
421
    EXPORTING
422
      no_raise = 1
423
    IMPORTING
424
      hwkey    = c_hwkey
425
      rc       = l_rc.
426
ENDFORM.                    "get_hardwarekey
427
 
428
 
429
*-----------------------------------------------------------------------
430
* get_icon_text
431
*-----------------------------------------------------------------------
432
FORM get_icon_text
433
  USING
434
    value(i_icon_id) TYPE icon_d
435
    value(i_field) TYPE c
436
  CHANGING
437
    c_text TYPE any.
438
 
439
  DATA:
440
  ls_icont TYPE icont,
441
  l_field TYPE fieldname.
442
 
443
  FIELD-SYMBOLS:
444
  <l_text> TYPE ANY.
445
 
446
  CLEAR c_text.
447
  CASE i_field.
448
    WHEN 'S'.
449
      l_field = 'SHORTTEXT'.
450
    WHEN 'Q'.
451
      l_field = 'QUICKINFO'.
452
    WHEN OTHERS.
453
      l_field = 'SHORTTEXT'.
454
  ENDCASE.
455
  SELECT SINGLE * FROM icont INTO ls_icont
456
      WHERE id = i_icon_id
457
      AND langu = sy-langu.
458
  IF sy-subrc = 0.
459
    ASSIGN COMPONENT l_field OF STRUCTURE ls_icont TO <l_text>.
460
    IF <l_text> IS ASSIGNED.
461
      c_text = <l_text>.
462
    ENDIF.
463
  ENDIF.
464
ENDFORM.                    "get_icon_text
465
 
466
 
467
*-----------------------------------------------------------------------
468
* get_id
469
*-----------------------------------------------------------------------
470
FORM get_id
471
  USING
472
    value(i_param_1)
473
    value(i_param_2)
474
  CHANGING
475
    c_id.
476
 
477
  CONCATENATE i_param_1 i_param_2 INTO c_id.
478
 
479
  PERFORM replace_all
480
    USING '/' '_'
481
    CHANGING c_id.
482
ENDFORM.                    "get_id
483
 
484
 
485
*-----------------------------------------------------------------------
486
* get_message_text
487
*-----------------------------------------------------------------------
488
FORM get_message_text
489
  USING
490
    value(i_arbgb) TYPE any
491
    value(i_msgnr) TYPE any
492
    value(i_v1) TYPE any
493
    value(i_v2) TYPE any
494
    value(i_v3) TYPE any
495
    value(i_v4) TYPE any
496
  CHANGING
497
    c_text TYPE string.
498
 
499
  DATA:
500
  l_id TYPE bapiret2-id,
501
  l_number TYPE bapiret2-number,
502
  l_v1 TYPE bapiret2-message_v1,
503
  l_v2 TYPE bapiret2-message_v2,
504
  l_v3 TYPE bapiret2-message_v3,
505
  l_v4 TYPE bapiret2-message_v4,
506
  l_message TYPE bapiret2-message,
507
  lt_return TYPE bapiret2,
508
  lt_text TYPE STANDARD TABLE OF bapitgb.
509
 
510
  l_id = i_arbgb.
511
  l_number = i_msgnr.
512
  l_v1 = i_v1.
513
  l_v2 = i_v2.
514
  l_v3 = i_v3.
515
  l_v4 = i_v4.
516
 
517
  CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
518
    EXPORTING
519
      id         = l_id
520
      number     = l_number
521
      language   = sy-langu
522
      textformat = 'ASC'
523
      message_v1 = l_v1
524
      message_v2 = l_v2
525
      message_v3 = l_v3
526
      message_v4 = l_v4
527
    IMPORTING
528
      message    = l_message
529
      return     = lt_return
530
    TABLES
531
      text       = lt_text.
532
 
533
  c_text = l_message.
534
 
535
ENDFORM.                    "get_message_text
536
 
537
 
538
*-----------------------------------------------------------------------
539
* get_page_title
540
*-----------------------------------------------------------------------
541
FORM get_page_title
542
  USING
543
    value(i_prefix) TYPE any
544
    value(i_arbgb) TYPE any
545
    value(i_msgnr) TYPE any
546
    value(i_obj_name) TYPE any
547
  CHANGING
548
    c_page_title TYPE char255.
549
 
550
  DATA:
551
  l_text TYPE string,
552
  l_prefix TYPE string.
553
 
554
  PERFORM get_message_text
555
    USING
556
      i_arbgb
557
      i_msgnr
558
      i_obj_name
559
      space
560
      space
561
      space
562
    CHANGING
563
      l_text.
564
 
565
  IF NOT i_prefix IS INITIAL.
566
    CONCATENATE i_prefix ':' INTO l_prefix.
567
    CONCATENATE l_prefix l_text INTO c_page_title SEPARATED BY space.
568
  ELSE.
569
    c_page_title = l_text.
570
  ENDIF.
571
 
572
ENDFORM.                    "get_page_title
573
 
574
 
575
*-----------------------------------------------------------------------
576
* get_props
577
*-----------------------------------------------------------------------
578
FORM get_props
579
  CHANGING
580
    ct_prop TYPE it_prop.
581
 
582
  DATA:
583
  ls_prop TYPE st_prop,
584
  l_hwkey TYPE custkey_t,
585
  l_str TYPE string,
586
  l_stext TYPE text40,
587
  l_laiso TYPE laiso,
588
  l_sptxt TYPE sptxt.
589
 
590
  REFRESH ct_prop.
591
 
592
* version
593
  ls_prop-name = 'scver'.
594
  ls_prop-value = gc_version.
595
  APPEND ls_prop TO ct_prop.
596
* hardwarekey
597
  ls_prop-name = 'hwkey'.
598
  PERFORM get_hardwarekey
599
    CHANGING l_hwkey.
600
  ls_prop-value = l_hwkey.
601
  APPEND ls_prop TO ct_prop.
602
* component version
603
  ls_prop-name = 'compo'.
604
  SELECT SINGLE stext FROM cvers_txt INTO l_stext
605
    WHERE langu = 'EN'.
606
  IF sy-subrc <> 0.
607
    SELECT SINGLE stext FROM cvers_txt INTO l_stext.
608
  ENDIF.
609
  ls_prop-value = l_stext.
610
  APPEND ls_prop TO ct_prop.
611
* kernel release
612
  ls_prop-name = 'krel'.
613
  PERFORM get_version_info
614
    USING 'kernel release'
615
    CHANGING l_str.
616
  ls_prop-value = l_str.
617
  APPEND ls_prop TO ct_prop.
618
* patch level
619
  ls_prop-name = 'patch'.
620
  PERFORM get_version_info
621
    USING 'kernel patch level'
622
    CHANGING l_str.
623
  ls_prop-value = l_str.
624
  APPEND ls_prop TO ct_prop.
625
* username
626
  ls_prop-name = 'uname'.
627
  ls_prop-value = sy-uname.
628
  APPEND ls_prop TO ct_prop.
629
* language
630
  ls_prop-name = 'langu'.
631
  PERFORM get_spras USING sy-langu l_laiso l_sptxt.
632
  ls_prop-value = l_laiso.
633
  APPEND ls_prop TO ct_prop.
634
* date
635
  ls_prop-name = 'datum'.
636
  ls_prop-value = sy-datum.
637
  APPEND ls_prop TO ct_prop.
638
* time
639
  ls_prop-name = 'uzeit'.
640
  ls_prop-value = sy-uzeit.
641
  APPEND ls_prop TO ct_prop.
642
 
643
ENDFORM.                    "get_props
644
 
645
 
646
*-----------------------------------------------------------------------
647
* get_spras
648
*-----------------------------------------------------------------------
649
FORM get_spras
650
  USING
651
    value(i_spras) TYPE any
652
  CHANGING
653
    c_laiso TYPE laiso
654
    c_sptxt TYPE sptxt.
655
 
656
  DATA:
657
  l_spras TYPE spras,
658
  l_spraslen TYPE i.
659
 
660
  CLEAR:
661
  c_laiso,
662
  c_sptxt.
663
 
664
  l_spraslen = strlen( i_spras ).
665
  IF l_spraslen = 2.
666
    c_laiso = i_spras.
667
    SELECT SINGLE spras FROM t002 INTO l_spras
668
        WHERE spras = i_spras.
669
  ELSE.
670
    l_spras = i_spras.
671
    SELECT SINGLE laiso FROM t002 INTO c_laiso
672
        WHERE spras = i_spras.
673
  ENDIF.
674
 
675
  SELECT SINGLE sptxt FROM t002t INTO c_sptxt
676
      WHERE spras = l_spras
677
      AND sprsl = sy-langu.
678
ENDFORM.                    "get_spras
679
 
680
 
681
*-----------------------------------------------------------------------
682
* get_tabstrip
683
*-----------------------------------------------------------------------
684
FORM get_tabstrip
685
  USING
686
    value(i_form) TYPE fieldname
687
    value(i_comp_value) TYPE any
688
  CHANGING
689
    ct_tabstrip TYPE it_tabstrip.
690
 
691
  FIELD-SYMBOLS:
692
  <ls_tabstrip> TYPE st_tabstrip.
693
 
694
  REFRESH ct_tabstrip.
695
 
696
  LOOP AT gt_tabstrip ASSIGNING <ls_tabstrip>
697
      WHERE form = i_form.
698
    IF NOT <ls_tabstrip>-comparator IS INITIAL.
699
      CASE <ls_tabstrip>-comparator.
700
        WHEN 'CO'.
701
          IF NOT i_comp_value CO <ls_tabstrip>-comp_value.
702
            CONTINUE.
703
          ENDIF.
704
      ENDCASE.
705
    ENDIF.
706
    APPEND <ls_tabstrip> TO ct_tabstrip.
707
  ENDLOOP.
708
  SORT ct_tabstrip BY tab_nr.
709
 
710
ENDFORM.                    "get_tabstrip
711
 
712
 
713
*-----------------------------------------------------------------------
714
* get_tabstrip_defined
715
*-----------------------------------------------------------------------
716
FORM get_tabstrip_defined
717
  USING
718
    it_tabstrip TYPE it_tabstrip
719
  CHANGING
720
    ct_tabstrip TYPE it_tabstrip.
721
 
722
  DATA:
723
  ls_tabstrip TYPE st_tabstrip,
724
  l_parent_id(100) TYPE c VALUE '#'.
725
 
726
  FIELD-SYMBOLS:
727
  <ls_tabstrip> TYPE st_tabstrip.
728
 
729
*opening status
730
  LOOP AT it_tabstrip INTO ls_tabstrip.
731
    IF ls_tabstrip-empty = abap_true.
732
      CASE g_empty_tab.
733
        WHEN gc_empty_tab_disable.
734
          ls_tabstrip-disabled = abap_true.
735
          APPEND ls_tabstrip TO ct_tabstrip.
736
        WHEN gc_empty_tab_display.
737
          APPEND ls_tabstrip TO ct_tabstrip.
738
        WHEN gc_empty_tab_hide.
739
          " do nothing
740
      ENDCASE.
741
    ELSE.
742
      APPEND ls_tabstrip TO ct_tabstrip.
743
    ENDIF.
744
  ENDLOOP.
745
*active tabs
746
  SORT ct_tabstrip BY parent_id active_order.
747
  LOOP AT ct_tabstrip ASSIGNING <ls_tabstrip>
748
      WHERE active_order > 0
749
      AND disabled = abap_false
750
      AND hidden = abap_false
751
      AND empty = abap_false.
752
    IF l_parent_id = <ls_tabstrip>-parent_id.
753
      CONTINUE.
754
    ENDIF.
755
    l_parent_id = <ls_tabstrip>-parent_id.
756
    <ls_tabstrip>-active = abap_true.
757
  ENDLOOP.
758
  SORT ct_tabstrip BY tab_nr.
759
 
760
ENDFORM.                    "get_tabstrip_defined
761
 
762
 
763
*-----------------------------------------------------------------------
764
* get_time
765
*-----------------------------------------------------------------------
766
FORM get_time
767
  USING
768
    value(i_time) TYPE sytime
769
  CHANGING
770
    c_time TYPE string.
771
 
772
  CONCATENATE i_time+0(2) ':' i_time+2(2) ':' i_time+4(2)
773
  INTO c_time.
774
ENDFORM.                    "get_time
775
 
776
 
777
*-----------------------------------------------------------------------
778
* get_trdir_name
779
*-----------------------------------------------------------------------
780
FORM get_trdir_name
781
  USING
782
    value(i_name) TYPE any
783
    value(i_type) TYPE char10
784
  CHANGING
785
    c_programm TYPE programm.
786
 
787
  DATA:
788
  l_len TYPE i,
789
  l_diff TYPE i.
790
 
791
  CONSTANTS:
792
  lc_eqlen TYPE i VALUE 30.
793
 
794
  c_programm = i_name.
795
  l_len = strlen( c_programm ).
796
  l_diff = lc_eqlen - l_len.
797
  DO l_diff TIMES.
798
    CONCATENATE c_programm '=' INTO c_programm.
799
  ENDDO.
800
  CONCATENATE c_programm i_type INTO c_programm.
801
 
802
ENDFORM.                    "get_trdir_name
803
 
804
 
805
*-----------------------------------------------------------------------
806
* get_trdir_name_method_include
807
*-----------------------------------------------------------------------
808
FORM get_trdir_name_method_include
809
  USING
810
    value(i_mtdkey) TYPE seocpdkey
811
  CHANGING
812
    c_programm TYPE program.
813
 
814
  DATA:
815
  l_index TYPE seomtdindx,
816
  l_num TYPE i,
817
  l_hex TYPE string,
818
  l_hex_index(3) TYPE c,
819
  l_type TYPE char10,
820
  l_len TYPE i.
821
 
822
  CLEAR c_programm.
823
  SELECT SINGLE methodindx FROM tmdir INTO l_index
824
    WHERE classname = i_mtdkey-clsname
825
    AND methodname = i_mtdkey-cpdname.
826
  IF sy-subrc = 0.
827
    l_num = l_index.
828
    PERFORM number_to_x_string
829
      USING l_num 36
830
      CHANGING l_hex.
831
    l_hex_index = l_hex.
832
    DO.
833
      l_len = strlen( l_hex_index ).
834
      IF l_len < 3.
835
        CONCATENATE '0' l_hex_index INTO l_hex_index.
836
      ELSE.
837
        EXIT.
838
      ENDIF.
839
    ENDDO.
840
    CONCATENATE 'CM' l_hex_index INTO l_type.
841
    PERFORM get_trdir_name
842
      USING i_mtdkey-clsname l_type
843
      CHANGING c_programm.
844
  ENDIF.
845
ENDFORM.                    "get_trdir_name_method_include
846
 
847
 
848
*-----------------------------------------------------------------------
849
* get_unpacked
850
*-----------------------------------------------------------------------
851
FORM get_unpacked
852
  USING
853
    value(i_number) TYPE any
854
  CHANGING
855
    c_str TYPE string.
856
 
857
  DATA:
858
  l_strlen TYPE i.
859
 
860
  c_str = i_number.
861
  CONDENSE c_str NO-GAPS.
862
  SHIFT c_str LEFT DELETING LEADING '0'.
863
  l_strlen = strlen( i_number ).
864
  IF c_str IS INITIAL AND l_strlen > 0.
865
    c_str = '0'.
866
  ENDIF.
867
ENDFORM.                    "get_unpacked
868
 
869
 
870
*-----------------------------------------------------------------------
871
* get_user
872
*-----------------------------------------------------------------------
873
FORM get_user
874
  USING
875
    value(i_bname) TYPE xubname
876
  CHANGING
877
    c_name_text TYPE ad_namtext.
878
 
879
  DATA:
880
  lt_adrp TYPE STANDARD TABLE OF adrp,
881
  l_persnumber TYPE ad_persnum.
882
 
883
  FIELD-SYMBOLS:
884
  <ls_adrp> TYPE adrp.
885
 
886
  CLEAR c_name_text.
887
  SELECT SINGLE persnumber FROM usr21 INTO l_persnumber
888
      WHERE bname = i_bname.
889
  SELECT * FROM adrp INTO TABLE lt_adrp
890
      WHERE persnumber = l_persnumber
891
      ORDER BY date_from DESCENDING.
892
  LOOP AT lt_adrp ASSIGNING <ls_adrp>.
893
    c_name_text = <ls_adrp>-name_text.
894
    IF NOT c_name_text IS INITIAL.
895
      EXIT.
896
    ENDIF.
897
  ENDLOOP.
898
ENDFORM.                    "get_user
899
 
900
 
901
*-----------------------------------------------------------------------
902
* get_version_info
903
*-----------------------------------------------------------------------
904
FORM get_version_info
905
  USING
906
    value(i_type) TYPE any
907
  CHANGING
908
    c_value TYPE string.
909
 
910
  DATA:
911
  l_index TYPE i,
912
  lt_version_info TYPE it_version_info.
913
 
914
  FIELD-SYMBOLS:
915
  <ls_version_info> TYPE st_version_info.
916
 
917
  CLEAR c_value.
918
 
919
  CASE i_type.
920
    WHEN 'SAP version'.           l_index =  1.
921
    WHEN 'operating system'.      l_index =  2.
922
    WHEN 'machine type'.          l_index =  3.
923
    WHEN 'node name'.             l_index =  4.
924
    WHEN 'SAP system id'.         l_index =  5.
925
    WHEN 'database system'.       l_index =  6.
926
    WHEN 'database name'.         l_index =  7.
927
    WHEN 'database host'.         l_index =  8.
928
    WHEN 'database owner'.        l_index =  9.
929
    WHEN 'rsyn'.                  l_index = 10.
930
    WHEN 'IP address'.            l_index = 11.
931
    WHEN 'kernel release'.        l_index = 12.
932
    WHEN 'database library'.      l_index = 13.
933
    WHEN 'kernel compiled'.       l_index = 14.
934
    WHEN 'kernel patch level'.    l_index = 15.
935
    WHEN 'supported SAP vers.'.   l_index = 16.
936
    WHEN 'supported database'.    l_index = 17.
937
    WHEN 'valid OP system'.       l_index = 18.
938
    WHEN 'OP system release'.     l_index = 19.
939
    WHEN 'ABAP load version'.     l_index = 20.
940
    WHEN 'CUA load version'.      l_index = 21.
941
    WHEN 'kernel kind'.           l_index = 22.
942
  ENDCASE.
943
 
944
  CALL 'SAPCORE' ID 'ID' FIELD 'VERSION'
945
                 ID 'TABLE' FIELD lt_version_info.
946
  READ TABLE lt_version_info ASSIGNING <ls_version_info>
947
    WITH KEY type = i_type.
948
  IF sy-subrc <> 0 AND l_index > 0.
949
    READ TABLE lt_version_info ASSIGNING <ls_version_info>
950
      INDEX l_index.
951
  ENDIF.
952
  IF sy-subrc = 0 AND <ls_version_info> IS ASSIGNED.
953
    c_value = <ls_version_info>-value.
954
 
955
    CASE i_type.
956
      WHEN 'database system'.
957
        IF c_value(3) = 'ADA'.
958
          c_value = 'SAP DB'.
959
        ENDIF.
960
    ENDCASE.
961
  ENDIF.
962
ENDFORM.                    "get_version_info