cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data from a specific backend Client ?

former_member111990
Discoverer
0 Kudos

I have a ODATA service built in a Backend ECC system( IW_BEP) and registered in the SAP Gateway Hub (SAP_GWFND). The backend system has 2 seprate clients 100 and 200. I have created both the SAP system aliases and added them to the service after registering it.

With the MOC concept if the test the service as /NAME_SRV;mo/entityset I get data back from both the clients as expected. None of the system aliases are set as default systems.

What I would really like to do is get the data from 1 specifc client even when 2 systems are specified.

Is there a way to achieve this wihout creating another client in the SAP gateway hub? I tried using the url as below but I still get data back from both backend clients irrespective of what url I use.

/NAME_SRV;mo=ALIAS1/entityset

/NAME_SRV;mo=ALIAS2/entityset


Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

You can use the filter SAP creates for MOC.


/NAME_SRV;mo/<entityset>?$filter=SAP__Origin eq '<systemalias1>'

spandana_babu
Participant
0 Kudos

HI Krishna,

i have the same issue . when i was passing the the

/sap/opu/odata/sap/ZXXX_SRV;mo/Add_MatnrSet?$filter=SAP__Origin eq 'LOCAL' and IWerks eq 'XX01'

Getting error as below.

<?xml version="1.0" encoding="utf-8" ?>

- <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code>SY/530</code>

<message xml:lang="en">Internal error occurred, contact your system administrator.</message>

- <innererror>

<transactionid>5408BDE79994C2E3E100000089B31AE7</transactionid>

<timestamp>20140915113834.7023670</timestamp>

- <Error_Resolution>

<SAP_Transaction>Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details</SAP_Transaction>

<SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)</SAP_Note>

</Error_Resolution>

- <errordetails>

- <errordetail>

<code>/IWBEP/CX_MGW_TECH_EXCEPTION</code>

<message>Internal error occurred, contact your system administrator.</message>

<propertyref />

<severity>error</severity>

</errordetail>

</errordetails>

</innererror>

</error>



T  Thanks  in Advance

AshwinDutt
Active Contributor
0 Kudos

Hello Spandana,

Error is because in your Get_Entity_Set method there would be no code written to read filter parameter ' SAP__Origin ' . So its dumping.

I had the same issue and i resolved it as below.

Put a break point at the code where filters parameters are extracted. There u will find the reason for dump. Reason is SAP__Origin is not read and hence the dump occcured.

Solution would be add one line of code to read it.

Inside the loop, write as below and u r done.

WHEN 'SAP__ORIGIN'

Regards,

Ashwin

spandana_babu
Participant
0 Kudos

Hi Ashwin ,   Thank you .

    As suggested by you i used WHEN 'SAP__ORIGIN' and it is working fine for Read and Get queries.but while posting the data ( using POST ) into sap it through error  .as below.

My URL for post is :

   

Original URL for post  with out using alias name:

/sap/opu/odata/sap/Zxxx_TEST_SRV/zxxx_HeadSet  -- working fine

/sap/opu/odata/sap/Zxxx_TEST_SRV;mo/zxxx_HeadSet?$filter=SAP__Origin eq 'ABCD_100'  - error  as below:

The Data Services Request contains SystemQueryOptions that are not allowed for this Request Type



Please suggest how to get post the data using alias concept .


Thanks in advance.


AshwinDutt
Active Contributor
0 Kudos

Hello Spandana,


As far as i know At present, CREATE calls cannot be done in all configured back-end systems, but only in the default system.


Please have a look at the below for more info for your question :

Multiple Origin Composition - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

Regards,

Ashwin

kammaje_cis
Active Contributor
0 Kudos

If it is a POST, you do NOT mention the SAP__Origin in URL. Rather you mention it in the request body of the POST. I have not tried it though.

Let us know how it went. 

But remember to keep "mo" in the URL to say that Multi Origin needs to be considered.

Former Member
0 Kudos

Hi Krishna,

I am also working on POST operation using MOC. and I included "SAP__Origin" property in request body. But it is giving an error. Could you please help me??

Thanks & Regards,
Seshu

Answers (0)