Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Service only returning one record, not whole table

$
0
0

Hello,

 

I am new to Netweaver Gateway, trying to set up our first Service.

My goal is to use our Solutions Manager (Version 7.02, SP12) system as our Hub and use it to call a Z RFC function RFC on our ECC system (Version 7.31, SP4). We are not planning on installing Gateway on the ECC system yet. The function is written to allow an input variable (Cost Center), and return a table with 4 fields in it(Store, ID, FirstName, LastName). I move the Storenumberin value to the Store output table to be returned so that I can prove the input goes in and can come back in output. I also return test values in the table if nothing is found indicating an error.

 

 

The Solutions Manager system has the GW_Core and IW_BEP modules.

 

I have used SEGW to import the RFC from the ECC system into an Entity Type.

The Entity Type has 4 Properties, StoreNumber, ID, FirstName, LastName (StoreNumberIn is the Input Parameter for the function, and the other 4 are the fields in the output Table). The Property StoreNumber is marked as the Key.

Screen Shot 2014-02-11 at 10.52.51 AM.png

I then created the Entity Set and made it addressable (based on other readings I had done).

I then Generated the Service Implementation.

 

I then Mapped the Read GetEntity, with StoreNumberIn as Input to the StoreNumber property, and all properties as Output.

Screen Shot 2014-02-11 at 10.57.15 AM.png

I then Mapped the Query GetEntitySet, with StoreNumberIN as input to the Input parameter of the function. I mapped the other 4 fields as Output to their respective function fields. Mapping is the same as Read Mapping.

 

 

I then added the service in the IMG (SAP Netweaver/Gateway/OData Channel/Administration/General Settings/Activate and Maintain Services) and made sure it was hooked to the correct System Alias.

 

I am testing using the Netweaver Service Explorer on the External Service Name.

When I try to Get Entity Sets, I click the entity Set and click Execute. It prompts me for Parameter, and has the Entity Set name there.

If I add ('1234') ( or any other value) to the Entity type, it executes and returns with only one record, the first record of the table. This should not happen.

Screen Shot 2014-02-11 at 11.25.49 AM.png

 

If i don't add any filter, I get multiple records back.

The way the function is designed, it should ALWAYS return 2 records. It is hardcoded for testing that way for now.

Screen Shot 2014-02-11 at 11.04.42 AM.png

Anyone have any ideas on what I should check?

Any Examples?

Any other discussions or blogs that I have not found yet and should check out?

 

Most of the ones I have found are all for working on the Local System, Not working doing a generic channel setup to a system that does NOT have Gateway installed.


I need to also return it as JSON. I am using  ?&$format=json   on the call to get it back that way. Is this the best way?

Can we default it to JSON instead of xml?

 

Thank you for your help,

Mike


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>