C_SlsDocFlfmtBillgDoc

DDL: C_SLSDOCFLFMTBILLGDOC SQL: CSOFBILLGDOC Type: view CONSUMPTION

Sales Doc Fulfillment: Billing Document

C_SlsDocFlfmtBillgDoc is a Consumption CDS View that provides data about "Sales Doc Fulfillment: Billing Document" in SAP S/4HANA. It reads from 1 data source (I_BillingDocument) and exposes 31 fields with key field BillingDocument. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_BillingDocument BillingDocument from

Associations (1)

CardinalityTargetAliasCondition
[0..1] E_BillingDocument _Extension $projection.BillingDocument = _Extension.BillingDocument

Annotations (12)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #S view
EndUserText.label Sales Doc Fulfillment: Billing Document view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
Search.searchable false view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName CSOFBILLGDOC view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY BillingDocument I_BillingDocument BillingDocument
BillingDocumentType I_BillingDocument BillingDocumentType
BillingDocumentDate I_BillingDocument BillingDocumentDate
TotalNetAmount I_BillingDocument TotalNetAmount
TotalTaxAmount TotalTaxAmount
TransactionCurrency TransactionCurrency
AccountingTransferStatus I_BillingDocument AccountingTransferStatus
BillingDocumentIsCancelled I_BillingDocument BillingDocumentIsCancelled
PurchaseOrderByCustomer I_BillingDocument PurchaseOrderByCustomer
SalesOrganization I_BillingDocument SalesOrganization
CustomerGroup I_BillingDocument CustomerGroup
CustomerPaymentTerms I_BillingDocument CustomerPaymentTerms
SoldToParty I_BillingDocument SoldToParty
SoldToPartyName
AddressID
AddressID
AddressObjectType SoldToPartyAddressInfo AddressObjectType
AddressPersonID SoldToPartyAddressInfo AddressPersonID
PayerParty I_BillingDocument PayerParty
PayerPartyName
BillToParty
BillToPartyName
ShipToParty
ShipToPartyName
int1asAccountingTransfStsCriticality
_BillingDocumentType _BillingDocumentType
_SalesOrganization _SalesOrganization
_CustomerGroup _CustomerGroup
_AccountingTransferStatus _AccountingTransferStatus
_CustomerPaymentTerms _CustomerPaymentTerms
_TransactionCurrency _TransactionCurrency
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #S

@EndUserText.label: 'Sales Doc Fulfillment: Billing Document'
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@Search.searchable: false
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'CSOFBILLGDOC'

define view C_SlsDocFlfmtBillgDoc
as
select from I_BillingDocument as BillingDocument
left outer to one join I_SDDocStandardPartner   as Partner
           on BillingDocument.BillingDocument = Partner.SDDocument
           
--AT29.9.2021 added to get further address key fields into virtual elemement implmentation for SoldToPartyFormattedAddress
--            (same design as for C_SlsDocFlfmtSlsDoc & C_SlsDocFlfmtDelivDoc)
left outer to one join  I_SDDocumentCompletePartners     as SoldToPartyAddressInfo      on BillingDocument.BillingDocument = SoldToPartyAddressInfo.SDDocument 
                                                                                        and SoldToPartyAddressInfo.SDDocumentItem = '000000'
                                                                                        and SoldToPartyAddressInfo.PartnerFunction = 'AG'              

//Extensibility

association [0..1] to E_BillingDocument as _Extension on $projection.BillingDocument = _Extension.BillingDocument           
           
