cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Internal table as an input to OData Service

Hi,

I want to create an OData service which takes Internal Table as an Input.

Can someone help me how to do the same Step by Step for creating the OData Service and Testing it.

vchalla
Explorer
0 Kudos

I have a similar requirement. How did you resolve this? If you did, can you please post the steps.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

EkanshCapgemini
Active Contributor

Hi Samir,

Follow links provided by Ashwin. For different operations:

  1. Create: a normal create would take only single entry. Use $Batch for creating multiple records.
  2. Update: a normal update would take only single entry. Use $Batch for updating multiple records.
  3. Delete: use can delete only one record at a time. Use $batch for multiple delete.
  4. Read: since it returns only one record at a time which is selected by the key properties, you can take only key in the filters.
  5. Query: you can pass multiiple filters. If you have the requirement of filling an internal table(one coloum) as i/p parameter of FM, you can change this to range and that is supported by query filters of OData. Otherwise use $batch as mentioned.
  6. Deep Entity: In this case, you can receive multiple line items in input. This method is used for create operation. The multiple line items are in relation with some header level. If you do not have header level in your requirement, create a dummy entity and associate it with item level. This way you can receive multiple line items.


Regards,
Ekansh

Answers (2)

Answers (2)

former_member184867
Active Contributor
0 Kudos

OData service does not take any input.



an OData service which takes Internal Table as an Input.

There may not be direct options to achieve what you want . Batch can be a candidate where you may pass multiple entries. Deep Entity or $expand also support multiple items in a Parent - child relationship.

However you need to do the modelling carefully.

AshwinDutt
Active Contributor
0 Kudos

Hello Samir,

Below will help ->

For CRUD operation you can use BATCH.

If you have Header Item relation ship during Create, You can implement Create_Deep_Entity Method inside DPC_EXT Class.

Regards,

Ashwin

0 Kudos

Hi Ashwini,

Thanks for your response.

I have gone through the above links before and did the same however I couldn't get the response. I am getting an error for CSRF Token Validation which I tried to fetch  using GET but its not returning anything.

My Scenario is that I have a RFC which has the I/P parameter as an Internal Table and I want to create an OData service on this.

If you can please help me with Step By Step Procedure for creating and testing the service I would really appreciate.

Thank's,

Samir

AshwinDutt
Active Contributor
0 Kudos

What is the error which you got while fetching Token ?

What is the operation done by your RFC? Read Data ? or Create/Update/Delete ?

0 Kudos

Hi Ashwini,

Below is the Error I am getting.

Also the RFC does Read Data Operation.

EkanshCapgemini
Active Contributor
0 Kudos

It does not require X-CSRF token for performing Read operation.

Regards,
Ekansh

0 Kudos

Hi Ekansh,

While using the Batch mode I have to Use the PUT Method even for Read Query and it needs the CSRF Token.

Thank's,

Samir