cancel
Showing results for 
Search instead for 
Did you mean: 

Lineitems not displayed in ABAP Environment

sebastian_wilhelm1
Participant
0 Kudos

Hi Experts,

I try to create a simple App in the ABAP Environment, consisting of a header and items.

The Data Preview seems to be okay

f I want to view the app using the preview function of the service bindings, no position data appear in the detail view.

If I preview the Components (items) directly, the items are displayed.

ll my attempts to view the data have failed.

Does anyone have a solution or a hint?

I have created the following objects

Database

ZMMKIAT_CL_HDR (Header Table excerpt)@EndUserText.label : 'Content List Header'

@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #ALLOWED
define table zmmkiat_cl_hdr {
  key client : abap.clnt not null;
  key bomid : zbomid not null;
  werks : werks_d;
  ...
}

ZMMKIAT_CL_POS (Items Table excerpt)

@EndUserText.label : 'Content List Components'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #ALLOWED
define table zmmkiat_cl_pos {
  key client : abap.clnt not null;
  @AbapCatalog.foreignKey.keyType : #KEY
  @AbapCatalog.foreignKey.screenCheck : false
  key bomid : zbomid not null
  with foreign key [0..*,1] zmmkiat_cl_hdr
  where client = zmmkiat_cl_pos.client
  and bomid = zmmkiat_cl_pos.bomid;
  key matnr : zarticle not null;
  ...
}

Views

ZDD_CONENTLIST

@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Contentlist'
define root view entity zdd_conentlist
as select from zmmkiat_cl_hdr
composition [0..*] of zdd_contentlist_item as _Item
{
  @UI.facet: [
  { id: 'idGeneralInformation',
    type: #IDENTIFICATION_REFERENCE,
    label:'General Information',
    position: 10 },
  { id: 'idItem',
    type: #LINEITEM_REFERENCE,
    label: 'Components',
    targetElement: '_Item',
    position: 20 }
  ]
  @UI.lineItem: [{position: 10, label: 'BOM ID' }]
  @UI.identification: [{position: 10, label: 'BOM ID' }]
  key bomid as bomId,
  @UI.lineItem: [{position: 20, label: 'Plant' }]
  @UI.identification: [{position: 20, label: 'Plant' }]
  werks as werks,
  _Item
}

ZDD_CONTENTLIST_ITEM

@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Conentlist Item'
define view entity zdd_contentlist_item
as select from zmmkiat_cl_pos
association to parent zdd_conentlist as _Contentlist on $projection.bomId = _Contentlist.bomId
{
  @UI.facet: [
  { id: 'idItem',
    label: 'Components',
    type: #IDENTIFICATION_REFERENCE } ]
  @UI.lineItem: [{position: 10, label: 'BOM ID' }]
  @UI.identification: [{position: 10, label: 'BOM ID' }]
  key bomid as bomId,
  @UI.lineItem: [{position: 20, label: 'Article' }]
  @UI.identification: [{position: 20, label: 'Article' }]
  key matnr as matnr,
  charg as charg,
  @Semantics.quantity.unitOfMeasure: 'UNIT'
  quantity as quantity,
  unit as unit,
  _Contentlist
}

Behavior Definition

ZBP_DD_CONTENTLIST

managed implementation in class zbp_dd_conentlist unique;
define behavior for zdd_conentlist alias Contentlist
persistent table zmmkiat_cl_hdr
lock master
{
  field ( readonly ) bomId;
  mapping for zmmkiat_cl_pos corresponding
  {
    bomId = bomid;
  }
  create;
  update;
  delete;
  association _Item { create; }
  }


define behavior for zdd_contentlist_item alias Item
persistent table zmmkiat_cl_pos
lock dependent by _Contentlist
{
  field ( readonly ) bomId;
  field ( readonly ) matnr;
  mapping for zmmkiat_cl_pos corresponding
  {
    bomId = bomid;
    matnr = matnr;
  }
  update;
  delete;
}

CLASS zbp_dd_conentlist DEFINITION PUBLIC ABSTRACT FINAL FOR BEHAVIOR OF zdd_conentlist.

ENDCLASS.

CLASS zbp_dd_conentlist IMPLEMENTATION.

ENDCLASS.

Service Definition

ZSD_CONTENTLIST_DD

@EndUserText.label: 'SD Contentlist DD'
define service Zsd_contentlist_dd {
  expose zdd_conentlist;
  expose zdd_contentlist_item;
}

Service Binding

ZUI_CONTENTLIST_DD

View Entire Topic
SURYA_ABAP
Participant
0 Kudos

Hi Sebastian Wilhelm,

Hope it is working fine, in on-premise. To display in Cloud - Connect with FIORI / BTP Admin team to have right role to display.

sebastian_wilhelm1
Participant
0 Kudos

Hi Surendra! This is pure Cloud development in the ABAP Environment, not on-premise.

The problem is, that the items aren't displayed in the Fiori Elements App (see the screenshot). As the header data are displayed, I asume, that it's not an authorization issue!?