cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Transactional App using Header->Item functionality with UI.facet annotation

Hi experts,

I have a transactional app, not using draft functionality, with 3 consumption views: header, item and one for texts. I`m using the following annotations:

  • @ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT]
  • @ObjectModel.association.type: #TO_COMPOSITION_CHILD

When I created the Project, in WebIDE, via template List Report based on my OData from my Header CDS, I`ve chosen the main OData service and navigation to_Item, so leaving out the Text view.

In result I have the following scenario:

Both header and item have the “insert” functionality, but not the Text Table. Is this a normal behavior? Or did I forget something in my annotations?

My MDE file which annotates my header CDS view

@Metadata.layer: #PARTNER
@UI.headerInfo: { typeName: 'Handle Type - Header',
                  typeNamePlural: 'Handle Types - Header',
                  title: { type: #STANDARD, value: 'handletype'}}


annotate view YFIORI_FB_C_300 with
{
 
  @UI.facet: [{
               label : 'General Information',
               id : 'GeneralInfo',
               purpose: #STANDARD,
               type : #COLLECTION,
               position: 10
           },


           {
               label: 'Basic Data',
               id : 'BasicData',
               purpose: #STANDARD,
               parentId : 'GeneralInfo',
               type : #FIELDGROUP_REFERENCE,
               targetQualifier : 'one',
               position: 20
           },


           {
               label: 'Admin Data',
               id : 'AdminData',
               purpose: #STANDARD,
               parentId: 'GeneralInfo',
               type : #FIELDGROUP_REFERENCE,
               targetQualifier : 'two',
               position: 30
           },


           {
               label: 'Handle Part Type',
               id  : 'HPTYPE',
               purpose: #STANDARD,
               type : #LINEITEM_REFERENCE,
               targetElement: '_Item',
               position: 40
           },


           {
               label: 'Text Table',
               id  : 'HTTEXT',
               purpose: #STANDARD,
               type : #LINEITEM_REFERENCE,
               targetElement: '_HText',
               position: 50
           }]




  @UI: { fieldGroup     : [{ qualifier : 'one', position : 10 }] }
  @UI: { selectionField : [{ position: 10 }],
         lineItem       : [{ position: 10 }],
         identification : [{ position: 10, importance: #HIGH, label: 'Handle Type' }]}
  handletype;


  @UI: { fieldGroup     : [{ qualifier : 'one', position : 20 }]}
  @UI: { lineItem       : [{ position: 20, importance: #HIGH, label: 'Handle Cutout' }],
         identification : [{ position: 20, importance: #HIGH, label: 'Handle Cutout' }],
         textArrangement: #TEXT_LAST}
  handlecutout;




  @UI: { fieldGroup     : [{ qualifier : 'two', position : 10, label: 'Created on', importance: #HIGH }]}
  createdat;


  @UI: { fieldGroup     : [{ qualifier : 'two', position : 20, label: 'Created by', importance: #HIGH }]}
  createdby;


  @UI: { fieldGroup     : [{ qualifier : 'two', position : 30, label: 'Changed on', importance: #HIGH }]}
  changedat;


  @UI: { fieldGroup     : [{ qualifier : 'two', position : 40, label: 'Changed by', importance: #HIGH }]}
  changedby;
}

How can I enable the “insert” also on the Text Table (third facet)?

Thank you

Alex

maheshpalavalli
Active Contributor
0 Kudos

Can you check if your interface view has the "createEnabled" annotaiton?

vikas_992001
Explorer
0 Kudos

Hi Alex,

Is it possible to share the CDS code for enabling the facet and associations used for this object. I am working on same kind of requirement where i have to enable the third facet.

Accepted Solutions (1)

Accepted Solutions (1)

I`ve managed to make it work!

From what I`ve learned is that when creating the project in WebIDE and selecting the OData with its navigation, example to_Item, then this will generate coding only for that particular navigation.

In my case I have 2 children: to_Item and to_HText and only to_Item navigation was enabled.

What I`ve did to enable the to_HText navigation and CRUD operations, beside the coding related to UI.facet from MDE file:

  • In the ‘manifest.json’ file of the WebIDE project, add the missing navigation for the Text entity.
  • In the ‘annotation.xml’ file of the WebIDE project add annotations UI.facets for the Text entity.

As result:

Answers (1)

Answers (1)

0 Kudos

Hi Mahesh,

My text interface view has the createEnable set to true.

Also my BOPF -> Text entity has the create enabled.

Also I`ve checked and generate my BOPF and deleted and re-created my fiori app using the same OData but didn`t work..

In one testing scenario I`ve created the project in WebIDE with OData collection YFIORI_FB_C_300 and OData Navigation: to_Htext (my text table). In result I got my navigation from header to item -> text table working fine, also with insert functionality but my other child C_310 was missing the “insert” functionality. That is why I`ve thought I miss some annotation to activate the third facet… Or maybe is not possible?

Thanks

Alex