Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Flight Reference Scenario On-Premise: "INCLUDE is not allowed in the restricted language scope"

0 Kudos

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?

13 REPLIES 13

Sandra_Rossi
Active Contributor
0 Kudos

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

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

jeanabrahamll According to me, there's no official online SAP training before SAP created them for the Cloud one year ago. But the ABAP documentation is full of examples, and ABAP systems are installed with lots of demo programs, etc.

0 Kudos

Sandra thanks for your answer! I will check the programs.

jeanabrahamll
Explorer

Hi Martin!

Did you find a solution or workaround to solve the error?

Thanks

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

sluepsch
Explorer
0 Kudos

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

0 Kudos

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

sluepsch
Explorer
0 Kudos

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( ).

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

stefan.luepsch the lines from 1850-1852 that include /dmo/if_flight_legacy seem to be the problem.