cancel
Showing results for 
Search instead for 
Did you mean: 

OData : Entity type

former_member452749
Participant
0 Kudos

Hi everyone,

i have a question for you.

Is it possible to create a dynamic entity type based on dynamic structure? Or just a static structure can be used?

Let me know please.

Thanks in advance.

Regards.

Dario.

Accepted Solutions (1)

Accepted Solutions (1)

sreehari_vpillai
Active Contributor
0 Kudos

What the service builder(SEGW) does is , it will create Model provider code based on the entities you are importing to it. Instead, if you can code the MPC class directly , it is possible to have the dynamic structure. But ,you need to disable the metadata cache etc, because, the metadata here itself is dynamic..

Sree

Answers (3)

Answers (3)

former_member452749
Participant
0 Kudos

Hi all, thanks for your responses.

I have another question for you, is it possible to call method "DEFINE" by abap code to create model or not?

Thanks in advance.

Regards.

Dario.

former_member184867
Active Contributor
0 Kudos

You can call super->define( ) form a class

1.   if the class is a child of /IWBEP/CL_MGW_ABS_MODEL

2.   the child class is to be used as a model provider class (MPC) in the Gateway Framework

You can not directly call DEFINE( ) method from just any other ABAP code.

The reason is, DEFINE method of /IWBEP/CL_MGW_ABS_MODEL is meant to be invoked from the $metadata flow during the Gateway OData service call. Specifically the class has attributes which are being created by the framework and only available during the context of Gateway Service call.

AshwinDutt
Active Contributor
0 Kudos

Hello Dario,

Please have a look at Former Member reply in the below discussion.

Dynamic entitys | SCN

Regards,

Ashwin

Pavan_Golesar
Active Participant
0 Kudos

Hello Dario,

Best to my knowledge, Once you generated the RUNTIME ARTIFACTS (assuming you have mapped data sources to respective CRUDQ operations)...The Model Provider class is is created with the defined structure (Which are static in nature, Until and Unless you again REGENERATE the Runtime artifacts after changing the structure as in below image) 

Although to handle Dynamicity of structure might be possible via programming under MPC_EXT class but I am not sure about this approach...

Let me know if it helps.

--PG