cancel
Showing results for 
Search instead for 
Did you mean: 

ODATA service based on RFC (Have multiple Table Parameters as output)

former_member192283
Participant
0 Kudos

Hi

I need to develop the ODATA service based on RFC. It has 5 table parameters. In that  first  Table parameter in that one of the attributes take the userid as input and return as output as all the 5 table parameters including the first table parameter.

For example: (Following Table parameters in RFC)

TableParam1 has  has fields userId, name, Dept

TableParam2 has  has fields A, B, C

TableParam3 has  has fields D, E, F

TableParam4 has  has fields X, Y, Z

TableParam5 has  has fields K, L, M

I have created the ODATA service using RFC/BOR option. I have created five entity's using the above five table params and created the 5 EntitySets corresponding each Entity.

I done the service  implementation for  first  EntitySet(TablePraram1) I have done the map to Data source for  GetentityRead() for passing the user id (for one of the attribute). when i generated, code got generated. When i run the service, i am getting the output as only first table parameter alone. I need to get as output for the rest of the five entitysets's also.

Do i need to  do he Association between EntitySets?  Also userId attribute exist in only first  table parameters not in all the table parameters.  To do the association, do i need have userId in all the Table prams as attribute?

Please confirm how to get all the entitySets data as output by passing only userId for the  first table parameter in ODATA service?

is it possible to get all the entitySets with out writing any custom code in ODATA service end?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Guru,


1) Header Entity with User id field.

Reply: As per the RFC design, First table parameter will take userID as parameter and return all the table parameters including first table param. So, There is no Header Entity here. In first Table parameter alone have User id input.

Suggestion: Then Design entity type with the table itself with respective fields.

2) Create all the output entities with User id as an additional field and it should be a key field.

Reply: Userid is not part of any other entity except the first entity. do u want me to change the RFC design to have Userid attribute as part of all the table parameters?

Suggestion: if there is common fields in all the tables, then no need to change the RFC design, just create the respective entity types.

3) Define Association and Navigation from Header to all output entities.

Reply: I hope this is possible to define Association if u have common attribute across entities.

5) Implement GET_EXPANDED_ENTITYSET.

Reply: Is this recommended or Best practice approach of using the GET_EXPANDED_ENTITYSET.

or

Is it Better to call different Entity Sets individually as a separate call by passing user Id?  with out getting all the Entity Sets data in single call, Because all the Entity Sets are retrieved based on User Id only. There is no common integrity key is defined as part of the  all the entity's. But the RFC is returns all the table parameters based on UserId.

Suggestion: This is the best practice of using GET_EXPANDED_ENTITY_SET, instead of calling the individual entity, you will get the response as like in RFC.

Thanks,

Lokeswar.

former_member192283
Participant
0 Kudos

Thanks Lokesh Its resolved. But i have question. I have one more question, If i want to map this service results of each entitySet to different controls in UI. Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Guru,

Please check with UI people once, there should be some solution.

Thanks,

Lokeswar.

Former Member
0 Kudos

Hello Guru,

Yes , you need to do custom coding.

Implement your gateway service as below:

1. Header Entity with User id field.

2. Create all the output entities with User id as an additional field and it should be a key field.

3. Define Association and Navigation from Header to all output entities.

4. Generate and activate the service.

5. Implement GET_EXPANDED_ENTITYSET.

Follow the below reference link to implement get_expanded_entityset

URL:

Thanks and Regards,

Lokeswar.

former_member192283
Participant
0 Kudos

Thanks Reply Lokeswar.

Please find my in line statements based on your reply.

1) Header Entity with User id field.

Reply: As per the RFC design, First table parameter will take userID as parameter and return all the table parameters including first table param. So, There is no Header Entity here. In first Table parameter alone have User id input.

2) Create all the output entities with User id as an additional field and it should be a key field.

Reply: Userid is not part of the any other entity except the first entity. do u want me to change the RFC design to have Userid attribute as part of all the table parameters?

3) Define Association and Navigation from Header to all output entities.

Reply: I hope this is possible to define Association if u have common attribute across entity's.

5) Implement GET_EXPANDED_ENTITYSET.

Reply: Is this recommended or Best practice approach of using the GET_EXPANDED_ENTITYSET.

or

Is it Better to call different Entity Sets individually as a separate call by passing user Id?  with out getting all the Entity Sets data in single call, Because all the Entity Sets are retrieved based on User Id only. There is no common integrity key is defined as part of the  all the entity's. But the RFC is returns all the table parameters based on UserId.

Please advice.

Thanks