on 05-07-2014 3:11 PM
First and foremost I am a Gateway Newbie... I created a Gateway service via SEGW to read incident reports in EHS. We are developing a concept mobile application for that will create and read EHS incident reports, based upon HANA PA. I tested the BAPI's BAPI_BUS1240_GETDETAIL for the read and BAPI_BUS1240_CREATE for the Create (both via SE37 ) and they worked perfectly. When creating the gateway Models, I am getting the error.
Invalid key predicate type for 'Scenario'. Expected type is 'Edm.Binary'</message>
Yet the entity type it is defined as the following
Scenario | 1 | Edm.Binary | 0 | 0 | 0 |
KeyDate | 1 | Edm.DateTime | 0 | 0 | 0 |
RecordNo | 0 | Edm.String | 0 | 0 | 20 |
CreatedOn | 0 | Edm.DateTime | 0 | 0 | 0 |
CreatedBy | 0 | Edm.String | 0 | 0 | 12 |
Incident | 1 | Edm.String | 0 | 0 | 20 |
Type | 0 | Edm.String | 0 | 0 | 3 |
Plant | 0 | Edm.String | 0 | 0 | 4 |
Status | 0 | Edm.String | 0 | 0 | 5 |
Event | 0 | Edm.String | 0 | 0 | 60 |
DamageType | 0 | Edm.String | 0 | 0 | 21 |
FunctLoc | 0 | Edm.String | 0 | 0 | 30 |
Equipment | 0 | Edm.String | 0 | 0 | 18 |
Langu | 0 | Edm.String | 0 | 0 |
Here is the URL I am submitting via /IWFND/GW_CLIENT
/sap/opu/odata/sap/ZINC_SRV/Zinc(Scenario='00',KeyDate='2014-05-06T00:00:00',Incident='00000000000000000016')
What am I doing wrong?
Thanks for all of the assistance!!!
Chris
In the URL you've got Scenario='00' - I bet this is being interpreted as a string being sent and the service is expecting a Binary value.
According to OData documentation type Edm.Binary is an array of bytes up to 64 KB in size. Are you sure the type should be Binary? Won't Edm.String work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you for your response..
In SEGW, when I tried to change the Data Model Entity Set Property of Scenario from Edm.Binary to Edm.String, I get a hard Error. "data source Attribute SCENARIO and model Property scenario have different types". So I am not sure what to do here
Any advice is welcome.
Do i have to handle this with ABAP?
Chris
The problem is that the SCENARIO import parameter in BAPI_BUS1240_GETDETAIL is defined as type RAW in SAP. That is why it gets converted to Edm.Binary when you map your Gateway operation to an RFC function module. I'm not even sure you can effectively use this type as the key in GET_ENTITY (or how to build a URL that would work). What I'd do is create a ZBAPI wrapper function module where SCENARIO would be defined as string. In the new fm I'd convert the string coming from the OData request to RAW. Please take a look at this post to see how a conversion can be done: . Just keep in mind you have to do that in the other direction.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.