cancel
Showing results for 
Search instead for 
Did you mean: 

How to display ObjectPage table during creation at Sap Fiori app?

shiz0frenik
Participant
0 Kudos

Hi, expert. I've got a request to display objectPage table during the creation.
I use CDS and Sap Fiori.
Firstly i select a value from zko_d_orders table. Each value has unique uuid. Then i do an accosiation to zko_d_items And i'm getting a list of materials which got the uuid_header key and contained in this order.
Here i can press an 'Create' button and the app will open another objectPage and allows to create.

@AbapCatalog.sqlViewName: 'ZRA_CQ_ORD_IT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Consumption CDS for ZKO_I_T_ORDER_ITEM'
@OData.publish: true

@Metadata.allowExtensions: true

@ObjectModel:{
    transactionalProcessingDelegated: true,
    semanticKey: ['uuid'],
    representativeKey: 'uuid',
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true
}

@UI.presentationVariant: [{sortOrder: [{by: 'uuid',direction: #DESC }]}]
@UI.headerInfo: { typeName: 'Наименованиe',typeNamePlural: 'Наименованиe'}

@Search.searchable: true

define view ZRA_C_ORDER_ITEM 
  as select from ZRA_I_T_ORDER_ITEM 
  association [1..1] to ZKO_C_ORDER_HEAD as _headerdata  on $projection.uuid_header = _headerdata.uuid 
 // association [1..*] to ZKO_C_ORDER_ITEM as _item on $projection.uuid_header = _item.uuid_header
{
//      @UI: {
//      lineItem: [{ type: #FOR_ACTION, position: 10,
//      dataAction: 'BOPF:ZRA_UPDATE',
//      label: 'Обновление' }],
      
//      identification: [{type: #FOR_ACTION,
//     position: 10,
//     dataAction: 'BOPF:ZRA_UPDATE',
//     label: 'Обновление' }]
//          }   

  
           @UI.lineItem: [    
//      { type: #FOR_ACTION, dataAction: 'BOPF:EXPORTVA02', label: 'Оформить' },
      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_UPDATE', label: 'Обновление' },
      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_ADD', label: '++' }      
//      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_COST_R', label: 'Расчет стоимости' }
//      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_DISPLAY', label: 'Вывод' }
    ]
    
           @UI.identification: [    
//      { type: #FOR_ACTION, dataAction: 'BOPF:EXPORTVA02', label: 'Оформить' },
        { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_UPDATE', label: 'Обновление' },  
        { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_ADD', label: '++' } 
//      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_UPDATE', label: 'Обновление' },
//      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_COST_R', label: 'Расчет стоимости' }
//      { type: #FOR_ACTION, dataAction: 'BOPF:ZRA_DISPLAY', label: 'Вывод' }
    ]
  
  
  
  
      @UI.hidden: true
  key uuid,


      @UI.hidden: true
      uuid_header, 
      @UI.hidden: true
//     @UI.lineItem: { position: 5, importance: #HIGH }
      @ObjectModel.readOnly: true
      waers_s, 
  
      @UI.hidden: true
      @UI.lineItem: { position: 8, importance: #HIGH }
      @ObjectModel.readOnly: true
      cost_i,            

      @UI.lineItem: { position: 10, importance: #HIGH }
      @ObjectModel.readOnly: true
      @UI.hidden: true
      req_number,

      @UI.lineItem: {label:'Обозначение материала', position: 20, importance: #HIGH }
      @Search.defaultSearchElement: true
      @Search.ranking : #HIGH
//      @ObjectModel.readOnly: true  
     
     @Consumption.valueHelpDefinition: [{ entity:
             {name: 'ZRA_I_ORDER_ITEM_MATNR_SH' , element: 'matnr' }
//             additionalBinding: [{ localElement: 'matnr', element: 'matnr' }
//             additionalBinding: [{ localElement: 'maktx', element: 'maktx' }
//            { localElement: 'meins', element: 'meins' },
//             { localElement: 'cost', element: 'cost' },
//             { localElement: 'waers', element: 'waers' }
//             ]
            }]
      matnr,

      @UI.lineItem: { position: 30, importance: #HIGH }
      @ObjectModel.readOnly: true
      maktx,

      @UI.lineItem: { position: 40, importance: #HIGH }
      qnt,

      @UI.lineItem: { position: 50, importance: #HIGH }
      @ObjectModel.readOnly: true
      meins,

      @UI.lineItem: { position: 55, importance: #HIGH }
      @ObjectModel.readOnly: true
      cost,

 //     @UI.lineItem: { position: 60, importance: #HIGH }
      @ObjectModel.readOnly: true
      @UI.hidden: true
      waers,

      @UI.lineItem: { position: 70, importance: #HIGH }
      @ObjectModel.readOnly: true
      user_who_changed,

      @UI.lineItem: { position: 80, importance: #HIGH }
      @ObjectModel.readOnly: true
      date_changed,

      @UI.lineItem: { position: 90, importance: #HIGH }
      @ObjectModel.readOnly: true
      time_changed,
      

      @ObjectModel.association.type: [#TO_COMPOSITION_PARENT,#TO_COMPOSITION_ROOT]
      _headerdata,
//     @UI.lineItem: { position: 90, importance: #HIGH }

      
      @Search.defaultSearchElement: true
        @ObjectModel.readOnly
        lower(maktx)                                                                                                                         as maktx_lower,
      @Search.defaultSearchElement: true
        @ObjectModel.readOnly
        Upper(maktx)                                                                                                                         as maktx_Upper,
      @Search.defaultSearchElement: true
        @ObjectModel.readOnly
        lower(matnr)                                                                                                                         as matnr_lower,
      @Search.defaultSearchElement: true
        @ObjectModel.readOnly
        Upper(matnr)     
        
                                                                                                                  as matnr_Upper      
}

So i want to display a table, shown on img2 during creation.

It can be a:
1) At 3rd screen with using #LINEITEMREFERENCE and targetElement, but i think it's impossible to do.
I tried to make a copy of 'ZRA_C_ORDER_ITEM' and to do an association (as u can see at comment out string 'association[1..*] to ZKO_C_ORDER_ITEM' and to add it to targetElement, but the table of materals displays only if select value from tab, and doesn't if press 'Create')

2) Add 2 input fields and custom button at 2 screen.
3) add button which will start a dialog with input fields.
Is it even possible? And which way is more simple?

Accepted Solutions (0)

Answers (0)