P_CrExp is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_OperationalAcctgDocItem, I_Customer) and exposes 18 fields. It has 2 associations to related views.
//@EndUserText.label: 'FI Credit Exposure BSEG'
@ClientHandling.algorithm: #SESSION_VARIABLE@AbapCatalog.sqlViewName: 'PCREXP'
@VDM.private:true@VDM.viewType: #COMPOSITE@AccessControl.authorizationCheck: #NOT_REQUIRED@AbapCatalog.compiler.compareFilter:truedefineview P_CrExp
asselectfrom I_OperationalAcctgDocItem as _AccountingDocument
// Link with Customer
innerjoin I_Customer on _AccountingDocument.Customer = I_Customer.Customer
// Link with Credit Control Area/Credit Segment mapping
association [0..1] to I_CreditControlArea as _CreditControlArea on $projection.CreditControlArea = _CreditControlArea.CreditControlArea
// Link to exposure type customizing
association [1..1] to I_CreditExposureCategory as _CreditExposureCategory on $projection.CreditExposureCategory = _CreditExposureCategory.CreditExposureCategory
{
// Business Partner
I_Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner as BusinessPartner,
// Credit Segment
_CreditControlArea._CreditControlArea2Segment.CreditSegment as CreditSegment,
'Y' as xBseg,
// Credit Control Area
_AccountingDocument.CreditControlArea,
// Original Customer
_AccountingDocument.Customer,
// I_Customer._CustomerToBusinessPartner._BusinessPartner._BusinessPartnerRole [1:BusinessPartnerRole = 'UKM000'].BusinessPartnerRole as BusinessPartnerRole,
// Accounting Document Number
_AccountingDocument.AccountingDocument,
// Fiscal Year
_AccountingDocument.FiscalYear,
// Special G/L Indicator
_AccountingDocument.SpecialGLCode,
// Check if value is relevant for Credit Management - T074U-KLIMP
_AccountingDocument._SpecialGLCode.CreditLimitIsChecked,
// Case Exposure Category
case// Special Exposure
when _AccountingDocument.SpecialGLCode <> ''
then '300'
// FI Exposure
else '200'
endas CreditExposureCategory,
// Document Type
_AccountingDocument.FinancialAccountType,
// Transaction Currency
@Semantics.currencyCode: true
_AccountingDocument.TransactionCurrency,
// Amount in Transaction Currency
@Semantics.amount.currencyCode: 'TransactionCurrency'
_AccountingDocument.AmountInTransactionCurrency,
// Credit Control Area Currency
@Semantics.currencyCode: true
_AccountingDocument.CreditControlAreaCurrency,
@Semantics.amount.currencyCode: 'CreditControlAreaCurrency'
_AccountingDocument.HedgedAmount,
@Semantics.currencyCode: true
_CreditControlArea._CreditControlArea2Segment._CreditSegment.CreditSegmentCurrency as CreditSegmentCurrency,
_CreditControlArea._CreditControlArea2Segment._CreditSegment.CrdtSgmtIsAddedToMainSgmt,
// Publish associations
_CreditExposureCategory,
_CreditControlArea
}
where
_AccountingDocument.FinancialAccountType = 'D'
and _AccountingDocument.CreditControlArea isnot initial
and _CreditControlArea._CreditControlArea2Segment.CreditSegment <> ''
and _CreditControlArea._CreditControlArea2Segment._CreditSegment.CreditSegmentCurrency <> ''
and(
_AccountingDocument.ClearingDate = '00000000'
)
and(
(
_AccountingDocument.SpecialGLCode != ''
and _AccountingDocument._SpecialGLCode.CreditLimitIsChecked = 'X'
)
or _AccountingDocument.SpecialGLCode = ''
)
and(
_AccountingDocument._PaymentDifferenceReason.IsDisputed = ''
or _AccountingDocument._PaymentDifferenceReason.IsDisputed is initial
or _AccountingDocument._PaymentDifferenceReason.IsDisputed isnull
)
// and I_Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner isnot initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BUSINESSPARTNER",
"I_CREDITCONTROLAREA",
"I_CREDITCONTROLAREA2SEGMENT",
"I_CREDITMANAGEMENTSEGMENT",
"I_CUSTOMER",
"I_CUSTOMERTOBUSINESSPARTNER",
"I_OPERATIONALACCTGDOCITEM",
"I_PAYMENTDIFFERENCEREASON",
"I_SPECIALGLCODE"
],
"ASSOCIATED":
[
"I_CREDITCONTROLAREA",
"I_CREDITEXPOSURECATEGORY"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/