R_AccountsPayablesItem

DDL: R_ACCOUNTSPAYABLESITEM SQL: RFIAPITEM Type: view COMPOSITE

AP Operational Item

R_AccountsPayablesItem is a Composite CDS View that provides data about "AP Operational Item" in SAP S/4HANA. It reads from 1 data source (P_APLineItem_0) and exposes 187 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 9 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_APLineItem_0 P_APLineItem_0 from

Parameters (3)

NameTypeDefault
P_KeyDate vdm_v_key_date
P_TodayDate sydate
P_Language sylangu

Associations (9)

CardinalityTargetAliasCondition
[0..1] I_Currency _CompanyCodeCurrency $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency
[0..1] I_Currency _TransactionCurrency $projection.TransactionCurrency = _TransactionCurrency.Currency
[0..1] I_Currency _BalanceTransactionCurrency $projection.BalanceTransactionCurrency = _BalanceTransactionCurrency.Currency
[0..1] I_Currency _PaymentCurrency $projection.PaymentCurrency = _PaymentCurrency.Currency
[0..1] I_Currency _AdditionalCurrency1 $projection.AdditionalCurrency1 = _AdditionalCurrency1.Currency
[0..1] I_Currency _AdditionalCurrency2 $projection.AdditionalCurrency2 = _AdditionalCurrency2.Currency
[0..1] I_CurrencyRoleText _AdditionalCurrency1RoleText _AdditionalCurrency1RoleText.CurrencyRole = $projection.AdditionalCurrency1Role and _AdditionalCurrency1RoleText.Language = $session.system_language
[0..1] I_CurrencyRoleText _AdditionalCurrency2RoleText _AdditionalCurrency2RoleText.CurrencyRole = $projection.AdditionalCurrency2Role and _AdditionalCurrency2RoleText.Language = $session.system_language
[0..1] I_OneTimeAccountSupplier _OneTimeAccountSupplier _OneTimeAccountSupplier.CompanyCode = $projection.CompanyCode and _OneTimeAccountSupplier.FiscalYear = $projection.FiscalYear and _OneTimeAccountSupplier.AccountingDocument = $projection.AccountingDocument and _OneTimeAccountSupplier.AccountingDocumentItem = $projection.AccountingDocumentItem

Annotations (14)

NameValueLevelField
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
AbapCatalog.sqlViewName RFIAPITEM view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label AP Operational Item view
VDM.viewType #COMPOSITE view
Metadata.ignorePropagatedAnnotations true view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private false view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view

