cancel
Showing results for 
Search instead for 
Did you mean: 

Resource not found for Segment 'XXXXXXX'

former_member209217
Active Contributor
0 Kudos

Hi Experts,

I am trying to create a OData service for retrieving Purchase order Header and Item Details.

However, I am not able to rectify the error "Resource not found for Segment 'XXXXXXX' "

I have checked other discussion forums and used transactions /IWFND/CACHE_CLEANUP to clean up the cache as wel  and also used

/IWFND/MAINT_SERVICEl to refresh catalog and generate metadata document again.

The Metadata is getting loaded correctly .I have done the necessary coding in GET_ENTITY as well. I am specifying PO Number in the URI as well. But still I am not able to figure it out

Please help me.

Best Regards,

Lakshman

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Lakshman,

You are trying to send something which is not defined in the GW model and hence the error is coming.

Parameters which you pass in the URL are Case Sensitive. If property 'Name' is defined in GW Model in the URl you need to pass as 'Name' only and not as 'NAME' or 'name'.

Correct ->

/<Service_Name>/<Entity_Set_Name>(Name='XXXX')

Wrong ->

/<Service_Name>/<Entity_Set_Name>(name='XXXX')


/<Service_Name>/<Entity_Set_Name>(NAME='XXXX')

Please check this.

Regards,

Ashwin

former_member209217
Active Contributor
0 Kudos

Hi Ashwin,

I am using the names defined as-is without changing any case , But I am still getting the error.

Best Regards,

Lakshman

AshwinDutt
Active Contributor
0 Kudos

What is the operation you are performing here ? Share details please.

former_member209217
Active Contributor
0 Kudos

Ashwin,

I am using the request as below

/sap/opu/odata/SAP/ZPO_ASSIC_NAVG_GH_SRV/POHeaderSet('4500004837')

I am performing READ operation and have done necessary coding in POHEADERSET_GET_ENTITY method

AshwinDutt
Active Contributor
0 Kudos

Pass the Key Name along with its Value ->

Sample ->

/sap/opu/odata/SAP/ZPO_ASSIC_NAVG_GH_SRV/POHeaderSet(POid='4500004837')


Where POid is the Key defined in the GW Model of the Entity POHeader



former_member209217
Active Contributor
0 Kudos

I tried this option already but no luck 😞

AshwinDutt
Active Contributor
0 Kudos

Have you added any code in the Define method of MPC_EXT class ?

Can you share the screen shot of the GW Model with Property Names ?

former_member209217
Active Contributor
0 Kudos

I haven't added any code in DEFINE class.

Providing screen shots for your reference

AshwinDutt
Active Contributor
0 Kudos

You tried passing this already, correct ?


/sap/opu/odata/SAP/ZPO_ASSIC_NAVG_GH_SRV/POHeaderSet(PoNumber='4500004837')

former_member209217
Active Contributor
0 Kudos

Yes Ashwin, But still problem not corrected

former_member209217
Active Contributor
0 Kudos

Ashwin,

Problem got resolved . It's purely mistake from my side.

In GET_ENTITY method , I have used  IO_TECH_REQUEST_CONTEXT->GET_KEYS( ) to get the respective PO Number from URI. But mistakenly , I haven't used the READ statement correctly

I thought that we should use PoNumber as KEY while reading the table , Hence used as below

read table rt_keys into rs_keys with key name = 'PO_NUMBER'


The Context is filled based on fieldNames and Not on Property Names

I have created DataModel using BAPI stuructures, but I haven't expected this behaviour


I tried external debugging , but it didn't worked for so long,


But hasn't expected that correct statement should like below.

read table rt_keys into rs_keys with key name = 'PO_NUMBER'.


Anyways Thanks for helping me out, I apologize for wasting your time.


Best Regards,

Lakshman.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Lakshaman,

Can you please edit the above reply as both the mentioned READ TABLE statements are same.

It would lead to confusion for others.

Regards,

Ekansh

former_member209217
Active Contributor
0 Kudos

Yeah..I missed to correct it somehow, I wasn't able to edit it now


First READ statement is actually

read table rt_keys into rs_keys with key name ='PoNumber'


Ekansh ,Thanks for pointing it out


Regards,

Lakshman

Answers (1)

Answers (1)

0 Kudos

Hi Srini,

There are few points to be checked if this error was encountered.

1. Entity Set Name, Navigation Property Names are Case Sensitive so we should be more

careful when we are building URL.

2. URL Should be checked Twice with respective to Entity Sets names.

Regards

Ram