cancel
Showing results for 
Search instead for 
Did you mean: 

Create_Deep_Entity, multilevel structures

vamsixk
Active Participant
0 Kudos

Hi Everyone,

i need to implement a Create deep entity implementation for the below structure.

  • Header-->Service Order
    • item--> Service Order, item number, components
      • component list

i have implemented  the Header to Item deep insert.

based on the below example.

this only handles the implementation from Header--> Item.

but i have a requirement where in i need to implement, Item-->Component also.

is it possible?

Kind Regards,

Vamsi

Accepted Solutions (1)

Accepted Solutions (1)

vamsixk
Active Participant
0 Kudos

Hi, thank you for your inputs, they were helpful in making me arrive at a solution for my requirement.

Due to time constraints we figured out a work around for my requirement

will definitely try your method and see if that works.

but present we are defining component as a separate entity at the same level as Item.

howeve the Component Entity has the added fields of AUFNR/POSNR to be able to map each component to it's parent AUFNR/POSNR.

so the structure definition is something like this.

types: being of ty_component,"Component structure

               aufnr type aufnr,

               posnr type posnr         

               component type string,

end of ty_component,

t_components type standard table of ty_component with default key." Table Type

types: begin of t_item,"Item Structure

          posnr type posnr,

          end of t_item.

types: begin of deep_entity," required structure of Deep_entity

     include structure header.

types: item type t_item,

types components type t_components,

end of deep_entity.



Answers (2)

Answers (2)

AshwinDutt
Active Contributor
0 Kudos

Hello Vamsi,

There was no need of a workaround here as your scenario can be achieved with correct Data Modelling, defining appropriate Cardinality between the entities and correct Deep Structure at the Back-End.

Regards,

Ashwin

former_member184867
Active Contributor
0 Kudos

Hello Vamsi,

Yes it is possible. It should be handled in CREATE_DEEP_ENTITY method. If the payload is passes correctly, and the structure to hold the data is in DPC is defined correctly things will work.

Regards

Atanu

vamsixk
Active Participant
0 Kudos

Hi Atanu,

thank you for your input.

I have implemented the association and navigation properties between the item and the component entities. I have also defined the association and navigation properties from header to Item.

it is working from the header to item part of it's functionality.

The structures are getting filled as expected in the CREATE_DEEP_ENTITY method. But Gateway Client is not showing any Components Data in the response generated.

I have declared my entity structure as below.

types: being of ty_component,"Component structure

               component type string,

end of ty_component,

t_component type standard table of ty_component with default key." Table Type

types: begin of t_item,"Item Structure

          posnr type posnr,

          components type t_components,

          end of t_item.

types: begin of deep_entity," required structure of Deep_entity

     include structure header.

types: item type t_item,

end of deep_entity.

the place where i need guidance is on how to define the model provider to achieve this hierarchy.

Any input will be highly apprecaited.

Kind Regards,

Vamsi

Former Member
0 Kudos

Hi Vamsi,

You don't need to define model provider to achieve this. Multilevel deep structures can be defined in the same method easily.

Your deep structure should be an ideal nested structure like this-

Data: begin of ls_header,

           include type zproject_mpc=>ts_header, "header data

           begin of ls_item,

               include type zproject_mpc=>ts_item, "item data

               lt_component type standard table of zproject_mpc=>ts_component, "component data

           end of ls_item,

           lt_item type standard table of ls_item, "component data

         end of ls_header.

Hope this helps.

Cheers,

-NK