2021 Dec 13 5:23 AM
Hi All,
I know there is a question with almost the same title. However, mine is different because we are on the SAP BASIS 7.53, and therefore host expressions in WHERE must be supported. Moreover, this code has been successfully working for a year in DEV and for 7 months in PROD:
select single docnum, modus from zcaout_int_drive
where object = @zcl_asset_distribute=>obj_type_fixed_asset
and objectid = @( |{ me->company_code }{ me->asset }{ me->subnumber }| )
into (@me->send_idoc_number, @me->send_idoc_modus).
However, suddenly this codes started failing in all environments with the SYNTAX_ERROR. The message is misleading:
The field "SEND_IDOC_NUMBER, @ME" is unknown, but there is a field with the similar name "SEND_IDOC_NUMBER". "SEND_IDOC_NUMBER".
I discovered that if I comment out the OBJECTID condition, it compiles successfully:
select single docnum, modus from zcaout_int_drive
where object = @zcl_asset_distribute=>obj_type_fixed_asset
into (@me->send_idoc_number, @me->send_idoc_modus).
I also discovered that I can't use a construction expression VALUE here or even declaring a helper variable:
data(object_id) = value char90( |{ me->company_code }{ me->asset }{ me->subnumber }| ).
The error I'm getting is this:
1 errors found. Activate anyway?
Line 26: The type
"CHAR90" is not a structure.
This is really weird. I know there was a mysterious security patch on our S/4 system over the weekend, but whatever it was, it shouldn't have broken the existing working code. It looks like it downgraded the kernel version... though it still shows 7.53. Any ideas on what that could be? Or should we raise it with SAP directly?
2021 Dec 13 6:22 AM
at first Try to replace VALUE by CONV
could you debug the code and check before the execution the content of "me" ?
2021 Dec 13 6:31 AM
Well, CONV works in the assignment:
data(object_id) = conv char90( |{ me->company_code }{ me->asset }{ me->subnumber }| ).
However, it fails in WHERE with exactly the same error:
select single docnum, modus from zcaout_int_drive
where object = @zcl_asset_distribute=>obj_type_fixed_asset
and objectid = @( conv char90( |{ me->company_code }{ me->asset }{ me->subnumber }| ) )
into (@me->send_idoc_number,
@me->send_idoc_modus).
And the error:
1 errors found. Activate anyway?
Line 34: The field
"SEND_IDOC_NUMBER, @ME" is unknown, but there
is a field with the similar name
"SEND_IDOC_NUMBER". "SEND_IDOC_NUMBER".
So, the issue is not with "me", but with the host expression that involves a string template. As soon as I remove the string template, the syntax error disappears. It's strange that the original code had been working for almost 8 months till last weekend...
2021 Dec 13 6:46 AM
Maybe there was a patch or an oss note, did you check the SPAM ?
Did you check also for simple thing, like someone change the structre of the table 🙂
2021 Dec 13 6:48 AM
The structure wasn't changed. I can confirm. As for the patch - yes, our vendor applied a patch over the weekend. Monday morning - lots of dumps in production. Once correct, the code started crashing with a syntax error.
2021 Dec 13 7:02 AM
Maybe horst.keller could help you, or directly SAP Support.
If you could check this security patch info, it could help.
I know some security recommendation is to avoid dynamic code & select. But it should be a warning.
There is also a parameter in program ABAP Version I think, it could impact the code allowed, but I am not sure about it (Check example DEMO_ABAP_VERSIONS)
2021 Dec 13 7:02 AM
There was a security patch from PL 800 to PL 900, kernel 7.53. Probably, it's a side effect...
2021 Dec 13 7:08 AM
You have oss note looks like your issu:
2433966 - Programs contained Host Variables are terminated with SYNTAX_ERROR
but it seems to be corrected by other patch
2021 Dec 13 9:19 AM
concerning the note you mentioned, it's worth an answer!
2021 Dec 13 9:51 AM
Ola sandra.rossi, this is not related to the release of volodymyr.shcheglov
2021 Dec 14 8:24 AM
Thank you all for your contribution. I was overloaded with numerous production issues in our systems so I could not respond.
As for the patch (whatever it was), they rolled back the kernel to the previous version, and all worked well.
BTW, the vendor specified 2 kernel versions in the SOW: 7.53 and 7.73. The latter was upgraded to 7.77 PL400, while 7.53 was updated to PL 900. I don't know what that means. What I can see in System -> Status is this:
Component Release SP Level
SAP_BASIS 753 0002
SAP_ABA 75D 0002
S4CORE 103 0002<br>
I don't know where 7.73 comes from - that's with our vendor and their BASIS team.
Based on this, I don't think the note is relevant. Besides, the error is different. Moreover, host variables don't cause syntax errors - it's the host expression containing string template that was causing the syntax error after the patch. However, the note was useful - it described the process of searching for regressions introduced by particular kernel patches. Unfortunately, neither KRNL753PL900 nor KRNL777PL400 documented any regression we are experiencing.
Once I have more info on that from our vendor, I'll update the post here.
2022 Feb 22 12:59 AM
Hi All,
That much time has passed, but still no update from SAP. We raised an incident, 902273 / 2021, but SAP blames the user code. However, to me it doesn't make sense that in KRNL773PL400 the code is working, and in KRNL777PL400 it fails to even compile. Moreover, it seems like this regression was introduced in Kernel 7.77 right from the start. We tried with the lowest PL available, KRNL777PL5, and it showed the same syntax error. I'm surprised nobody discovered it till now. Am I the only person using string templates in host expressions?!
What I managed to do is to isolate the issue to the use of string templates in host expressions. As a reminder, the following code fails in KRNL777PL400:
select single docnum, modus from zcaout_int_drive
where object = @zcl_asset_distribute=>obj_type_fixed_asset
and objectid = @( |{ me->company_code }{ me->asset }{ me->subnumber }| )
into (@me->send_idoc_number, @me->send_idoc_modus).
However, if the host expression is modified slightly, it compiles just fine on the same kernel:
select single docnum, modus from zcaout_int_drive
where object = @zcl_asset_distribute=>obj_type_fixed_asset
and objectid = @( me->company_code && me->asset && me->subnumber )
into (@me->send_idoc_number, @me->send_idoc_modus).
So, it looks like kernel 7.77 breaks backward compatibility with 7.73 in the area of using string templates in host expressions. However, even now the SNote 3079989 doesn't list anything resembling this ABAP syntax regression. We really depend on SAP to accept it as a regression and investigate it further. The behaviour is consistent in our system.
Anyone on KRNL777, any patch level, can you please test a simple SELECT with string templates in host expressions in the WHERE clause? If you have the same issue, it will be a good proof of broken compatibility.
Thanks.
2022 May 27 7:18 AM
Anyone tested string templates in host expressions on kernel 777? Unfortunately, I can't track this issue anymore as I resigned from the company where I identified this issue. Moreover, my independent S-user ID got deleted so that I lost access to my content that I had created using that S-ID...
2022 May 27 8:23 AM
Just to say, kernel 785 is fine (code that anyone can try, not sure for Cloud):
DATA(first) = '0'.
DATA(second) = '00'.
SELECT SINGLE mandt, MTEXT FROM t000
WHERE mandt = @( |{ first }{ second }| )
INTO (@DATA(mandt), @DATA(mtext)).
Now, looking at what you have posted previously, that "SAP blames the user code", as it's unrelated to the issue you have posted, I'm surprised that they didn't say anything else specific to the actual issue... Usually, they do a test. Pity that you don't have access to the message anymore.