cancel
Showing results for 
Search instead for 
Did you mean: 

CDS-View: Error at Case-Condition and Sum

quanto_solutions_ph
Discoverer
0 Kudos

Hello together,

maybe somebody from the community can help me with this problem.

In Total Balance as per current period, the sum of PaymentsPreviousPeriod and TotalAmountInDisplayCrcy is to be displayed if Future Amount is not filled. However, in this case the query for the content of Future Amount does not work, so that the sum of PaymentsPreviousPeriod and TotalAmountInDisplayCrcy is always displayed.

I have cast the fields to check if there are difficulties with the data type. Even with the cast variable, the query is not performed correctly. Even a query on zero is not successful.

Example data:

Cast of variables in Cube View 1:

@DefaultAggregation: #SUM

@Semantics.amount.currencyCode: 'DisplayCurrency'

(cast( case when PaymentsPreviousPeriod is null then 0 else PaymentsPreviousPeriod end as abap.dec( 24,2 ) )

+ cast( case when TotalAmountInDisplayCrcy is null then 0 else TotalAmountInDisplayCrcy end as abap.dec( 24,2 ) ) ) as SumTotalBalance,

@DefaultAggregation: #SUM

@Semantics.amount.currencyCode: 'DisplayCurrency'

cast( case when TotalNotOvrdAmtInDspCrcy is null then 0 else TotalNotOvrdAmtInDspCrcy end as abap.dec( 24,2 )) as HelpTotalNotOvrdAmtInDspCrcy,

CASE to fill TotalBalanceInDisplayCrcy in Cube View 2

@DefaultAggregation: #SUM

@Semantics.amount.currencyCode: 'DisplayCurrency'

case when HelpTotalNotOvrdAmtInDspCrcy = 0

then SumTotalBalance

else TotalAmountInDisplayCrcy end as TotalBalanceInDisplayCrcy,

Show TotalBalanceInDisplayCrcy in Consumption View

@DefaultAggregation: #SUM

@Semantics.amount.currencyCode: 'DisplayCurrency'

@EndUserText.label: 'Total Balance as per current period '

TotalBalanceInDisplayCrcy,

Has anybody an advice oder a hint where the mistake could be located?

Thank you very much.

Best regards

Philipp

SOLVED: Duplicated Entries at resultset through Union-Select.

Accepted Solutions (0)

Answers (0)