on 04-30-2013 4:23 PM
Hi
In Gateway, I want to get header and item data of my PO from ERP, on behalf of the PO number.
In transaction /IWFND/GW_CLIENT I execute the http method GET for
/sap/opu/odata/sap/ZGW_BD_PURCH_SRV/
and
/sap/opu/odata/sap/ZGW_BD_PURCH_SRV/$metadata
I got a http status 200 return – which is fine
In the ERP that I am calling, there is a purchase order with no. '3000000006'
But when I execute the service for following url: /sap/opu/odata/sap/ZGW_BD_PURCH_SRV/PurchaseOrderCollection('3000000006')
But I got this error:
<?xml version="1.0" encoding="utf-8" ?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>005056A509B11ED199D891D139C92103</code>
<message xml:lang="en">Resource not found for the segment 'PurchaseOrderCollection('3000000006')'.</message>
</error>
My settings are like this:
Entity types is created:
PurchaseOrders (PoNumber is key) + PurchaseOrdersItems (PoNumber+PoItem are keys)
Entity Sets is created:
PurchaseOrderCollection (assigned to PurchaseOrders) + Purchaseorderitem (assigned to PurchaseOrdersItems)
In the Service Implementation the PurchaseOrderCollection has following mappings:
And for Purchaseorderitem I have following mappings:
The only BAPI that we are using is: BAPI_PO_GETITEMS
Any ideas?
Thanks,
I just ran into this issue and thought I would share in case anyone else runs into this in the future. If you go transaction /IWFND/MAINT_SERVICE, select your service, and click the LOAD METADATA and REFRESH CATALOG button, it should correct this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
can post me the error detail found in /IWFND/ERROR_LOG TCode
Regards,
Jibin Joy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Here is the log:
.ERROR_CONTEXT
..ERROR_INFO Resource PurchaseOrderCollection not defined in Metadata
../IWFND/CX_SODATA_EDM_PROVIDER
...ENTITY_CONTAINER
...ENTITY_TYPE
...COMPLEX_TYPE
...ASSOCIATION
...ENTITY_SET
...ASSOCIATION_SET
...FUNCTION_IMPORT
...MODEL_ID
...RESOURCE PurchaseOrderCollection
..SERVICE_INFO
...NAMESPACE /SAP/
...VERSION 0001
...SERVICE_NAME ***Hide_due_to_secure_log_level***
...REQUEST_DIRECTION Consumer to Gateway
...AGENT OData Lib 1.0 Handler
..SYSTEM_INFO
...REQUEST_ID DF4E10A820B91EE2ACDE8B69A256A09E
...REQUEST_URI /sap/opu/odata/sap/***Hide_due_to_secure_log_level***
...REMOTE_ADDRESS <IP ADDRESS IS REMOVED HERE>
...APPLICATION_SERVER gw_GW1_00
I still have problems after clearing the cache..
To be honorst, I am not sure if my setup is correct, but there is a connection between ERP and Gateway, and I could catch my BAPI via the remote function call in import datamodel (in tcode SEGW)
Here is the metadata from:
/sap/opu/odata/sap/ZGW_BD_PURCH_SRV/$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="ZGW_BD_PURCH_SRV" xml:lang="en" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
- <EntityType Name="PurchaseOrders" sap:content-version="1">
- <Key>
<PropertyRef Name="Vendor" />
</Key>
<Property Name="Vendor" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Vendor" sap:sortable="false" sap:filterable="false" />
<Property Name="DeleteInd" Type="Edm.String" Nullable="false" MaxLength="1" sap:label="Deletion Indicator" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="PoNumber" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Purchasing Document" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
</EntityType>
- <EntityType Name="PurchaseOrdersItems" sap:content-version="1">
- <Key>
<PropertyRef Name="PoItem" />
<PropertyRef Name="PoNumber" />
</Key>
<Property Name="PoPrice" Type="Edm.String" Nullable="false" MaxLength="1" sap:label="Adopt price" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="NetPrice" Type="Edm.Decimal" Nullable="false" Precision="23" Scale="4" sap:label="Net order price" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Plant" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Plant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="InfoRec" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Purchasing Info Rec." sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Material" Type="Edm.String" Nullable="false" MaxLength="18" sap:label="Material" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="PoItem" Type="Edm.String" Nullable="false" MaxLength="5" sap:label="Item" sap:sortable="false" sap:filterable="false" />
<Property Name="PoNumber" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Purchasing Document" sap:sortable="false" sap:filterable="false" />
</EntityType>
- <EntityContainer Name="ZGW_BD_PURCH_SRV" m:IsDefaultEntityContainer="true">
<EntitySet Name="PurchaseOrders" EntityType="ZGW_BD_PURCH_SRV.PurchaseOrders" sap:pageable="false" sap:addressable="false" sap:content-version="1" />
<EntitySet Name="PurchaseOrderItems" EntityType="ZGW_BD_PURCH_SRV.PurchaseOrdersItems" sap:pageable="false" sap:addressable="false" sap:content-version="1" />
</EntityContainer>
<atom:link rel="self" href="http://gw.<OUR_DOMAIN>.biz:8000/sap/opu/odata/sap/ZGW_BD_PURCH_SRV/$metadata" xmlns:atom="http://www.w3.org/2005/Atom" />
<atom:link rel="latest-version" href="http://gw.<OUR_DOMAIN>.biz:8000/sap/opu/odata/sap/ZGW_BD_PURCH_SRV/$metadata" xmlns:atom="http://www.w3.org/2005/Atom" />
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Hi ,
In metadata Document Entityset Name is PurchaseOrders not PurchaseOrderCollection which is shown in screen shot..... same for Item Level
<EntitySet Name="PurchaseOrders" EntityType="ZGW_BD_PURCH_SRV.PurchaseOrders" sap:pageable="false" sap:addressable="false" sap:content-version="1" />
<EntitySet Name="PurchaseOrderItems" EntityType="ZGW_BD_PURCH_SRV.PurchaseOrdersItems" sap:pageable="false" sap:addressable="false" sap:content-version="1" />
Goto /IWFND/CACHE_CLEANUP
Check "the Cleanup Cache For All models"
then Re-generated the Project in SEGW
I Think other things are fine
Regards,
Jibin Joy
Hi ,
The Basic Flow to gateway is simple......
Outside World contact SAP Netweaver Gateway server . Try find out the ur service such as /sap/opu/odata/sap/ZGW_BD_PURCH_SRV/ then check the metadata document in cache If not found it will generate new metadata document kept in the cache again . My advice is to deactivate Cache during development
Ref
-http://help.sap.com/saphelp_gateway20sp03/helpdata/en/3d/45e259b4bd49e197316cbfd3c7fa8e/content.htm
-http://mysapgw.wordpress.com/2012/01/17/metadata-cache-cleanup/
Once it fetch the Metadata document . It does URL as well as body validation based on the metadata Document ...
When Everything is verified then only it will contact Backend .
Now ur issue is that the flow stop in URL validation because it is not able to find the resource mentioned in url "PurchaseOrderCollection" but in the metadata Entity set name is "PurchaseOrders".
The problem i see is in Caching
Solution
1. Deactivate Cache as mentioned in above ref
2. Goto /IWFND/CACHE_CLEANUP
Check "the Cleanup Cache For All models"
then Re-generated the Project in SEGW
if still not work then try to make new service ..
Regards,
Jibin Joy
Hi,
This error usually happens when the entity set being called in not correct.
Example.
My entity set has the name YstProdData and my call is:
/sap/opu/odata/sap/ZPRODUCTS_TABLES_SRV_01/YstProdData(11)
The result is perfect with all the info. However if I call:
/sap/opu/odata/sap/ZPRODUCTS_TABLES_SRV_01/YtaProdData(11)
/sap/opu/odata/sap/ZPRODUCTS_TABLES_SRV_01/YProdData(11)
/sap/opu/odata/sap/ZPRODUCTS_TABLES_SRV_01/whatever(11)
the result is always: "Resource not found for the segment 'whatever(11)'"
Could you post screenshot of the list of entity sets.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.