cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori CRM My Opportunity App OData Error

Former Member
0 Kudos

Hi All,

We are trying to execute the OData Url for the Service CRM_Opportunity.

/sap/opu/odata/sap/CRM_OPPORTUNITY/$metadata - This metadata works fine. We are able to see all the entity and its structures.

This has an Entity - Opportunity.

When we try /sap/opu/odata/sap/CRM_Opportunity/Opportunity -  we are facing an error

"Resource not found for segment 'Opportunity'   

This has an Entity set - Opportunities.

When we try /sap/opu/odata/sap/CRM_Opportunity/Opportunities- we are not facing any error but the structure is not getting displayed.

Can we map the entity set to the URL?

We are using the SAP Gateway version

-UIX02CRM - Version 0002 - SAPK-10002INUIX02CRM

-UIX01EAP - Version 0003 - SAPK-10003INUIX01EAP

-SAP_GWFND  - Version 0008 - SAPK-74008INSAPGWFND

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunity/?$format=xml -  we are not able to see any hyperlinks to the entity structures.

CRM app for My opportunity is working fine in FIORI lauchpad.

* Are we missing some SAP notes?

Please help.

Thanks,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

As Ekansh said, you cannot use Entity name in URL. You need to use Entityset name.

So what is the purpose of using Entity name? What are you trying to achieve? That answer might help better in answering your question.

Former Member
0 Kudos

Hi Krishna,

Thanks for the response. Entity should not be used fine. I am using Entity Set Now.

Can you please check whether the following syntax is correct.

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities('05056B436291ED49885A61E3841A0F7')

Error - Invalid key Predicate type for 'Guid'. Expected type is 'Edm.Guid'.

I also tried with the syntax

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities(Guid'05056B436291ED49885A61E3841A0F7')

But i am getting an error - "Malformed URI literal syntax". I was referring the thread

scn.sap.com/thread/3646635.

[ After that, I checked your second idea, changed the Type to Edm.Guid and the request /ZCM22_SERVICES_SRV_01/BonuseintragSet(guid'005056AE-3E17-1ED4-9890-E934C6D9D3C3') and it worked.]

I  would like to get the data for a particular Opportunity Id in gateway client. for that i am passing the key property - 'Guid'.

Entity Set - Opportunities

Key Property - Guid

Please help with the correct syntax.

Thanks,

Divya

AshwinDutt
Active Contributor
0 Kudos

Hello Divya,

Send as below and check ->

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities(Guid=guid'05056B436291ED49885A61E3841A0F7')
Regards,
Ashwin

Former Member
0 Kudos

Hi Ashwin,

Thanks for the reply.

I tried in Gateway Client. I am getting

Status Code - 400

Status Reason - Bad Request

Malformed URI literal syntax.

link to sap note :- 1797736

Please help.

Thanks,

Divya

AshwinDutt
Active Contributor
0 Kudos

Hello Divya,

Can you check the Edm Type used at the GW Model level for the Property Guid ? is it Edm.Guid ? or Edm.Binary ?

What is the Data Type of the GUID in the backend ? RAW ?

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin,

Is it Edm.Guid.

The error is resolved after using the url like

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities(guid'005056B4-3629-1ED4-98E9-5ACA956A40F8')

But we are getting an error

"Method 'OPPORTUNITIES_GET_ENTITY' not implemented in data provider class"


1. what does this error mean. Should we implement some "Deep Entity Operation"?

2. Then how come data comes fine in my CRM_Opportunity Fiori App. The Odata which we are trying to run in the gateway client is also the standard crm my Opportunity service.

3. Is method not implemented in standard, how come data comes in Fiori App.


webIDE Url

CRM_OPPRTNTYExtension&origional-url=index.html&sap-ui-language=en&sap-ui-xx-fakeOS=ipad#/detail/Opportunities(guid'005056B4-3629-1ED4-98E9-5ACA956A40F8')

Please help.

Thanks,

Divya

AshwinDutt
Active Contributor
0 Kudos

Hello Divya,

You need to manually implement OPPORTUNITIES_GET_ENTITY in the DPC_EXT class and write logic to get the data.

Refer Read Operation in the below which explains how to implement ->

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

I just encountered the same issue, backend type is raw, the gateway type is edm.binary, when I tried to use the dbkey with value '005056AD1C211ED68EBE2FA04B7FB39B', it will show the error Property 005056AD1C211ED68EBE2FA04B7FB39B not found in type ProgramSpendItem

I have no idea how to handle this issue, a workaround is that just change the beckend raw type to string, but it will cause other issue, this is just temporary, please kindly help on this issue.

the detail is showed as follow:

https://scn.sap.com/thread/3934139

Really thanks for your help.

Best regards,

Leon

Former Member
0 Kudos

Hello Divya,

I have encountered the same issue, the data of GUID is DbKey?

005056B4-3629-1ED4-98E9-5ACA956A40F8

As the data in my system is like :005056AD1C211ED68EBE2FA04B7FB39B,

so did you change the data format to apply guid like xxxx-xxx-xx-xx or just the raw data from data table?

the detail is as follow:

https://scn.sap.com/thread/3934139

Really need your nice clarification.

Thanks in advance.

Best regards,

Leon

Answers (1)

Answers (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Divya,

Using /sap/opu/odata/sap/CRM_Opportunity/Opportunity will not work as we have to use the entityset in the URL to access. You can not directly address an entity via URL. We always have to follow the entityset path.

Regards,

Ekansh