2020 Feb 07 12:23 PM
We have this program:
report zp_ca10_mat_used_in_bom2.
data bool type abap_bool.
START-OF-SELECTION.
data(scrap_wf) = zcl_ca10_scrap_wf=>new( ).
When we do a syntax check on it, the cursor goes to "abap_bool" on line 2 and the syntax checker says:
Type "ABAP_BOOL" is unknown.
Note that the class zcl_ca10_scrap_wf is active and has no syntax errors.
When we comment out the last line, the syntax check passes. Isn't that crazy?
We are working on ABAP 750.
2020 Feb 07 1:14 PM
Hi there, abap_bool type is definitely supported in 751 - SAP Help: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abendataobjects_true_value_guidl.htm
I can't tell about 750.
You can always use TYPE C LENGTH 1 instead. It's not the most elegant though.
Dominik Tylczynski
2020 Feb 07 1:27 PM
That's not the point. We have tons of programs that use abap_bool (without even declaring TYPE-POOLS ABAP.) They all work fine. Only programs that make use of this class seem to be affected.
2020 Feb 07 1:50 PM
2020 Feb 07 2:28 PM
In working in ABAP 750, EHP8, and no syntax check issue with use of abap_bool type...
Double click on type display that It's a type defined in ABAP type group as :
**** GENERAL ***********************************************************
types:
abap_bool type c length 1.
2020 Feb 07 2:54 PM
jrg.krause , I assume you did, but just to make sure: You also get the error if you explicetly include the TYPE-POOL: abap.
report zp_ca10_mat_used_in_bom2.
TYPE-POOLS: abap. " explicitly included
data bool type abap_bool.
START-OF-SELECTION.
data(scrap_wf) = zcl_ca10_scrap_wf=>new( ).
2020 Feb 07 3:13 PM
Dominik Tylczynski The OP said:
"When we comment out the last line, the syntax check passes."
2020 Feb 10 8:50 AM
abap_bool has been allowed without the type-pools declaration since 7.31
2020 Feb 07 3:00 PM
I think that your case was probably caused by a hideous thing called invisible character: it is a character but doesn't occupy any space (unlike a space character that is empty but takes one position, visible feedback).
I did reproduce your syntax error here with that invisible character. The easy way to fix is delete entire line (selecting when the mouse cursor flips) and retype.
Edit: I just found out this online tool to check for invisible characters, you can check if it really this issue by copy-pasting.
Best regards
2020 Feb 07 3:07 PM
That character is indeed weird and messes up the syntax check and if you dont know its hard to figure out what and where it is. Weird, where did you find that thing 😉
But this would mean, contrary to the claim in the question, that this character is between TYPE and abap_bool, thats at least how I reproduced it. And that it has nothing to do with the last line in the coding. So, interesting to see if that actually is the problem for this case.
2020 Feb 07 3:12 PM
How do you explain this OP remark?
"When we comment out the last line, the syntax check passes."
2020 Feb 07 3:20 PM
Unfortunately my lawyer advised me to not answer your question michael.piesche . Use your imagination to find out 🙂
2020 Feb 07 3:59 PM
sandra.rossi and michael.piesche I updated the answer with a tool to check it, its more a blindshot since there are no other cues than this until now. It's still a open X-Files.
2020 Feb 07 4:03 PM
It's not a matter of invisible character, as the OP explained: it works well in all cases except when the class mentioned is used. It's a kernel bug.
2020 Feb 07 3:28 PM
Just a thought - can you try different variable name instead of "bool" for example "custom_bool".
2020 Feb 07 4:08 PM
I can't think other than it's a kernel/syntax checker bug. Either contact SAP support (check SAP notes first of course), or if you want to "play to the detective", copy zcl_ca10_scrap_wf to a new class then remove half elements, test again, repeat until the error does not occur any more, then repeat again the whole process to better identify the culprit...
2020 Feb 09 7:03 PM
What happens if you comment out
data(scrap_wf) = zcl_ca10_scrap_wf=>new( ).<br>
I've noticed some odd syntax errors coming up from time to time with functional method calls not quite correctly expressed.
Also, is zcl_ca10_scrap_wf syntactically correct?
2020 Feb 10 7:34 AM
I really think it's a kernel bug. When I add the type-pools abap declaration, the syntax check passes:
report zp_ca10_mat_used_in_bom2.
type-pools abap.
data bool type abap_bool.
START-OF-SELECTION.
data(scrap_wf) = zcl_ca10_scrap_wf=>new( ).
2020 Feb 10 8:47 AM
It's beginning to seem likely. but I'm not totally convinced. By adding the type pool, you could be somehow masking what's up with abap_bool.
What happens if you do this:
report zp_ca10_mat_used_in_bom2.
data zbool type abap_bool.
START-OF-SELECTION.
data(scrap_wf) = zcl_ca10_scrap_wf=>new( ).
(Which tomas.buryanek suggest above) If that gives you the same issue, then I'd say it's definitely kernel. And if it doesn't, it's probably a language restriction with bool somehow being a reserved word or something - which is also kernel really!
2020 Feb 10 8:50 AM
2023 Feb 07 4:56 AM
If a syntax error appears, check to make sure that the parentheses are matched up correctly. If one end is missing or lined up incorrectly, then type in the correction and check to make sure that the code can be compiled. Keeping the code as organized as possible also helps.
Regards,
Rachel Gomez
2024 May 09 9:03 PM
Did you ever find out the reason for this? I have a very similar issue.