{ 
 //Key

 key BillingDocument.BillingDocument,
 
 BillingDocument.BillingDocumentType,

 BillingDocument.BillingDocumentDate,
 
 //Pricing

 @DefaultAggregation: #NONE
 @Semantics.amount.currencyCode: 'TransactionCurrency'
 BillingDocument.TotalNetAmount,
 @DefaultAggregation: #NONE
 @Semantics.amount.currencyCode: 'TransactionCurrency'
 TotalTaxAmount,
 @Semantics.currencyCode:true
 @ObjectModel.foreignKey.association: '_TransactionCurrency' 
 TransactionCurrency,
 
 //Accounting

 BillingDocument.AccountingTransferStatus,
 
 BillingDocument.BillingDocumentIsCancelled,
  
 //Sales

 BillingDocument.PurchaseOrderByCustomer,
 BillingDocument.SalesOrganization,
 BillingDocument.CustomerGroup,
 BillingDocument.CustomerPaymentTerms,
 
  //Partner   

 @ObjectModel.text.element:  [ 'SoldToPartyFullName' ]
 BillingDocument.SoldToParty,
 @Semantics.text: true
 cast (Partner._SoldToParty.CustomerName as vdm_sold_to_name) as SoldToPartyName,
  
 -- AT29.09.2021: changes for BP Adoption (CE2202)    --*FullName
 --  cast (Partner._SoldToParty._StandardAddress.FullName as fullnamesoldtoparty)  as SoldToPartyFullName,    --old modeling (no document address, no multiple address)
   @ObjectModel.readOnly: true
   @ObjectModel.virtualElement: true
   @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_FULLNAME'
   cast( '' as fullnamesoldtoparty )                                      as SoldToPartyFullName,       
-- AT29.09.2021: end
 
 --Partner._SoldToParty.AddressID, --AT29.09.2021 complete address key now taken from vbpa according to best practice to aim for document addresses...
 SoldToPartyAddressInfo.AddressID,
 SoldToPartyAddressInfo.AddressObjectType,
 SoldToPartyAddressInfo.AddressPersonID,
 @ObjectModel.readOnly: true
 @ObjectModel.virtualElement: true
 @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_ADDRESS'
 cast( ' ' as formattedaddresssoldtoparty  )as SoldToPartyFormattedAddress,
 
 @ObjectModel.text.element:  [ 'PayerPartyName' ] 
 BillingDocument.PayerParty,
 @Semantics.text: true 
 cast (Partner._PayerParty.CustomerName as payer_name)        as PayerPartyName,
 
 @ObjectModel.text.element:  [ 'BillToPartyName' ]
 cast (Partner.BillToParty as kunre) as BillToParty,
 @Semantics.text: true  
 cast (Partner._BillToParty.CustomerName as bill_to_name)     as BillToPartyName, 
 
 @ObjectModel.text.element:  [ 'ShipToPartyName' ]
 cast (Partner.ShipToParty as kunwe) as ShipToParty,
 @Semantics.text: true  
 cast (Partner._ShipToParty.CustomerName as ship_to_name)     as ShipToPartyName, 
   
 @ObjectModel.text.element: [ 'ShipToPartyCountryName' ]
 -- AT01.10.2021: changes for BP Adoption (CE2202)  
 --cast (Partner._ShipToParty._StandardAddress.Country as shiptopartycountry)  as ShipToPartyCountry, --old modeling (no document address, no multiple address)    
 @ObjectModel.readOnly: true
 @ObjectModel.virtualElement: true
 @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_COUNTRYNAME'
 cast( '' as shiptopartycountry )                                      as ShipToPartyCountry   ,    
-- AT01.10.2021: end
         
 @Semantics.text: true 
 -- AT01.10.2021: changes for BP Adoption (CE2202)    
 -- cast (Partner._ShipToParty._StandardAddress._Country._Text[1: Language = $session.system_language].CountryName as shiptopartycountryname)  as ShipToPartyCountryName, --old modeling (no document address, no multiple address)    
 @ObjectModel.readOnly: true
 @ObjectModel.virtualElement: true
 @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_COUNTRYNAME'
 cast( '' as shiptopartycountryname )                                      as ShipToPartyCountryName   ,    
-- AT01.10.2021: end     
  
 //Criticality

 @UI.hidden: true 
 cast(     
    case
    when AccountingTransferStatus = ''
      or AccountingTransferStatus = 'A'
      or AccountingTransferStatus = 'B'        
      or AccountingTransferStatus = 'F'
      or AccountingTransferStatus = 'G'
      or AccountingTransferStatus = 'I'
      or AccountingTransferStatus = 'K'
      or AccountingTransferStatus = 'L'
      or AccountingTransferStatus = 'M'         then 1  
                                                else 3 
    end as abap.int1
    )    as AccountingTransfStsCriticality, 
 
 // Associations 

 _BillingDocumentType,
 _SalesOrganization,
 _CustomerGroup,
 _AccountingTransferStatus,
 _CustomerPaymentTerms,
 _TransactionCurrency

}; 
                                                                            
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENT",
"I_CUSTOMER",
"I_SDDOCSTANDARDPARTNER",
"I_SDDOCUMENTCOMPLETEPARTNERS"
],
"ASSOCIATED":
[
"E_BILLINGDOCUMENT",
"I_ACCOUNTINGTRANSFERSTATUS",
"I_BILLINGDOCUMENTTYPE",
"I_CURRENCY",
"I_CUSTOMERGROUP",
"I_CUSTOMERPAYMENTTERMS",
"I_SALESORGANIZATION"
],
"BASE":
[
"I_BILLINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/