For those that are planning to upgrade the systems to a higher EhP, the dump ITS_UNEXPECTED_TOKEN (or ITS_UNDECLARED_FUNCTION) might happen in your ITSmobile applications.
This blog shows information about the dump and the solution for the issue.
ST22 Short dump
Looking at ST22, a short dump like the example below can be found:
"...
Category ABAP Programming Error
Runtime Errors ITS_UNEXPECTED_TOKEN
ABAP Program <ABAP Program>
Application Component Not assigned
Date and Time dd.mm.yyyy hh:mm:ss
...
Short Text
Template interpretation terminated, syntax error.
...
What happened?
The template templates/itsmobile/99/include/<template>.html
contains syntax errors and therefore could not be compiled. Cause of
error: The token "(" ("(") was not recognized.
The syntax error is in row: XX, column: YY
The HTMLB row with errors is:
" ... src="`mimeURL(~service="itsmobile",
~theme=99, ~language="", `sh()`>"
..."
Why this happened?
Due to the new function sh() which has been added recently to be W3C compliant, a change is required in the source code of the template
Solution
The solution is available in SAP note 2094088.
It is necessary to edit the custom CUA (Common User Area) include template, adding at the beginning the code from the note.
Additional steps
- Publish all templates with transaction siac_publish_all_int to make sure all templates are up to date (especially for the generator used);
- Run report siac_regenerate_templates and re-generate the templates of the ITSmobile service with the preferred generator;
- Publish all templates with transaction siac_publish_all_int to make sure the re-generated templates will take effect.