SRF_Ru_HelperInvoiceJournal1
SRF_Ru_HelperInvoiceJournal1 is a CDS View in SAP S/4HANA. It reads from 1 data source (I_SAPClient) and exposes 2 fields.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_SAPClient | I_SAPClient | from |
Parameters (8)
| Name | Type | Default |
|---|---|---|
| P_AmountInTransCrcy | aflex17d2o23s | |
| P_TaxAmountInTransCrcy | aflex17d2o23s | |
| P_AmountDiffInTransCrcy | aflex17d2o23s | |
| P_TaxAmountDiffInTransCrcy | aflex17d2o23s | |
| P_TaxAmount | char1 | |
| P_WithoutTaxLabel | abap.char(13) | |
| P_CorrectionInvoice | abap.char(10) | |
| P_PositiveNegativeLine | char1 |
Annotations (5)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | SRFRUHELPIJ1 | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_ALLOWED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #P | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| char8elseendelseendasTaxAmountWithoutTax | ||||
| char8endendelseendendasTaxIncrWithoutTax |
@AbapCatalog.sqlViewName: 'SRFRUHELPIJ1'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_ALLOWED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #P
define view SRF_Ru_HelperInvoiceJournal1
with parameters
// Fill correctly tags related with Without VAT
P_AmountInTransCrcy : aflex17d2o23s,
P_TaxAmountInTransCrcy : aflex17d2o23s,
P_AmountDiffInTransCrcy : aflex17d2o23s,
P_TaxAmountDiffInTransCrcy : aflex17d2o23s,
P_TaxAmount : char1,
P_WithoutTaxLabel : abap.char(13),
P_CorrectionInvoice : abap.char(10),
P_PositiveNegativeLine : char1
as select from I_SAPClient //dummy select, CDS view only used for calculations
{
//total amounts
case $parameters.P_CorrectionInvoice
when '' then case $parameters.P_PositiveNegativeLine
when 'N' then -abs($parameters.P_AmountInTransCrcy) //E3, E4. Total Amount
else abs($parameters.P_AmountInTransCrcy)
end
else 0
end as AmountInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then case $parameters.P_TaxAmount
when '0' then 0
else case $parameters.P_PositiveNegativeLine
when 'N' then -abs($parameters.P_TaxAmountInTransCrcy) //E3, E4. Tax Amount
else abs($parameters.P_TaxAmountInTransCrcy)
end
end
else 0
end as TaxAmountInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then case $parameters.P_TaxAmount
when '0' then cast($parameters.P_WithoutTaxLabel as abap.char(8)) //E3, E4. WithoutTax
else ''
end
else ''
end as TaxAmountWithoutTax,
//increase amounts
case $parameters.P_CorrectionInvoice
when '' then 0
else case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then -abs($parameters.P_AmountDiffInTransCrcy) //F6. Increase Amount (annulment)
else 0
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then 0
else abs($parameters.P_AmountDiffInTransCrcy) //F5. Increase Amount
end
end
end as AmountIncrInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then 0
else case $parameters.P_TaxAmount
when '0' then 0
else case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then -abs($parameters.P_TaxAmountDiffInTransCrcy) //F6. Increase Tax (annulment)
else 0
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then 0
else abs($parameters.P_TaxAmountDiffInTransCrcy) //F5. Increase Tax
end
end
end
end as TaxIncrInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then ''
else case $parameters.P_TaxAmount
when '0' then case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then cast($parameters.P_WithoutTaxLabel as abap.char(8)) //F6. Increase WithoutTax (annulment)
else ''
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then ''
else cast($parameters.P_WithoutTaxLabel as abap.char(8)) //F5. Increase WithoutTax
end
end
else ''
end
end as TaxIncrWithoutTax,
//decrease amounts
case $parameters.P_CorrectionInvoice
when '' then 0
else case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then 0
else -abs($parameters.P_AmountDiffInTransCrcy) //G8. Decrease Amount (annulment)
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then abs($parameters.P_AmountDiffInTransCrcy) //G7. Decrease Amount
else 0
end
end
end as AmountDecrInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then 0
else case $parameters.P_TaxAmount
when '0' then 0
else case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then 0
else -abs($parameters.P_TaxAmountDiffInTransCrcy) //G8. Decrease Tax (annulment)
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then abs($parameters.P_TaxAmountDiffInTransCrcy) //G7. Decrease Tax
else 0
end
end
end
end as TaxDecrInTransCrcy,
case $parameters.P_CorrectionInvoice
when '' then ''
else case $parameters.P_TaxAmount
when '0' then case $parameters.P_PositiveNegativeLine
when 'N' then case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then ''
else cast($parameters.P_WithoutTaxLabel as abap.char(8)) //Decrease WithoutTax (annulment)
end
else case $parameters.P_TaxAmountDiffInTransCrcy + abs($parameters.P_TaxAmountDiffInTransCrcy)
when 0 then cast($parameters.P_WithoutTaxLabel as abap.char(8)) //Decrease WithoutTax
else ''
end
end
else ''
end
end as TaxDecrWithoutTax
}
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA