Skip to Content

Error in using key predicates

Hi all,

When executing the service URL with key predicates i am getting an error raised by exception /IWBEP/CX_MGW_TECH_EXCEPTION (message Internal error occurred, contact your system.).

The Associations, Referential constraints and Navigation properties have been maintained correctly.

The key predicates being passed are:

Airlineid='AA',Connectid='0017',Flightdate=datetime'2013-09-04T00:00:00'

The complete URL looks like:

http://<host>:<port>/sap/opu/odata/SAP/FLIGHTLISTDCR/FlightLists(Airlineid='AA',Connectid='0017',Flightdate=datetime'2013-09-04T00:00:00')/FlightDetail where FlightLists is the name of the Entity set and FlightDetail is the name of the Navigation property. Without the key predicates the entity set  returns the desired result.

Metadata

<?xml version="1.0" encoding="utf-8" ?>

- < edmx:Edmx Version =" 1.0 " xmlns:edmx =" http://schemas.microsoft.com/ado/2007/06/edmx "     xmlns:m =" http://schemas.microsoft.com/ado/2007/08/dataservices/metadata " xmlns:sap =" http://www.sap.com/Protocols/SAPData " >

- < edmx:DataServices m:DataServiceVersion =" 2.0 " >

- < Schema Namespace =" FLIGHTLISTDCR " xml:lang =" en " xmlns =" http://schemas.microsoft.com/ado/2008/09/edm " >

- < EntityType Name =" FlightDetail " sap:content-version =" 1 " >

- < Key >

< PropertyRef Name =" Airlineid " />

< PropertyRef Name =" Connectid " />

< PropertyRef Name =" Flightdate " />

</Key>

< Property Name =" Flighttime " Type =" Edm.Int32 " Nullable =" false " sap:label =" Flight time " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Distance " Type =" Edm.Decimal " Nullable =" false " Precision =" 9 " Scale =" 4 " sap:label =" Distance " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" CurrIso " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" ISO code " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Econofree " Type =" Edm.Int32 " Nullable =" false " sap:label =" Free seats " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Businfree " Type =" Edm.Int32 " Nullable =" false " sap:label =" Free seats " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Firstfree " Type =" Edm.Int32 " Nullable =" false " sap:label =" Free seats " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Curr " Type =" Edm.String " Nullable =" false " MaxLength =" 5 " sap:label =" Airline local currency " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airlineid " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Airline " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airline " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Airline " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Connectid " Type =" Edm.String " Nullable =" false " MaxLength =" 4 " sap:label =" Connection Number " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Price " Type =" Edm.Decimal " Nullable =" false " Precision =" 23 " Scale =" 4 " sap:label =" Airfare " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Flightdate " Type =" Edm.DateTime " Nullable =" false " sap:label =" Flight Date " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airportfr " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Departure airport " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Cityfrom " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Depart. city " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Arrdate " Type =" Edm.DateTime " Nullable =" false " sap:label =" Arrival date " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airportto " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Destination airport " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Cityto " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Arrival city " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Deptime " Type =" Edm.Time " Nullable =" false " sap:label =" Departure time " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Arrtime " Type =" Edm.Time " Nullable =" false " sap:label =" Arrival Time " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

</EntityType>

- < EntityType Name =" FlightList " sap:content-version =" 1 " >

- < Key >

< PropertyRef Name =" Flightdate " />

< PropertyRef Name =" Connectid " />

< PropertyRef Name =" Airlineid " />

</Key>

< Property Name =" Airportto " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Destination airport " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Cityfrom " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Depart. city " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airportfr " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Departure airport " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Flightdate " Type =" Edm.DateTime " Nullable =" false " sap:label =" Flight Date " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Connectid " Type =" Edm.String " Nullable =" false " MaxLength =" 4 " sap:label =" Connection Number " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airline " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Airline " sap:creatable =" false "     sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Airlineid " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" Airline " sap:sortable =" false "     sap:filterable =" false " />

< Property Name =" Cityto " Type =" Edm.String " Nullable =" false " MaxLength =" 20 " sap:label =" Arrival city " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Deptime " Type =" Edm.Time " Nullable =" false " sap:label =" Departure time " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Arrtime " Type =" Edm.Time " Nullable =" false " sap:label =" Arrival Time " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Arrdate " Type =" Edm.DateTime " Nullable =" false " sap:label =" Arrival date " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Price " Type =" Edm.Decimal " Nullable =" false " Precision =" 23 " Scale =" 4 " sap:label =" Airfare "     sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" Curr " Type =" Edm.String " Nullable =" false " MaxLength =" 5 " sap:label =" Airline local currency " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< Property Name =" CurrIso " Type =" Edm.String " Nullable =" false " MaxLength =" 3 " sap:label =" ISO code " sap:creatable =" false " sap:updatable =" false " sap:sortable =" false " sap:filterable =" false " />

< NavigationProperty Name =" FlightDetail " Relationship =" FLIGHTLISTDCR.FlightListFlightDetail " FromRole =" FromRole_FlightListFlightDetail " ToRole =" ToRole_FlightListFlightDetail " />

</EntityType>

- < Association Name =" FlightListFlightDetail " sap:content-version =" 1 " >

< End Type =" FLIGHTLISTDCR.FlightList " Multiplicity =" 1 " Role =" FromRole_FlightListFlightDetail " />

< End Type =" FLIGHTLISTDCR.FlightDetail " Multiplicity =" 1 " Role =" ToRole_FlightListFlightDetail " />

- < ReferentialConstraint >

- < Principal Role =" FromRole_FlightListFlightDetail " >

< PropertyRef Name =" Flightdate " />

< PropertyRef Name =" Connectid " />

< PropertyRef Name =" Airlineid " />

</Principal>

- < Dependent Role =" ToRole_FlightListFlightDetail " >

< PropertyRef Name =" Flightdate " />

< PropertyRef Name =" Connectid " />

< PropertyRef Name =" Airline " />

</Dependent>

</ReferentialConstraint>

</Association>

- < EntityContainer Name =" FLIGHTLISTDCR " m:IsDefaultEntityContainer =" true " >

< EntitySet Name =" FlightDetails " EntityType =" FLIGHTLISTDCR.FlightDetail " sap:pageable =" false " sap:addressable =" false " sap:content-version =" 1 " />

< EntitySet Name =" FlightLists " EntityType =" FLIGHTLISTDCR.FlightList " sap:requires-filter =" true " sap:content-version =" 1 " />

- < AssociationSet Name =" AssocSet_FlightListFlightDetail " Association =" FLIGHTLISTDCR.FlightListFlightDetail " sap:creatable =" false " sap:updatable =" false " sap:deletable =" false " sap:content-version =" 1 " >

< End EntitySet =" FlightLists " Role =" FromRole_FlightListFlightDetail " />

< End EntitySet =" FlightDetails " Role =" ToRole_FlightListFlightDetail " />

</AssociationSet>

</EntityContainer>

< atom:link rel =" self " href =" http://<host>:8000/sap/opu/odata/sap/FLIGHTLISTDCR/$metadata "     xmlns:atom =" http://www.w3.org/2005/Atom " />

< atom:link rel =" latest-version " href =" http://<host>:8000/sap/opu/odata/sap/FLIGHTLISTDCR/$metadata "     xmlns:atom =" http://www.w3.org/2005/Atom " />

</Schema>

</edmx:DataServices>

</edmx:Edmx>

The Error log message is vague and is as follows:

Internal error occurred, contact your system administrator.

Shall be grateful for any hints which could help me resolve this issue.

regards

Nitesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 06, 2013 at 10:08 PM

    Hi Nitesh

    In the payload of a query do you get related links, if so how do they represent the predicate.

    eg <link rel=

    You may want to have a look in the log, check where it throws the exception and put a break point in and debug.

    Cheers

    John P

    Add comment
    10|10000 characters needed characters exceeded

    • Hi All,

      Debugging revealed that there is an issue in the service implementation using the 'Map to Data Source' option to a BAPI method.

      In my case the ABAP code generated automatically in the Method <Entity type>_GET_ENTITY in my BASE class for mapping key fields had ONE key field missing. This bug is there in a specific scenario which is currently unknown to me.

      I created a new project, maintained the respective objects as before and now the key predicates are working correctly.

      Anyone using referential constraints in their project kindly check the code in the Base class in case you get errors!!!

      I will post this bug in OSS and have SAP look at it.

      regards

      Nitesh