Fields (187)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode Receiver Company Code
KEY AccountingDocument Journal Entry
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem AccountingDocumentItem Posting View Item
PaymentDifferenceReason PaymentDifferenceReason Reason Code
Supplier Supplier Supplier
ClearingDate ClearingDate Clearing Date
ClearingDocFiscalYear ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
ClearingAccountingDocument Clearing Journal Entry
PostingKey PostingKey Posting Key
FinancialAccountType FinancialAccountType Fin. Account Type
MixedAccountType FinancialAccountType Fin. Account Type
SpecialGLCode SpecialGLCode Special G/L Ind
SpecialGLTransactionType SpecialGLTransactionType Transact.Type
DebitCreditCode DebitCreditCode Single-Character Flag
BusinessArea BusinessArea Business Area
TaxCode TaxCode Tax Code
TaxCountry TaxCountry Tax Ctry/Reg.
AlternativeGLAccount AlternativeGLAccount Group Account
TaxReportingDate TaxReportingDate Tax Reporting Date
ValueDate ValueDate Value Date
AssignmentReference Assignment Reference
DocumentItemText DocumentItemText Text
PartnerCompany Trading Partner
CostCenter CostCenter Cost Center
OrderID OrderID Order ID
BillingDocument SD Document
SalesDocument SalesDocument SD Document
SalesDocumentItem Sales Document Item
ScheduleLine ScheduleLine Schedule Line
MasterFixedAsset MasterFixedAsset Fixed Asset
FixedAsset FixedAsset Sub-number
IsUsedInPaymentTransaction IsUsedInPaymentTransaction Is Used In Payment Transaction
GLAccount General Ledger
BranchAccount Branch Repository branch
DueCalculationBaseDate Due Calculation Base Date
PaymentTerms PaymentTerms Pyt Terms
CashDiscount1Days CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent Disc. Percent 2
PaymentMethod PaymentMethod Pymt Meth.
PaymentBlockingReason PaymentBlockingReason Pmnt block
FixedCashDiscount FixedCashDiscount Fixed Cash Discount
FollowOnDocumentType FollowOnDocumentType Follow-On Document Type
InvoiceList InvoiceList Invoice List
BillOfExchangeUsage BillOfExchangeUsage BoE Usage
DunningKey DunningKey Dunning Key
DunningBlockingReason DunningBlockingReason Set Dunning Block
LastDunningDate LastDunningDate Last Dunned
DunningLevel Dunning Level
DunningArea DunningArea Dunning Area
Plant Plant Valuation Area
PurchasingDocument Purchasing Document
PurchasingDocumentItem PurchasingDocumentItem Purchasing Doc. Item
ProfitCenter ProfitCenter Profit Center
TreasuryContractType TreasuryContractType Treasury Contract Type
AssetContract AssetContract Asset Contract
CashFlowType CashFlowType Flow Type
ClearingIsReversed ClearingIsReversed Clearing Is Reversed
PaymentMethodSupplement PaymentMethodSupplement Pmnt Meth. Sup.
Reference1IDByBusinessPartner Reference1IDByBusinessPartner Reference Key 1
Reference2IDByBusinessPartner Reference2IDByBusinessPartner Reference Key 2
PaymentCardItem PaymentCardItem Payment Card Item
PaymentCardPaymentSettlement PaymentCardPaymentSettlement Payment Card Payment Settlement
Reference3IDByBusinessPartner Reference Key 3
DataExchangeInstruction1 DataExchangeInstruction1 Instruction 1
DataExchangeInstruction2 DataExchangeInstruction2 Instruction 2
DataExchangeInstruction3 DataExchangeInstruction3 Instruction 3
DataExchangeInstruction4 DataExchangeInstruction4 Instruction 4
HasPaymentOrder HasPaymentOrder Payment Sent
PaymentReference PaymentReference Payment Reference
BusinessPlace BusinessPlace Business place
TaxSection TaxSection Tax Section
FundsCenter FundsCenter Funds Center
SettlementReferenceDate Reference date
IsSalesRelated IsSalesRelated Is Sales Related
PostingDate PostingDate Posting Date for GR
AccountingDocumentCategory AccountingDocumentCategory Journal Entry Category
FiscalPeriod FiscalPeriod Tax period
DocumentDate DocumentDate Journal Entry Date
AccountingDocumentType Journal Entry Type
NetDueDate NetDueDate Net Due Date
CashDiscount1DueDate CashDiscount1DueDate Cash Discount 1
DocumentReferenceID Reference
AccountingDocumentCreationDate Journal Entry Date
AccountingDocCreatedByUser AccountingDocCreatedByUser User which created overhead document
DueItemType
SupplierIndustry
SupplierIndustryName Industry Key
SupplierCreationDate
SupplierAccountGroup Account group
SupplierSearchText
SupplierIsOneTimeAccount
SupplierVATRegistration VAT Registration No.
SupplierTaxJurisdiction SupplierTaxJurisdiction
SupplierBasicAuthorizationGrp SupplierBasicAuthorizationGrp
SupplierFinsAuthorizationGrp SupplierFinsAuthorizationGrp
AlternativePayeeIsAllowed Payee in doc.
PostingIsBlockedForSupplier
SupplierCorporateGroup Group
SupplierCountry
SupplierName Supplier Name
SupplierCityName SupplierCityName Supplier City
SupplierPOBox
SupplierPOBoxPostalCode
SupplierPostalCode Arrival Postal Code
SupplierRegion
SupplierRegionName Description
SupplierCreatedByUser
AccountingClerk Clerk Abbrev.
ReconciliationAccount ReconciliationAccount Recon. account
InterestCalculationCode InterestCalculationCode Interest Indic.
SupplierHeadOffice SupplierHeadOffice Head Office
SupplierPaymentBlockingReason
InterestCalculationDate InterestCalculationDate Last Key Date
IntrstCalcFrequencyInMonths IntrstCalcFrequencyInMonths Int.Calc.Freq.
APARToleranceGroup APARToleranceGroup Tolerance Group
HouseBank HouseBank House Bank
ItemIsToBePaidSeparately ItemIsToBePaidSeparately Individual Payt
PaymentIsToBeSentByEDI PaymentIsToBeSentByEDI Pmt adv. by EDI
SupplierAccountNote SupplierAccountNote Account Memo
CompanyCodeName CompanyCodeName Company Name
IsDisputed
InvoiceReference Invoice Reference
FiscalYearPeriod Period/Year
IsCleared Integer
CreditControlArea Credit Control Area
PayableAlternativePayee
NetDueArrearsDays
CashDiscount1ArrearsDays
OffsettingAccount Offsetting Acct
OffsettingAccountType Offset Acct Type
DocumentIsArchived
TargetTaxCode TargetTaxCode
AlternativePayee Alternat.payee
CashDiscount1DueStatus
NetDueStatus
KeyDate Maturity Key Date
CashDiscount1IsDue
IsClearedAtKeyDate
IsDueNet
ClearingStatus Clearing status
IsNegativePosting Negative Posting
AcctgDocTypeAuthorizationGroup AcctgDocTypeAuthorizationGroup
BPBankAccountInternalID BP Bank Account
SenderLogicalSystem _JournalEntry SenderLogicalSystem Sender Logical System
SenderCompanyCode _JournalEntry SenderCompanyCode Sender Company Code
SenderAccountingDocument _JournalEntry SenderAccountingDocument Sender Journal Entry
SenderFiscalYear _JournalEntry SenderFiscalYear Sender FiscalYr
CompanyCodeCurrency Local Currency
TransactionCurrency TransactionCurrency Transaction Currency
BalanceTransactionCurrency BalanceTransactionCurrency Currency
PaymentCurrency PaymentCurrency Payment Currency
AdditionalCurrency1 AdditionalCurrency1 Local curr. 2
AdditionalCurrency2 AdditionalCurrency2 Local curr. 3
AmountInAdditionalCurrency1 AmountInAdditionalCurrency1 Amount in Additional Currency 1
AmountInAdditionalCurrency2 AmountInAdditionalCurrency2 LC2 Amount
AmountInBalanceTransacCrcy Amount in Balance Transaction Currency
AmountInCompanyCodeCurrency Local Crcy Amt
AmountInPaymentCurrency Amount in Payment Currency
AmountInTransactionCurrency Pt Crcy Amt
CashDiscountAmount CD Amount
CashDiscountAmtInCoCodeCrcy Discount Amt
CashDiscountBaseAmount Cash Dscnt Base Amt
HedgedAmount
PlannedAmtInTransactionCrcy Plnd Amt Trans. Crcy
ValuatedAmtInCompanyCodeCrcy
ValuatedAmtInAdditionalCrcy1
ValuatedAmtInAdditionalCrcy2
WithholdingTaxAmount Withholding Tax Amt
WithholdingTaxBaseAmount WTax Base Amt
WithholdingTaxExemptionAmt WTax-Exempt
InterestToBePosted
CashDiscountAmtInTransacCrcy
Debtor Debtor Debtor
AdditionalCurrency1Role AdditionalCurrency1Role LC2 Crcy Type
AdditionalCurrency2Role AdditionalCurrency2Role LC3 Crcy Type
AdditionalCurrency1RoleName
AdditionalCurrency2RoleName
BranchCode Branch Code
TH_BranchCodeDescription
ReferenceDocumentType ReferenceDocumentType Reference Document Type
ReferenceDocumentTypeName
OriginalReferenceDocument OriginalReferenceDocument Reference Key
ReferenceDocumentLogicalSystem ReferenceDocumentLogicalSystem Ref. Doc. Lgcl Syst.

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view R_AccountsPayablesItem.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: RFIAPITEM
-- Parameters: P_KeyDate : vdm_v_key_date, P_TodayDate : sydate, P_Language : sylangu

