on 04-29-2012 10:18 AM
I am trying to update SAP back-end data using OData and SAP Gateway services.
while executing, it throws an error and doesn't update data in back-end.
I am basically trying to update 'accounts' data in SAP CRM backend.
the error message contains this response:
"The file sap/Gateway/PGY/SERVICEACCOUNTS/SERVICEACCOUNTSCollection({BP_Number_of_that_Account}) has been successfully uploaded".
this application has been deployed on to SAP netweaver portal.
I have put break points in backend and i found that it doesnt even reach to backend.
the code looks as follows:
OData.request(
{
headers: {'x-requested-with' : 'XMLHttpRequest','Content-Type': 'application/atom+xml', 'DataServiceVersion': '2.0'},
requestUri: "/sap/Gateway/PGY/SERVICEACCOUNTS/SERVICEACCOUNTSCollection("+recordToUpdate.data.BP_NUMBER+")?sap-client=100&$format=xml",
method: "PUT",
data: {
ACCOUNT_NAME: recordToUpdate.data.ACCOUNT_NAME,
BP_NUMBER: recordToUpdate.data.BP_NUMBER,
CITY: recordToUpdate.data.CITY,
COUNTRY: recordToUpdate.data.COUNTRY,
E_MAIL: recordToUpdate.data.E_MAIL,
HOUSE_NO: recordToUpdate.data.HOUSE_NO,
POSTL_COD1: recordToUpdate.data.POSTL_COD1,
REGION: recordToUpdate.data.REGION,
STREET: recordToUpdate.data.STREET,
TELEPHONE: recordToUpdate.data.TELEPHONE
},
user: "****",
password: "****"},
function (data, response) {
//success handler
console.log(response);
console.log('Successfully updated object');
},
function (err)
{
//error handler
console.log('error while updating');
console.log(err);
}
);
Any help will be appreciated. thank you.
-Arihant
Hi Arihant,
Please update the following:
1) Landscape details
a) Version of Gateway, Hub Deployment/Back end deployment.
b) Installation details .. including the NetWeaver version
Solution:
1) Check in the "snotes" transaction is you have applied the latest release notes applicable.
2) Since you mentioned that the request is not reaching the gateway server (faced it myself).. .. just check in the smicm transaction is you have the http request enabled.
3) Most importantly, go to the sicf transaction, and check if you have default_host/sap/opu/odata and default_host/sap/opu/sdata are enabled.
For further reference use this link .. http://scn.sap.com/docs/DOC-27405 Here check out the pdf - "
Installing and Configurating SAP NetWeaver Gateway 2.0 "
Let me know if it was useful.
Thanks
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Thank you for your reply.
I tried all solutions you mentioned above.
One thing i would like to mention is: I don't find default_host/sap/opu/odata when I go to SICF.
I only have default_host/sap/opu/sdata listed down there.
For some reasons, Gateway is not able to read credentials passed in OData request at all. So my request doesn't reach to run time data classes.
I would like to update you with the system details as follows:
SAP Version
SAP EHP 2 for SAP NetWeaver 7.0
Gateway version:
GW_CORE 200 0000 - SAP GW CORE 200
Gateway components
IW_BEP 200 0000 - Backend Event Provider
IW_CBS 200 0000 - SAP IW CBS 200
IW_CNT 200 0000 - SAP IW CNT 200
IW_FND 250 0000 - SAP IW FND 250
IW_SCS 200 0000 - Screen Scraping
Hub Deployment/Back end deployment. -- where can i find these details ?
Application Installation details:
NetWeaver version - 7.3
Application has been deployed using WAR file on NetWeaver portal 7.3 using NWDS 7.3.
As of now, we have tried a work around, such that, we hardcode 'Logon Data' for a service on Gateway system itself.
In our landscape, we have 2 systems 'A' and 'B' such that, 'A' hosts the Gateway services and 'B' hosts all Data. Here, we have hardcoded Logon data so that webservice can use those hard-coded credentials to fetch data from system 'B' directly.
I was curious to know why Gateway was not able to read credentials passed in plain text? It had always worked for us before, suddenly there was a system restart and everything stopped.
Hi Arihant,
1) Gateway Component Version:
SAP_BASIS 702 0009
GW_CORE 200 0003
IW_BEP 200 0003
IW_CBS 200 0000
IW_CNT 200 0000
IW_FND 200 0000
2) Installation Pre-requisites
http://help.sap.com/saphelp_gateway20sp03/helpdata/en/52/fc994f456a4573957461be15520fe8/frameset.htm
3) After Step 1, 2 do not miss to apply the note: 1560585. Go through this note very carefully and check out which is applicable in your case.
Then go through the note: 1574568
http://help.sap.com/saphelp_gateway20sp03/helpdata/en/71/376ab03f824ea5bfd0a0e3a307205b/frameset.htm
4) Deployment Options:
http://help.sap.com/saphelp_gateway20sp03/helpdata/en/62/91ad98b19b4a91bca737fbe442273f/frameset.htm
Understanding from your landscape ... it is Central Hub Deployment. But definitely go though the above link.
5) Do not have to hard-code any logon information .. Strongly recommend you to follow every step that is mentioned in the "Installing and Configurating SAP NetWeaver Gateway 2.0"
Most of the problems in Gateway are in configuring and put in place the various pieces. So dont feel disheartened..
I really hope this solves for you.
Regards,
Venkat
Hi Venkat,
thank you for sharing info.
I am going to try with the patches you have mentioned above.
As i mentioned before, these services were working just fine for months until a gateway system restart.
What might have caused changes in the way Gateway accepts log in credentials.
Now it returns me 'Logon Page' HTML code in response to any request made via OData.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.