You are working on an ABSL Implementation and copied a code example from the Repository Explorer to your ABSL script file.
You were able to save the file but when activating it you get the message "Syntax Error in Generated ABAP Method".
SAP Cloud for Customer - all versions
- SAP Business ByDesign - all versions
- SAP Cloud Applications Studio - all versions
Reproducing the Issue
Open SAP Cloud Applications Studio
- Open the Repository Explorer
- Find the Code Example you need
- Copy it and paste in your ABSL script file
- Save the ABSL script file
- Activate the ABSL script file
- It will fail with error "Syntax Error in Generated ABAP Method"
This error message is displayed because you have to make adaptations into the Code Example you take from Repository Explorer.
You have to adjust it to fit in your code logic.
Code Examples are just hints on how you can proceed to implement determined functionalities. They are not pre-delivered functions.
Hence, you will always have to adjust the code examples to fit in your code logic.
In case of doubts on how to adjust the ABSL scripts please reach out to the SAP Cloud Applications Studio Community:
ABSL; SDK; Script; , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , How To