cancel
Showing results for 
Search instead for 
Did you mean: 

Criticality Icons Not Taking Effect on the UI - Fiori App F3143

former_member208149
Participant

Hi there,

We are trying to extend the analytical app F3143 (Monitor Scheduling Agreement Items) to include few additional fields on the report including a few new KPI fields. We also need to show the criticality of the KPI fields with icons on the report.

For this we extended the underlying CDS 'C_SchedgAgrmtItemMonitor' and applied the annotation for KPI field's criticality but for some strange reason, the Fiori elements annotations for criticality are not taking effect on the UI.

We made exactly similar extensions for its sister apps (namely, Monitor Purchase Contract Items - App ID 2423 and Monitor Purchase Order Items - App ID 2358), where we can see the output with custom KPI fields with criticality icons working perfectly.

We also raised an OSS ticket for this issue but after investigating the issue for a long time, the last response from SAP was to address this issue to the Developer Community. So, here we are!

CDS Extensions:

CDS 'C_SchedgAgrmtItemMonitor' Extension

@AbapCatalog.sqlViewAppendName: 'ZPU_XCSAIM'
@VDM.viewExtension: true
@EndUserText.label: 'View C_SchedgAgrmtItemMonitor Extension'
extend view C_SchedgAgrmtItemMonitor with ZPU_X_CSchdgAgrmtItmMntr
{
  PurchasingDocumentItemCategory,
  AccountAssignmentCategory,
  // ... Some more custom fields

  // Custom KPI Field 1
  @EndUserText.label: 'Validity period exceeded'
  @UI:{ lineItem: [{ criticality: 'ValidityStatusKPICriticality', criticalityRepresentation: #WITH_ICON }] }
  @Consumption.groupWithElement: 'ValidityStatusKPICriticality'
  cast( ' ' as abap.char( 15 ) ) as ValidityStatusKPI,

  ValidityStatusKPI              as ValidityStatusKPICriticality,

  // Another Custom KPI Field
  @EndUserText: { label: 'Quantity exceeded', quickInfo: 'Quantity exceeded KPI'}
  @UI:{ lineItem: [{ criticality: 'QuantityExceededKPICriticality', criticalityRepresentation: #WITH_ICON }]}
  @Consumption.groupWithElement: 'QuantityExceededKPICriticality'
  cast( ' ' as abap.char(10) )    as QuantityExceededKPI,

  QuantityExceededKPICriticality,

  // Custom KPI Field 3
  @EndUserText.label: 'Gross Order Value exceeded'
  @UI:{ lineItem: [{ criticality: 'GrossOrdValExceededCriticality' }]}
  @Consumption.groupWithElement: 'GrossOrdValExceededCriticality'
  cast( ' ' as abap.char(10) )   as GrossOrderValueExceededKPI,

  GrossOrdValExceededCriticality
}

On SAP's suggestion, we also added below @UI.presentationVariant annotation in the CDS header via. metadata extension.

Metadata Extension:

@Metadata.layer: #CUSTOMER
@UI.presentationVariant: [{requestAtLeast: ['GrossOrdValExceededCriticality','ValidityStatusKPICriticality','QuantityExceededKPICriticality']}]
annotate view C_SchedgAgrmtItemMonitor with
{
  @UI.hidden: false
  OrderQuantityUnit;  
  @UI.hidden: true
  GoodsReceiptAmountInDspCrcy;
  @UI.hidden: true
  InvoiceAmtInDisplayCurrency;
}

The output on the UI:

(Here, you can also notice the respective criticality values.)

Output in the sister app F2358:

Can anyone please help me with the solution? Has anyone come across any such issue before ?

Hi jocelyn.dart, any pointers for me?

Thanks in advance.

Regards,

Sapeksh

gregorw
Active Contributor
0 Kudos

Dear Sapeksh,

maybe you also add the SAPUI5 tag to your question.

Best Regards
Gregor

gregorw
Active Contributor
0 Kudos

Hi Sapeksh,

the interresting thing that I've found when investigating the "Monitor Purchase Scheduling Agreement Items" app is that when I do a fresh start of this app I can't any indication that the metadata is loaded during the app start:

The OData requests are still done:

gregorw
Active Contributor
0 Kudos

That is quite different from the "Monitor Purchase Order Items" app where I see the $metadata request with each start of the application:

So maybe you can update the issue you've created via SAP Support and point them in this direction.

Best Regards
Gregor

View Entire Topic
MattHarding
Active Contributor

Hi Sapeksh,

While I can't quite do CDS annotations to xml in my head, you are likely running into an issue that this app uses a local annotation file that is overwriting your CDS annotations.

Basically local annotations trump CDS annotations, and in a brutal way where it takes over a whole area most of the time (e.g. you can't add just one line item to a local annotation without losing all your CDS line item annotations.

Anyway, if you have WebIDE, you can import the file, and you should be able to edit the local annotations file to see if this is the case (it will show you which CDS annotations are being overwritten).

Cheers,

Matt

0 Kudos

Hey,

yes, in case of additional annotation files in the UI app you need to check if the particular thing gets overridden. However, we do see the columns so it means what Sapeksh did has an effect on the UI.

sapeksh.gupta can you ping me the URL to the incident so I can look into it?

Best regards,
Stefan

sandeepsinha327
Explorer
0 Kudos

stefan.engelhardt,

Below is the URL to the incident which Sapeksh had raised.

https://launchpad.support.sap.com/#/incident/pointer/002075129400003822772021

Please let us know if you have any feedback/solution for us.

Thank You!

Regards,

Sandeep Sinha

gregorw
Active Contributor
0 Kudos

I think it would be easier for the Stefan if you provide the Incident Number.