cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Odata service for an RFC having a table as import parameter in SAP Netweaver gateway

Former Member
0 Kudos

Hi,

I am trying to create OData service for an RFC which is having table as an import parameter.

So the entire table needs to be populated via the query URL.

But when table parameter is selected, it creates individual Entity Types for each table. So it cannot be used in a single entity Set and hence cannot be mapped in a single go to the RFC.

How can this be achieved? Please help.

Regards,

Achu M K

Accepted Solutions (1)

Accepted Solutions (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Achu,

I think you are concerned about create operation rather than query. In create operation if you want to pass table entries in input table, you need to use deep_entity method. While in query, you would be using range parameters to pass multiple values.

If this is a create scenario, you create the respective entity sets, define association between those, create the navigation property from principal entity to child entity. Then in the DPC_EXT class, you need to redefine the Create_deep_entity method. You will be receiving the passed table entries in this method that you can use to create by passing in the FM.

Regards,

Ekansh

Answers (2)

Answers (2)

former_member184867
Active Contributor
0 Kudos

I think Deep Insert may be used here..

AshwinDutt
Active Contributor
0 Kudos

Hello Achu,

That is the expected behavior. You need to use BATCH operation for GET to send all those table of inputs as part of a PAYLOAD. I mean to say Single Request but Multiple Operations and in your case its a Single Request and would contain Multiple QUERY Operations on the same Entity.

This will call your back-end logic multiple times. If 2 entries are there as part of your table of inputs and it would call logic 2 times.

Sample Payload would be ->

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET get_emp_dataSet?$filter=Userid+eq+'00001' HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET get_emp_dataSet?$filter=Userid+eq+'00002' HTTP/1.1

--batch--

Regards,

Ashwin