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
|
REPORT zstkoes_fixed_values_de.
DATA:
gv_genflag TYPE genflag,
gv_char TYPE c,
gv_system_language TYPE langu,
gv_second_language TYPE langu,
gv_select_language TYPE langu VALUE 'I'.
call 'C_SAPGPARAM' id 'NAME' field 'zcsa/system_language'
id 'VALUE' field gv_system_language.
call 'C_SAPGPARAM' id 'NAME' field 'zcsa/second_language'
id 'VALUE' field gv_second_language.
* Es ist wichtig zu prüfen, dass eine Variable im Dictionary existiert, um einen Dump zu verhindern.
IF cl_abap_elemdescr=>describe_by_data( gv_char )->is_ddic_type( ) EQ abap_true.
DATA(gt_fixed_values_char) = CAST cl_abap_elemdescr( cl_abap_elemdescr=>describe_by_data( gv_char ) )->get_ddic_fixed_values( ).
ENDIF.
IF cl_abap_typedescr=>describe_by_data( gv_genflag )->is_ddic_type( ) EQ abap_true.
DATA(gt_fixed_values) = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( gv_genflag ) )->get_ddic_fixed_values( ).
ENDIF.
IF cl_abap_typedescr=>describe_by_data( gv_genflag )->is_ddic_type( ) EQ abap_true.
DATA(gt_fixed_values_it) = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( gv_genflag ) )->get_ddic_fixed_values( gv_select_language ).
ENDIF.
cl_demo_output=>next_section( title = |Systeminformation| ).
cl_demo_output=>write_text( text = |Systemsprache: { gv_system_language }{
cl_abap_char_utilities=>newline }Zweite Sprache: { gv_second_language }{
cl_abap_char_utilities=>newline }Anmeldesprache: { sy-langu }| ).
cl_demo_output=>end_section( ).
cl_demo_output=>next_section( title = |Beschaffung der Festwerte in der Anmeldesprache| ).
cl_demo_output=>write_text( text = |Wenn die Festwerte nicht in der Anmeldesprache existieren, wird die zweite Sprache benutzt| ).
cl_demo_output=>write_data(
name = |{ COND #( WHEN line_exists( gt_fixed_values[ 1 ] ) AND gt_fixed_values[ 1 ]-ddlanguage EQ sy-langu
THEN |Werte in Anmeldesprache|
ELSE |Werte in zweiter Sprache| ) }|
value = COND #( WHEN line_exists( gt_fixed_values[ 1 ] ) THEN gt_fixed_values ) ).
cl_demo_output=>end_section( ).
cl_demo_output=>next_section( title = |Beschaffung der Festwerte in ausgewählter Sprache { gv_select_language }| ).
cl_demo_output=>write_text( text = |Wenn die Festwerte nicht in der ausgewählten Sprache existieren, wird die zweite Sprache benutzt| ).
cl_demo_output=>write_data(
name = |{ COND #( WHEN line_exists( gt_fixed_values_it[ 1 ] ) AND gt_fixed_values_it[ 1 ]-ddlanguage EQ gv_select_language
THEN |Werte in ausgewählter Sprache|
ELSE |Werte in zweiter Sprache| ) }|
value = COND #( WHEN line_exists( gt_fixed_values_it[ 1 ] ) THEN gt_fixed_values_it ) ).
cl_demo_output=>end_section( ).
cl_demo_output=>display( ).
|