@AbapCatalog.sqlViewName: 'CSDBDRFS'
@ClientHandling.algorithm:#SESSION_VARIABLE
@ClientHandling.type:#CLIENT_DEPENDENT
@AbapCatalog: {
compiler.compareFilter: true,
preserveKey: true
}
@AccessControl: {
authorizationCheck: #CHECK,
privilegedAssociations: [ '_Partner', '_PricingElement' ]
}
@Metadata.allowExtensions: true
@VDM.viewType: #CONSUMPTION
@ObjectModel: {
compositionRoot: true,
usageType: {
serviceQuality:#C, // more than 3 tables
sizeCategory: #L,
dataClass: #MIXED
},
semanticKey: [ 'BillingDocumentRequest' ]
}
define view C_BillingDocRequestObjPg
as select from I_BillingDocumentRequest
association [0..*] to C_BillingDocReqItemObjPg as _Item on $projection.BillingDocumentRequest = _Item.BillingDocumentRequest
association [0..*] to C_PricingElement as _PricingElement on $projection.SalesDocumentCondition = _PricingElement.PricingDocument
association [0..*] to C_SDDocumentPartnerCard as _Partner on $projection.BillingDocumentRequest = _Partner.SDDocument and _Partner.SDDocumentItem = '000000'
association [0..*] to I_DunningAreaText as _DunningAreaText on $projection.DunningArea = _DunningAreaText.DunningArea
and $projection.CompanyCode = _DunningAreaText.CompanyCode
//Extensibility
association [0..1] to E_BillingDocument as _Extension on $projection.BillingDocumentRequest = _Extension.BillingDocument
{
// ***************************************************************************************
// ************************** begin of CDS Source definition ****************************
// ***************************************************************************************
key cast ( I_BillingDocumentRequest.BillingDocumentRequest as sdbil_odata_bdr preserving type ) as BillingDocumentRequest,
cast ( I_BillingDocumentRequest.BillingDocumentRequestType as sdbil_odata_bdr_type preserving type ) as BillingDocumentRequestType,
I_BillingDocumentRequest._BillingDocumentRequestType._Text[1: Language = $session.system_language ].BillingDocumentTypeName as BillingDocumentTypeName,
// ***************************************************************************************
// *************************** PayerParty **********************************************
// ***************************************************************************************
I_BillingDocumentRequest.SoldToParty,
// * Pricing *
@UI.hidden:true
I_BillingDocumentRequest.PricingDocument as SalesDocumentCondition,
I_BillingDocumentRequest.OverallBillingDocReqStatus,
I_BillingDocumentRequest.CompanyCode,
I_BillingDocumentRequest.SalesOrganization,
I_BillingDocumentRequest.BillingDocumentDate,
I_BillingDocumentRequest.BillingIssueType,
cast ( I_BillingDocumentRequest.ReferenceDocumentLogicalSystem as sdbil_odata_source_system preserving type ) as BillgDocReqRefLgclSyst,
cast ( I_BillingDocumentRequest.ReferenceDocument as sdbil_odata_source_document preserving type ) as BillingDocRequestReference,
@ObjectModel.foreignKey.association: '_ReferenceDocSDDocCategory'
cast ( I_BillingDocumentRequest.ReferenceDocSDDocCategory as sdbil_odata_src_doc_cat preserving type ) as ReferenceDocSDDocCategory,//BillgDocReqRefSDDocCategory,
ProposedBillingDocumentType,
I_BillingDocumentRequest.TotalTaxAmount,
@Semantics.amount.currencyCode: 'TransactionCurrency'
@EndUserText: { label: 'Total Amount' }
(I_BillingDocumentRequest.TotalNetAmount + I_BillingDocumentRequest.TotalTaxAmount) as TotalGrossAmount,
I_BillingDocumentRequest.TotalNetAmount,
@Semantics.currencyCode: true
I_BillingDocumentRequest.TransactionCurrency,
//category
SDDocumentCategory,
// _Partner[PartnerFunction = 'RE'].FullName as BillToPartyName,
//Terms and Conditions
I_BillingDocumentRequest.CustomerPaymentTerms,
I_BillingDocumentRequest.IncotermsVersion,
I_BillingDocumentRequest.IncotermsClassification,
I_BillingDocumentRequest.IncotermsLocation1,
I_BillingDocumentRequest.IncotermsLocation2,
// Accounting
I_BillingDocumentRequest.CustomerAccountAssignmentGroup,
@ObjectModel.text.control: #('ASSOCIATED_TEXT_UI_HIDDEN')
@ObjectModel.text.association: '_DunningAreaText'
I_BillingDocumentRequest.DunningArea,
I_BillingDocumentRequest.DunningBlockingReason,
I_BillingDocumentRequest.DunningKey,
//Taxes
I_BillingDocumentRequest.Country,
I_BillingDocumentRequest.CustomerTaxClassification1,
I_BillingDocumentRequest.VATRegistration,
// ***************************************************************************************
// ************************ inherited associations ************************************
// ***************************************************************************************
I_BillingDocumentRequest._CompanyCode,
I_BillingDocumentRequest._SalesOrganization,
I_BillingDocumentRequest._SDDocumentCategory,
I_BillingDocumentRequest._ReferenceDocSDDocCategory,
I_BillingDocumentRequest._CustomerPaymentTerms,
I_BillingDocumentRequest._IncotermsClassification,
I_BillingDocumentRequest._IncotermsVersion,
I_BillingDocumentRequest._BillingDocumentRequestType,
I_BillingDocumentRequest._SoldToParty,
// I_BillingDocumentRequest._PayerParty,
I_BillingDocumentRequest._BillingIssueType,
I_BillingDocumentRequest._OvrlBillingDocReqStatus,
I_BillingDocumentRequest._ProposedBillingDocumentType,
I_BillingDocumentRequest._TransactionCurrency,
I_BillingDocumentRequest._CustomerAccountAssgmtGroup,
I_BillingDocumentRequest._DunningBlockingReason,
I_BillingDocumentRequest._DunningKey,
I_BillingDocumentRequest._Country,
// ***************************************************************************************
// ********************** defined associations ***************************************
// ***************************************************************************************
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_Item,
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_PricingElement,
_Partner,
@Consumption.hidden: true
_DunningAreaText
// ***************************************************************************************
// ************************** end of CDS Source definition ******************************
// ***************************************************************************************
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENTREQUEST",
"I_BILLINGDOCUMENTTYPE",
"I_BILLINGDOCUMENTTYPETEXT"
],
"ASSOCIATED":
[
"C_BILLINGDOCREQITEMOBJPG",
"C_PRICINGELEMENT",
"C_SDDOCUMENTPARTNERCARD",
"E_BILLINGDOCUMENT",
"I_BILLINGDOCUMENTTYPE",
"I_BILLINGISSUETYPE",
"I_COMPANYCODE",
"I_COUNTRY",
"I_CURRENCY",
"I_CUSTOMER",
"I_CUSTOMERACCOUNTASSGMTGROUP",
"I_CUSTOMERPAYMENTTERMS",
"I_DUNNINGAREATEXT",
"I_DUNNINGBLOCKINGREASONCODE",
"I_DUNNINGKEY",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSVERSION",
"I_OVRLBILLINGDOCREQSTATUS",
"I_SALESORGANIZATION",
"I_SDDOCUMENTCATEGORY"
],
"BASE":
[
"I_BILLINGDOCUMENTREQUEST"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/