on 2024 Nov 21 1:25 PM
Hi everyone
I am working on a cds view which displays all the selected fields via a fiori elements preview. I have an abap program that calculates some custom fields as such:
REPORT z_outstanding_days.
DATA: lt_swwwihead TYPE TABLE OF swwwihead, ls_swwwihead TYPE swwwihead, lv_days_outstanding TYPE i, lv_current_date TYPE d. * Get the current date lv_current_date = sy-datum. * Select data from SWWWIHEAD table SELECT * FROM swwwihead INTO TABLE lt_swwwihead WHERE wi_stat = 'READY'. * Loop through the selected work items LOOP AT lt_swwwihead INTO ls_swwwihead. * Calculate the number of days outstanding lv_days_outstanding = lv_current_date - ls_swwwihead-crdate. * Print the work item ID and the number of days outstanding WRITE: / 'Work Item ID:', ls_swwwihead-wi_id, 'Days Outstanding:', lv_days_outstanding. ENDLOOP.
How can I pull the custom calculated field from the abap program into the following CDS view
@AbapCatalog.sqlViewName: 'ZV_OUTSTANDING_ITEMS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Outstanding Work Items with Approvers'
define view ZV_OutstandingItems as select from swwwihead
LEFT OUTER join swwuserwi on swwwihead.wi_id = swwuserwi.wi_id
{
key swwwihead.wi_id,
swwwihead.crdate,
swwwihead.wi_text,
}Request clarification before answering.
Hi,
to put custom logic in a cds view you can use Custom entities for CDS. There you can specify a class which dos the data determination.
Kind Regards
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
google virtual element +cds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.