cancel
Showing results for 
Search instead for 
Did you mean: 

To Include table type in Complex type in Gateway

Former Member
0 Kudos

Hi Experts,

I have created a entity which includes Pernr,first name, last name and country.

I have implemented get entityset method. Now I need to pass multiple values for country for a pernr means A pernr can have multiple values of country.

I thought to create a complex type for country attribute and assign a table type in it, but its not working.

Please Suggest.

Thanks,

Saurabh

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor

Hello Saurabh,

Complex Type can hold only flat structures. It can Hold only one entry/record at any given point of time.

Complex Types - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

U cannot pass a table of inputs to a GET operation like how we pass to our function modules.

U need to operate on BATCH.

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin,

Thanks for the quick response.

Actually we are trying to create a dynamic layout a UI5 level.

So from gateway service I have created a table which contain field name, its value, its type (Check box, text field, radio button), label.

It is working in case of one to one mapping. but suppose if I have multiple values for a field then it is a problem.

If we use batch service then URI will become static or hard coded at UI5.

Please suggest.

Thanks,

Saurabh

AshwinDutt
Active Contributor
0 Kudos

Hello Saurabh,

Ur URL will always be static with $batch keyword at the end of ur URL.

Ur Payload needs to be dynamic.

U can generate ur payload for BATCH dynamically.

U need to have a logic in UI level which can generate ur payload dynamically based on the number of entries what user enters.

There is a standard template to create payload for BATCH. That will be hard-coded.

All we need to do is read data entered by user and insert that in the standard template & form a payload.

Regards,

Ashwin

Answers (2)

Answers (2)

aakash_neelaperumal2
Active Participant
0 Kudos

Saurabh,


you can pass multiple values in URI as below. Is this what you are asking ?


?$filter=Pernr eq '1234' or Pernr eq '4567'

kammaje_cis
Active Contributor
0 Kudos

Saurabh,

If a 'Property' can have multiple values for an entity 'Person', then there can be two scenarios.

.

If the maximum number of values is fixed,

     then you can have one property for one possible value.

Else If the maximum number of values is not fixed,

     then you can design an Entity for that property and create Association/Navigation to connect Person with this new entity. To fetch the values, use navigation, and to input values use deep insert.

regards

Krishna

Former Member
0 Kudos

Thanks Krishna.

I thought we can include table type in complex types through a structure containing table in deep .

Thanks,

Saurabh