10-06-2020 10:14 PM
Hi Community,
I have recently started to get into ABAP-Development. I have set up an ABAP 752 SP04 Developer on-premise Environment (as outlined here: https://blogs.sap.com/2019/07/01/as-abap-752-sp04-developer-edition-to-download/), with which I worked on my first tutorials.
A few days ago, I pulled the ABAP Flight Reference Scenario from GitHub (https://github.com/SAP-samples/abap-platform-refscen-flight/tree/On-Premise-1909) and followed the installation steps until the end without any errors. However, when I run the Data Generator, the following error occurs:
"This variant of the command "INCLUDE" is not allowed in the restricted language scope."
The only reason that I managed to identify is, that the Scenario requires an Application Server ABAP 7.54 but the developer version is only 7.52. However, in the tutorial, it is listed as compatibel, e.g. here: https://developers.sap.com/tutorials/abap-env-create-table-type.html). I have also tried it in the Cloud-Environment, there it run's without complaints.
Any suggestions on what I could do to solve the error?
10-07-2020 1:15 PM
So the error is:
This variant of the command "INCLUDE" is not allowed in the restricted language scope.
You have several kinds of ABAP, this one is only for the Cloud.
The Developer Edition is only "standard ABAP".
For more information: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_versions.htm
12-11-2020 11:23 PM
Hi Sandra!
Where I can find other model to implement on AS ABAP 7.52? I been searching on internet but I cannot find any to practice ABAP.
Thanks
12-12-2020 8:19 AM
12-12-2020 2:05 PM
12-11-2020 11:25 PM
Hi Martin!
Did you find a solution or workaround to solve the error?
Thanks
12-13-2020 5:38 PM
Hi Jeanette,
as far as I understood, the FlightRef Scenario is not compatible with the SAP Netweaver Developer Version. I finished the tutorials with a Cloud Trial account. I am still looking for good tutorials for the Netweaver Developer Version.
Best regards
Martin
12-06-2021 5:52 PM
Stumbled over this as well. This is what I did to generate flight data under ABAP 7.50:
1a) Create a custom report, copy all local Definitions/Implementations of demo class /DMO/CL_FLIGHT_DATA_GENERATOR
1b) create main method and copy coding from method if_oo_adt_classrun~main of above demo class
In order to fix syntax and runtime errors I applied these changes
1) replace out->write with cl_demo_output=>write or delete these lines at all. Replace ( out ) with ( ) in main method.
2) comment out DEFINITION DEFERRED and DEFINITION LOCAL FRIENDS lines
3) METHOD generate_description. Comment out WHEN 1 and WHEN 2 as DISCARDING DUPLICATES MAPPING statement is not known yet and there are duplicates,
4a) create local calculate_flight_price method in CLASS lcl_flight_data_generator and CLASS lcl_travel_data_generator.
4b) replace /dmo/cl_flight_data_generator=>calculate_flight_price with your method
4c) use coding from /dmo/cl_flight_legacy=>calculate_flight_price
5) METHOD build_booking. Remove DISCARDING DUPLICATES.
6) METHOD get_flight_info. SELECT COUNT(*) FROM @gt_plane_types... loop this internal table instead of SELECT
12-08-2021 2:38 PM
Hi Stefan,
thank's for your reply. I tried your solution but could not figure out how your custom report and main method looked like exactly. Could you - by any chance - share the exact content of your report with me?
Best
Martin
12-08-2021 9:36 PM
Hi Martin
Steps 1a and 1b
In the Z-report
**add coding from local definitions here
**main method
CLASS lcl_data_generator DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: main.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_data_generator IMPLEMENTATION.
METHOD main.
**add coding from IF_OO_ADT_CLASSRUN~MAIN here (without METHOD if_oo_adt...)
ENDCLASS.
START-OF-SELECTION.
lcl_data_generator=>main( ).
12-13-2021 1:41 PM
Hi Stefan,
thank you for your detailed explanations. I managed to remove all syntax errors expect for one. Please see the screenshot below as a refrence. I did some background search and it looks like that the standard CDS view I_Countrytext is not available in my system. I am using the developer version of SAP AS ABAP 7.52 (https://blogs.sap.com/2019/07/01/as-abap-752-sp04-developer-edition-to-download/) on with a Sybase DB. Do you have any ideas how I could solve that issue?
Best
Martin
12-13-2021 6:15 PM
Hi Martin
I can find this view in package FINS_FIS_FICO.
I think you just have to replace with LAND1 and FIS_LANDX50
The view is used in METHOD build_dependend_content.
SELECT FROM i_countrytext FIELDS country, countryname WHERE language = 'E' INTO TABLE @gt_countryname.
So just amend this as well.
Hope this solves the syntax error.
Regards
Stefan
01-11-2022 9:01 PM
Hi Stefan,
I appreciate your continous support. Thank's to your screenshot, I was able to find a view in my system that is identical to yours. I was able to use it and resolve any syntax error in the program.
However, when I was executing the program, I run into another error. Please see the screenshots below for a reference.
Did you run into the same issue or how did you solve it? I will post the lines of code in the screenshot below.
Best
Martin
01-11-2022 9:04 PM
stefan.luepsch the lines from 1850-1852 that include /dmo/if_flight_legacy seem to be the problem.