How do I effectively report a 'bug', with the new syntax introduced in ABAP 7.40?
I saw someone reporting bugs, as comments in Horst Keller's blogs. I am just learning new syntaxes and so, this isn't a true production down situation to report as a OSS message. Moreover, do ABAP syntax check errors also get reported in the same way as functionality bugs?
Just to document my findings, so that it may help anyone whoever is reading this:
It seems that the new constructor VALUE, forgot a CLEAR statement, in the LOOP.
Here, I am declaring a table, with 3 fields A, B and C. Then, I am populating values, 1, 2 and 3 into them and displaying output.
report value.
types:begin of st1,
a type c,
b type c,
c type c,
end of st1,
tb1 type standard table of st1 with non-unique key a b c.
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 ) ) ).
The expected output is:
A | B | C |
---|---|---|
1 | 2 | 3 |
And, the actual output, matches the expected output.
Now, I am adding more rows to the table:
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 )
( b = 2 c = 3 )
( c = 3 )
( b = 2 ) ) ).
The expected output is:
A | B | C |
---|---|---|
1 | 2 | 3 |
2 | 3 | |
3 | ||
2 |
And, the actual output, matches the expected output.
Now, I am adding some conditions to the field populating logic.
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 )
( c = cond #( when 1 = 2 then 4 else 3 ) )
( b = 2 )
( c = cond #( when 1 = 1 then 4 else 3 ) )
( b = cond #( when 1 = 2 then 5 else 2 ) ) ) ).
The expected output is:
A | B | C |
---|---|---|
1 | 2 | 3 |
3 | ||
2 | ||
4 | ||
2 |
The actual output is:
Where did the extra 2, in the column B of 4th row come from? I am not populating that in the table.
One more try:
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 )
( c = cond #( when 1 = 2 then 4 else 3 ) )
( b = 2 )
( c = cond #( when 1 = 1 then 4 else 3 ) )
( a = 1 c = 3 )
( b = cond #( when 1 = 2 then 5 else 2 ) ) ) ).
Again, where did the extra 2, in rows 4 & 5, come from?
Note that it didn't copy column A or C over in the same fashion - so copy behavior is arbitrary? This happens only when I try to add a function within the VALUE operator.
VALUE operator without additional built-in function.
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 )
( c = 3 )
( b = 2 )
( c = 4 )
( a = 1 c = 3 )
( b = 2 ) ) ).
And, the output is perfect once more.
The only way around this as of this moment, seems to be, is to explicitly populate every field in every row.
cl_demo_output=>display_data( value tb1(
( a = 1 b = 2 c = 3 )
( a = space b = space c = cond #( when 1 = 2 then 4 else 3 ) )
( a = space b = 2 c = space )
( a = space b = space c = cond #( when 1 = 1 then 4 else 3 ) )
( a = 1 b = space c = 3 )
( a = space b = cond #( when 1 = 2 then 5 else 2 ) c = space ) ) ).
I am on SP10, with support package SAPKA74010. Is this issue already reported and corrected in a later patch? If so, please forgive me.
Thanks,
Juwin