P_PAYREQNSUPLRCUSTLINEITEM

DDL: P_PAYREQNSUPLRCUSTLINEITEM SQL: PREQNSUPLRINVC Type: view COMPOSITE Package: GLO_FIN_PAY_REQN_CN

Suplr and Cust invoice for requisition

P_PAYREQNSUPLRCUSTLINEITEM is a Composite CDS View that provides data about "Suplr and Cust invoice for requisition" in SAP S/4HANA. It reads from 1 data source (I_OperationalAcctgDocItem) and exposes 19 fields with key fields CompanyCode, FiscalYear, AccountingDocument, AccountingDocumentItem. Part of development package GLO_FIN_PAY_REQN_CN.

Data Sources (1)

SourceAliasJoin Type
I_OperationalAcctgDocItem Invoice from

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PREQNSUPLRINVC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument
KEY AccountingDocumentItem I_OperationalAcctgDocItem AccountingDocumentItem
SpecialGLCode I_OperationalAcctgDocItem SpecialGLCode
DebitCreditCode I_OperationalAcctgDocItem DebitCreditCode
AccountingDocumentType I_OperationalAcctgDocItem AccountingDocumentType
AccountingDocumentTypeName
NetDueDate I_OperationalAcctgDocItem NetDueDate
PaymentMethod I_OperationalAcctgDocItem PaymentMethod
ClearingAccountingDocument I_OperationalAcctgDocItem ClearingAccountingDocument
ClearingIsReversed I_OperationalAcctgDocItem ClearingIsReversed
SupplierendasSupplier
Currency I_OperationalAcctgDocItem TransactionCurrency
AmountInTransactionCurrency I_OperationalAcctgDocItem AmountInTransactionCurrency
PaidAmountInPaytCurrency
HouseBank I_OperationalAcctgDocItem HouseBank
HouseBankAccount I_OperationalAcctgDocItem HouseBankAccount
SupplierBankType I_OperationalAcctgDocItem BPBankAccountInternalID
@AbapCatalog.sqlViewName: 'PREQNSUPLRINVC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #M
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PAYREQNSUPLRCUSTLINEITEM 
as select from 
I_OperationalAcctgDocItem as Invoice 
  left outer to one join I_Supplier as Supplier on Invoice.Customer = Supplier.Customer and Supplier.Customer != ''    
//  left outer to one join I_OperationalAcctgDocItem as PaymentDoc 

//                                              on   Invoice.CompanyCode = PaymentDoc.CompanyCode                                              

//                                              and  Invoice.AccountingDocument = PaymentDoc.InvoiceReference

//                                              and  Invoice.FiscalYear = PaymentDoc.InvoiceReferenceFiscalYear

//                                              and  Invoice.AccountingDocumentItem = PaymentDoc.InvoiceItemReference  

//                                              and  PaymentDoc.AccountingDocumentCategory <> 'S'  //exclude Noted Item   

//                                              and ( PaymentDoc.FollowOnDocumentType = 'P' or PaymentDoc.FollowOnDocumentType = 'Z' ) 

    
{   
  key Invoice.CompanyCode            as CompanyCode,
  key Invoice.FiscalYear             as FiscalYear,
  key Invoice.AccountingDocument     as AccountingDocument,  
  key Invoice.AccountingDocumentItem as AccountingDocumentItem,
  Invoice.SpecialGLCode              as SpecialGLCode,
  Invoice.DebitCreditCode            as DebitCreditCode,
//  PaymentDoc.AccountingDocument      as prdoc,

  Invoice.AccountingDocumentType     as AccountingDocumentType,
  Invoice._AccountingDocumentTypeText[1: Language = $session.system_language ].AccountingDocumentTypeName as AccountingDocumentTypeName,
  Invoice.NetDueDate                 as NetDueDate,
  Invoice.PaymentMethod              as PaymentMethod,
  
  Invoice.ClearingAccountingDocument,
  Invoice.ClearingIsReversed,
  
  case Invoice.Supplier
    when '' then Supplier.Supplier
    else Invoice.Supplier
  end as Supplier,    
  case Invoice.AccountingDocumentCategory 
          when 'S' then 'S' //Noted items

          when ''  then 'N' // normal items

          else 'S' // with special GL

        end as ItemType,
  @Semantics.currencyCode:true
  Invoice.TransactionCurrency as Currency,
  @Semantics: { amount : {currencyCode: 'Currency'} }
  Invoice.AmountInTransactionCurrency            as AmountInTransactionCurrency,
  @Semantics: { amount : {currencyCode: 'Currency'} }    
//  case

//        when ( Invoice.ClearingAccountingDocument <> ''

//              and Invoice.ClearingIsReversed = '' )

//            then abs(Invoice.AmountInTransactionCurrency)

//        else PaymentDoc.AmountInTransactionCurrency

//    end as PaidAmountInPaytCurrency

   cast( ('0') as abap.curr( 23,2))  as PaidAmountInPaytCurrency,
   Invoice.HouseBank,
   Invoice.HouseBankAccount,
   Invoice.BPBankAccountInternalID           as SupplierBankType
   
}
where 
  (Invoice.FinancialAccountType = 'K' or Invoice.FinancialAccountType = 'D' )