on 2024 Jun 25 5:53 PM
Hi,
There seems to be no available documentation on creating Parent-Child-Subchild using the composition and parent associations. On attempting the same, although with the similar code as below, the navigation to the object page of the 3rd level entity does not work on create, and only create a row in the Child 3 level table, without any managed uuid creation or object page navigation:
managed;
strict ( 2 );
with draft;
define behavior for ZI_G_ROOT alias Root
implementation in class zbp_i_g_Root unique
persistent table ztg_Root
draft table ztg_d_Root
lock master total etag UpdatedDate
authorization master ( instance )
etag master LastLocalUpdateAt
{
create;
update;// ( precheck );
delete;
association _Parent { create; with draft; }
association _Child { with draft; }
field ( numbering : managed, readonly ) RootUuid;
draft action Resume;
draft action Edit;
draft action Activate optimized;
draft action Discard;
draft determine action Prepare;
}
define behavior for ZI_G_PARENT alias Parent
implementation in class zbp_i_g_Parent unique
persistent table ztg_Parent
draft table ztg_d_Parent
lock dependent by _Root
authorization dependent by _Root
etag master LastLocalUpdateAt
{
update;
delete;
association _Child { create; with draft; }
association _Root { with draft; }
field ( numbering : managed, readonly ) ParentUuid;
field ( readonly ) RootUuid;
}
define behavior for ZI_G_CHILD alias _Child
implementation in class zbp_i_g_child unique
persistent table ztg_Child
draft table ztg_d_Child
lock dependent by _Root
authorization dependent by _Root
etag master LastLocalUpdateAt
{
association _Parent { with draft; }
ancestor association _Root { with draft; }
update;
delete;
field ( readonly ) RootUuid, ParentUuid;
field ( numbering : managed, readonly ) ChildUuid;
}
There is another way to create hierarchy using node_id and parent_id with hierarchy and source keywords similar to HANA 2.0 functions, but still eventually the Behavior Definition is important.
Is there a documentation of the same somewhere by SAP?
I look forward to your response.
Best Regards,
Ruchir
Request clarification before answering.
User | Count |
---|---|
34 | |
21 | |
14 | |
8 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.