SAP-samples / abap-platform-refscen-flight

SFlight is back! This is the Flight Reference Scenario for the ABAP RESTful Application Programming Model.
Apache License 2.0
230 stars 93 forks source link

The use of Data Element /DMO/AGENCY_ID is not permitted. #33

Open chansmann opened 4 months ago

chansmann commented 4 months ago

After importing and activating the packages this Error comes up in my ADTs when trying create a database table. This message appears at every line where I try to use a data element of the flight package.

What's wrong?

image
VolkerDrees commented 4 months ago

Hello, can you specify the type of system you are using (SAP BTP ABAP Environment, SAP S/4HANA Cloud private edition, SAP S/4HANA Cloud public edition)? Which software component / language version was used for installing the /DMO/ sample content? Which software component are you using for your table zrap100_atrav000 ?

The error you are getting indicates that you are not allowed to access the /DMO/ artifacts. This can happen if you have installed the /DMO/ content in a package that uses the language version "Standard ABAP". Or you are trying to consume the /DMO/ artifacts in a package that is not having "ZLOCAL" as the software component.

Best Regards, Volker

chansmann commented 4 months ago

Hello, thanks for your reply.

There is no Superpackage in my /DMO/FLIGHT.

image

You are right! The /DMO/FLIGHT has Standard ABAP as Language Version.

Can I simply change it or do I have to remove the package and install it again in a package with ABAP for Cloud Development set?

Thank you for your help!

Best regards Chris

VolkerDrees commented 3 months ago

Hello Chris, thanks for the detailed explanation. Changing the language version of a package doesn't change the language version of the contained artifacts. It only defaults the language version for new artifacts. In your case I'd propose to work in a Z-package that is based on the software component LOCAL. WIth this you work entirely in language version "Standard ABAP" and should not get the initially mentioned errors. Best Regards, Volker

chansmann commented 3 months ago

It works now! Thank you for your support.

In my case there was no LOCAL Package created yet. So I created one named $LOCAL and set up "Standard ABAP" as language version. After that I created my tutorial package in this $LOCAL package, so both (/DMO/FLIGHT and Tutorial Package) are on the same language version.

As VolkerDrees already mentioned, I accidentally set up the /DMO/FLIGHT Package as "Standard ABAP" language version. Problem with that is that this Language version has waaaay less syntax restrictions as the "ABAP Cloud Development" language version. Sooo if you install the Flight data with this language version, you can't later access it through a package what is installed with the "ABAP Cloud Development" language version, due to high syntax restrictions.

babu4abap commented 3 weeks ago

Hi @VolkerDrees , I am using ABAP Trail 2022 system. I have created z* package with software component as local but still facing similar issue.

image image

But there was another ztable created in same Zpackage yesterday for August CDS challenge activated with out any issue. Could you please let me know what is the issue and how I can practise ABAP trail system with custom objects.

image
VolkerDrees commented 2 weeks ago

Hello babu4abap, in the language version "ABAP for Cloud Development" you can only access released artifacts or artifacts belonging to the same software component. I assume the package /DMO/FLIGHT in your case has a different software component - and therefore the problem occurs. So either make sure to use the same software component in both packages, or switch to "Standard ABAP" as the language version.