CREATE VIEW R_AccountsPayablesItem AS
SELECT
  CompanyCode,
  cast( AccountingDocument as fis_belnr preserving type ) AS AccountingDocument,
  FiscalYear,
  AccountingDocumentItem,
  PaymentDifferenceReason,
  Supplier,
  ClearingDate,
  ClearingDocFiscalYear,
  cast( ClearingAccountingDocument as fis_augbl ) AS ClearingAccountingDocument,
  PostingKey,
  FinancialAccountType,
  FinancialAccountType AS MixedAccountType,
  SpecialGLCode,
  SpecialGLTransactionType,
  DebitCreditCode,
  BusinessArea,
  TaxCode,
  TaxCountry,
  AlternativeGLAccount,
  TaxReportingDate,
  ValueDate,
  cast( AssignmentReference as fis_zuonr ) AS AssignmentReference,
  DocumentItemText,
  cast( PartnerCompany as fis_rassc ) AS PartnerCompany,
  CostCenter,
  OrderID,
  cast( BillingDocument as farp_vbeln ) AS BillingDocument,
  SalesDocument,
  cast( SalesDocumentItem as farp_posn2 ) AS SalesDocumentItem,
  ScheduleLine,
  MasterFixedAsset,
  FixedAsset,
  IsUsedInPaymentTransaction,
  cast( GLAccount as fis_racct ) AS GLAccount,
  Branch AS BranchAccount,
  cast( DueCalculationBaseDate as farp_dzfbdt ) AS DueCalculationBaseDate,
  PaymentTerms,
  CashDiscount1Days,
  CashDiscount2Days,
  NetPaymentDays,
  cast( CashDiscount1Percent as dzbd1p_farp ) AS CashDiscount1Percent,
  cast( CashDiscount2Percent as dzbd2p_farp ) AS CashDiscount2Percent,
  PaymentMethod,
  PaymentBlockingReason,
  FixedCashDiscount,
  FollowOnDocumentType,
  InvoiceList,
  BillOfExchangeUsage,
  DunningKey,
  DunningBlockingReason,
  LastDunningDate,
  cast( DunningLevel as farp_mahns ) AS DunningLevel,
  DunningArea,
  Plant,
  cast( PurchasingDocument as fis_ebeln ) AS PurchasingDocument,
  PurchasingDocumentItem,
  ProfitCenter,
  TreasuryContractType,
  AssetContract,
  CashFlowType,
  ClearingIsReversed,
  PaymentMethodSupplement,
  Reference1IDByBusinessPartner,
  Reference2IDByBusinessPartner,
  PaymentCardItem,
  PaymentCardPaymentSettlement,
  cast( Reference3IDByBusinessPartner as farp_xref3 ) AS Reference3IDByBusinessPartner,
  DataExchangeInstruction1,
  DataExchangeInstruction2,
  DataExchangeInstruction3,
  DataExchangeInstruction4,
  HasPaymentOrder,
  PaymentReference,
  BusinessPlace,
  TaxSection,
  FundsCenter,
  cast( SettlementReferenceDate as farp_dabrbez) AS SettlementReferenceDate,
  IsSalesRelated,
  PostingDate,
  AccountingDocumentCategory,
  FiscalPeriod,
  DocumentDate,
  cast( AccountingDocumentType as fis_blart ) AS AccountingDocumentType,
  NetDueDate,
  CashDiscount1DueDate,
  cast( DocumentReferenceID as xblnr ) AS DocumentReferenceID,
  cast( AccountingDocumentCreationDate as farp_cpudt ) AS AccountingDocumentCreationDate,
  AccountingDocCreatedByUser,
  cast( DueItemType as farp_due_item_category ) AS DueItemType,
  cast( SupplierIndustry as fap_brsch ) AS SupplierIndustry,
  cast( SupplierIndustryName as fap_brtxt ) AS SupplierIndustryName,
  cast( SupplierCreationDate as fap_ap_crdat ) AS SupplierCreationDate,
  cast( SupplierAccountGroup as farp_supplier_account_group) AS SupplierAccountGroup,
  cast( SupplierSearchText as farp_sortl ) AS SupplierSearchText,
  cast( SupplierIsOneTimeAccount as farp_xcpdk ) AS SupplierIsOneTimeAccount,
  cast( SupplierVATRegistration as farp_stceg ) AS SupplierVATRegistration,
  SupplierTaxJurisdiction,
  SupplierBasicAuthorizationGrp,
  SupplierFinsAuthorizationGrp,
  cast( AlternativePayeeIsAllowed as farp_xzemp ) AS AlternativePayeeIsAllowed,
  cast( PostingIsBlockedForSupplier as farp_sperb ) AS PostingIsBlockedForSupplier,
  cast( SupplierCorporateGroup as farp_konzs ) AS SupplierCorporateGroup,
  cast( SupplierCountry as farp_land1 ) AS SupplierCountry,
  cast( SupplierName as fap_supplier_name1_gp ) AS SupplierName,
  SupplierCityName,
  cast( SupplierPOBox as ad_pobx ) AS SupplierPOBox,
  cast( SupplierPOBoxPostalCode as ad_pstcd2 ) AS SupplierPOBoxPostalCode,
  cast( SupplierPostalCode as ad_pstcd1 ) AS SupplierPostalCode,
  cast( SupplierRegion as farp_supplier_region ) AS SupplierRegion,
  cast( SupplierRegionName as farp_supplier_region_name ) AS SupplierRegionName,
  cast( SupplierCreatedByUser as fap_ap_crusr ) AS SupplierCreatedByUser,
  cast( AccountingClerk as farp_busab ) AS AccountingClerk,
  ReconciliationAccount,
  InterestCalculationCode,
  SupplierHeadOffice,
  cast( SupplierPaymentBlockingReason as fap_dzlspr ) AS SupplierPaymentBlockingReason,
  InterestCalculationDate,
  IntrstCalcFrequencyInMonths,
  APARToleranceGroup,
  HouseBank,
  ItemIsToBePaidSeparately,
  PaymentIsToBeSentByEDI,
  SupplierAccountNote,
  CompanyCodeName,
  cast( IsDisputed as farp_xstrp ) AS IsDisputed,
  cast( InvoiceReference as farp_rebzg ) AS InvoiceReference,
  cast( FiscalYearPeriod as fins_fyearperiod ) AS FiscalYearPeriod,
  cast( IsCleared as abap_boolean ) AS IsCleared,
  cast( CreditControlArea as farp_kkber ) AS CreditControlArea,
  cast( PayableAlternativePayee as fap_empfb ) AS PayableAlternativePayee,
  cast( NetDueArrearsDays as farp_verzn ) AS NetDueArrearsDays,
  cast( CashDiscount1ArrearsDays as farp_verz1 ) AS CashDiscount1ArrearsDays,
  cast( OffsettingAccount as fis_gkont ) AS OffsettingAccount,
  cast( OffsettingAccountType as farp_gkoar ) AS OffsettingAccountType,
  cast( DocumentIsArchived as farp_xarch) AS DocumentIsArchived,
  TargetTaxCode,
  cast ( AlternativePayee as farp_lnrzb ) AS AlternativePayee,
  cast( CashDiscount1DueStatus as far_sym_due1 ) AS CashDiscount1DueStatus,
  cast( NetDueStatus as far_sym_due ) AS NetDueStatus,
  cast( KeyDate as vdm_v_key_date ) AS KeyDate,
  cast( CashDiscount1IsDue as farp_xdue1 ) AS CashDiscount1IsDue,
  cast( IsClearedAtKeyDate as farp_xaugp ) AS IsClearedAtKeyDate,
  cast( IsDueNet as farp_xduen ) AS IsDueNet,
  cast( cast(ClearingStatus as abap.char( 1 )) as augst ) AS ClearingStatus,
  cast( IsNegativePosting as farp_xnegp ) AS IsNegativePosting,
  AcctgDocTypeAuthorizationGroup,
  cast( BPBankAccountInternalID as farp_bvtyp ) AS BPBankAccountInternalID,
  _JournalEntry.SenderLogicalSystem AS SenderLogicalSystem,
  _JournalEntry.SenderCompanyCode AS SenderCompanyCode,
  _JournalEntry.SenderAccountingDocument AS SenderAccountingDocument,
  _JournalEntry.SenderFiscalYear AS SenderFiscalYear,
  cast( CompanyCodeCurrency as fis_hwaer preserving type ) AS CompanyCodeCurrency,
  TransactionCurrency,
  BalanceTransactionCurrency,
  PaymentCurrency,
  AdditionalCurrency1,
  AdditionalCurrency2,
  AmountInAdditionalCurrency1,
  AmountInAdditionalCurrency2,
  cast( AmountInBalanceTransacCrcy as pswbt_farp ) AS AmountInBalanceTransacCrcy,
  cast( AmountInCompanyCodeCurrency as dmshb_farp ) AS AmountInCompanyCodeCurrency,
  cast( AmountInPaymentCurrency as pyamt_farp ) AS AmountInPaymentCurrency,
  cast( AmountInTransactionCurrency as wrshb_farp ) AS AmountInTransactionCurrency,
  cast( CashDiscountAmount as wskto_farp ) AS CashDiscountAmount,
  cast( CashDiscountAmtInCoCodeCrcy as sknto_farp ) AS CashDiscountAmtInCoCodeCrcy,
  cast( CashDiscountBaseAmount as skfbt_farp ) AS CashDiscountBaseAmount,
  cast( HedgedAmount as absbt_farp ) AS HedgedAmount,
  cast( PlannedAmtInTransactionCrcy as fdwbt_farp ) AS PlannedAmtInTransactionCrcy,
  cast( cast( ValuatedAmtInCompanyCodeCrcy as abap.curr( 23, 2 ) ) as bwwrt_farp ) AS ValuatedAmtInCompanyCodeCrcy,
  cast( cast( ValuatedAmtInAdditionalCrcy1 as abap.curr( 23, 2 ) ) as bwwr2_farp ) AS ValuatedAmtInAdditionalCrcy1,
  cast( cast( ValuatedAmtInAdditionalCrcy2 as abap.curr( 23, 2 ) ) as bwwr3_farp ) AS ValuatedAmtInAdditionalCrcy2,
  cast( WithholdingTaxAmount as qbshb_farp ) AS WithholdingTaxAmount,
  cast( WithholdingTaxBaseAmount as qsshb_farp ) AS WithholdingTaxBaseAmount,
  cast( WithholdingTaxExemptionAmt as qsfbt_farp ) AS WithholdingTaxExemptionAmt,
  cast( InterestToBePosted as farp_dzinsz ) AS InterestToBePosted,
  cast( cast( CashDiscountAmtInTransacCrcy as abap.curr( 23, 2 ) ) as askto_farp ) AS CashDiscountAmtInTransacCrcy,
  Debtor,
  AdditionalCurrency1Role,
  AdditionalCurrency2Role,
  cast( _AdditionalCurrency1RoleText.CurrencyRoleName as fis_adl1_currole_name preserving type ) AS AdditionalCurrency1RoleName,
  cast( _AdditionalCurrency2RoleText.CurrencyRoleName as fis_adl2_currole_name preserving type ) AS AdditionalCurrency2RoleName,
  cast( BranchCode as bcode ) AS BranchCode,
  cast( _TH_SupplierBranchCodeVH.TH_BranchCodeDescription as fith_desc ) AS TH_BranchCodeDescription,
  ReferenceDocumentType,
  cast( _ReferenceDocumentTypeText.ReferenceDocumentTypeName as fac_text_typ ) AS ReferenceDocumentTypeName,
  OriginalReferenceDocument,
  ReferenceDocumentLogicalSystem
