2018 Nov 26 6:16 AM
Hello Experts,
I have created a global class in SE24 and when i am trying to execute that class in direct SE24 its giving some error "Syntax error in test Display generated test environment?" but when i am calling into program and executing its working fine and when i am checking syntax check there no error. Anybody can help me on this.
Referred below link but couldn't understand.
https://archive.sap.com/discussions/thread/525480
Thanks,
2018 Nov 26 9:52 AM
Did you try to perform a syntax check?
Maybe in your report you invoke a method not afflicted by the error, but something is going wrong somewhere else.
2018 Nov 26 10:48 AM
2018 Nov 26 11:58 AM
And it was.... ?
If the issue is resolved, please, share the answer and close the question so other people stumbling on it will get an help.
2023 Dec 17 4:00 PM
I had the same error and discovered that the cause was a line in my class code that was too long. I declared some local types, and some of the parameters in my methods were defined of that type, so that the whole line of code looked something like this:
CLASS-METHODS do_something
IMPORTING iv_parameter_name TYPE zcl_my_long_class_name=>ts_my_structure_type-field_in_structure.
This line of code was too long. I've changed the parameter's type to a dictionary type, made sure that there were no other long lines of code in the class, tried to re-generate the test class environment, and it worked.
2023 Dec 17 10:03 PM
Probably there are other possible syntax errors (as I could see by searching the SAP notes), would you recommend a place where to add a break-point in the standard code of SE37 to know which exact syntax error it is? Maybe adding a break-point at statement SYNTAX-CHECK, INSERT REPORT or something like that could be sufficient?
2023 Dec 19 2:27 PM
Hi Sandra,
The steps I took to discover this are as follows:
So, in summary:
Good luck!