Skip to content

Commit

Permalink
bugfix, abap_abstypename
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Oct 10, 2023
1 parent 2502f3e commit d119d42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/rtti/cl_abap_typedescr.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CLASS cl_abap_typedescr DEFINITION PUBLIC.
DATA ddic TYPE abap_bool.
DATA length TYPE i.
DATA decimals TYPE i.
DATA absolute_name TYPE string.
DATA absolute_name TYPE abap_abstypename.
DATA relative_name TYPE string.

CONSTANTS typekind_any TYPE abap_typekind VALUE '~'.
Expand Down Expand Up @@ -428,7 +428,7 @@ CLASS cl_abap_typedescr IMPLEMENTATION.

* this is not completely correct, local type names and ddic names might overlap, but will work for now,
* todo: use/check getDDICName() in the future,
WRITE '@KERNEL if(abap.DDIC[type.get().absolute_name.get().toUpperCase()]) { type.get().ddic.set("X"); }'.
WRITE '@KERNEL if(abap.DDIC[type.get().absolute_name.get().toUpperCase().trimEnd()]) { type.get().ddic.set("X"); }'.

TRANSLATE type->absolute_name TO UPPER CASE.
TRANSLATE type->relative_name TO UPPER CASE.
Expand Down
4 changes: 2 additions & 2 deletions src/rtti/cl_abap_typedescr.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
METHODS is_ddic_type_true2 FOR TESTING.
METHODS is_ddic_type_false FOR TESTING.

METHODS contant_field_absolute FOR TESTING.
METHODS constant_field_absolute FOR TESTING.
METHODS structure_field_absolute FOR TESTING.
METHODS unnamed_type FOR TESTING.
METHODS describe_by_dashed FOR TESTING.
Expand Down Expand Up @@ -507,7 +507,7 @@ CLASS ltcl_test IMPLEMENTATION.
exp = 16 ).
ENDMETHOD.

METHOD contant_field_absolute.
METHOD constant_field_absolute.
DATA lo_descr TYPE REF TO cl_abap_typedescr.
lo_descr = cl_abap_typedescr=>describe_by_data( lif_test_types=>c_foo-true ).

Expand Down
9 changes: 9 additions & 0 deletions src/unit/cl_abap_unit_assert.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
METHODS differs FOR TESTING RAISING cx_static_check.
METHODS cp1 FOR TESTING RAISING cx_static_check.
METHODS cp2 FOR TESTING RAISING cx_static_check.
METHODS cp3 FOR TESTING RAISING cx_static_check.
METHODS char_eq_string FOR TESTING RAISING cx_static_check.
METHODS decfloat34_eq FOR TESTING RAISING cx_static_check.
METHODS decfloat34_ne FOR TESTING RAISING cx_static_check.
Expand Down Expand Up @@ -60,6 +61,14 @@ CLASS ltcl_test IMPLEMENTATION.
exp = '*oo*' ).
ENDMETHOD.

METHOD cp3.
DATA foo TYPE c LENGTH 200.
foo = '\CLASS=LIF_TEST_TYPES\TYPE=FOO'.
cl_abap_unit_assert=>assert_char_cp(
act = foo
exp = '*\TYPE=FOO' ).
ENDMETHOD.

METHOD initial_numbers.
DATA foo TYPE i.
DATA bar TYPE f.
Expand Down

0 comments on commit d119d42

Please sign in to comment.