FROM P_APLineItem_0
LEFT OUTER JOIN I_Currency AS _CompanyCodeCurrency ON CompanyCodeCurrency = _CompanyCodeCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _TransactionCurrency ON TransactionCurrency = _TransactionCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _BalanceTransactionCurrency ON BalanceTransactionCurrency = _BalanceTransactionCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _PaymentCurrency ON PaymentCurrency = _PaymentCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _AdditionalCurrency1 ON AdditionalCurrency1 = _AdditionalCurrency1.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _AdditionalCurrency2 ON AdditionalCurrency2 = _AdditionalCurrency2.Currency  -- association [0..1]
LEFT OUTER JOIN I_CurrencyRoleText AS _AdditionalCurrency1RoleText ON _AdditionalCurrency1RoleText.CurrencyRole = AdditionalCurrency1Role AND _AdditionalCurrency1RoleText.Language = $session.system_language  -- association [0..1]
LEFT OUTER JOIN I_CurrencyRoleText AS _AdditionalCurrency2RoleText ON _AdditionalCurrency2RoleText.CurrencyRole = AdditionalCurrency2Role AND _AdditionalCurrency2RoleText.Language = $session.system_language  -- association [0..1]
LEFT OUTER JOIN I_OneTimeAccountSupplier AS _OneTimeAccountSupplier ON _OneTimeAccountSupplier.CompanyCode = CompanyCode AND _OneTimeAccountSupplier.FiscalYear = FiscalYear AND _OneTimeAccountSupplier.AccountingDocument = AccountingDocument AND _OneTimeAccountSupplier.AccountingDocumentItem = AccountingDocumentItem  -- association [0..1]
;