P_APLineItem_2

DDL: P_APLINEITEM_2 SQL: PAPLINEITEM2 Type: view COMPOSITE

P_APLineItem_2 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_APLineItem_3) and exposes 155 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 8 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_APLineItem_3 P_APLineItem_3 from

Parameters (2)

NameTypeDefault
P_KeyDate vdm_v_key_date
P_TodayDate abap.dats

Associations (8)

CardinalityTargetAliasCondition
[1..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_PaymentDifferenceReason _PaymentDifferenceReason $projection.CompanyCode = _PaymentDifferenceReason.CompanyCode and $projection.PaymentDifferenceReason = _PaymentDifferenceReason.PaymentDifferenceReason
[1..1] lfa1 _Creditor $projection.Supplier = _Creditor.lifnr
[1..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[1..1] I_SupplierCompany _SupplierCompany $projection.CompanyCode = _SupplierCompany.CompanyCode and $projection.Supplier = _SupplierCompany.Supplier
[0..1] I_JournalEntry _JournalEntry $projection.AccountingDocument = _JournalEntry.AccountingDocument and $projection.CompanyCode = _JournalEntry.CompanyCode and $projection.FiscalYear = _JournalEntry.FiscalYear
[0..1] I_Customer _Customer $projection.Debtor = _Customer.Customer
[0..1] I_CustomerCompany _CustomerCompany $projection.CompanyCode = _CustomerCompany.CompanyCode and $projection.Debtor = _CustomerCompany.Customer

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PAPLINEITEM2 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (155)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_APLineItem_3 CompanyCode Receiver Company Code
KEY AccountingDocument P_APLineItem_3 AccountingDocument Journal Entry
KEY FiscalYear P_APLineItem_3 FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem P_APLineItem_3 AccountingDocumentItem Posting View Item
KEYDT2 P_APLineItem_3 KEYDT2
PaymentDifferenceReason P_APLineItem_3 PaymentDifferenceReason Reason Code
Supplier P_APLineItem_3 Supplier Supplier
ClearingDate P_APLineItem_3 ClearingDate Clearing Date
ClearingDocFiscalYear P_APLineItem_3 ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
ClearingAccountingDocument P_APLineItem_3 ClearingAccountingDocument Clearing Journal Entry
PostingKey P_APLineItem_3 PostingKey Posting Key
FinancialAccountType P_APLineItem_3 FinancialAccountType Fin. Account Type
SpecialGLCode P_APLineItem_3 SpecialGLCode Special G/L Ind
SpecialGLTransactionType P_APLineItem_3 SpecialGLTransactionType Transact.Type
DebitCreditCode P_APLineItem_3 DebitCreditCode Single-Character Flag
BusinessArea P_APLineItem_3 BusinessArea Business Area
TaxCode P_APLineItem_3 TaxCode Tax Code
TaxCountry P_APLineItem_3 TaxCountry Tax Ctry/Reg.
TaxReportingDate P_APLineItem_3 TaxReportingDate Tax Reporting Date
AmountInCompanyCodeCurrency P_APLineItem_3 AmountInCompanyCodeCurrency Local Crcy Amt
AmountInTransactionCurrency P_APLineItem_3 AmountInTransactionCurrency Pt Crcy Amt
AmountInBalanceTransacCrcy P_APLineItem_3 AmountInBalanceTransacCrcy Amount in Balance Transaction Currency
BalanceTransactionCurrency P_APLineItem_3 BalanceTransactionCurrency Currency
WithholdingTaxBaseAmount P_APLineItem_3 WithholdingTaxBaseAmount WTax Base Amt
ValuationDiffAmtInCoCodeCrcy P_APLineItem_3 ValuationDiffAmtInCoCodeCrcy
ValuationDiffAmtInAddlCrcy1 P_APLineItem_3 ValuationDiffAmtInAddlCrcy1
ValueDate P_APLineItem_3 ValueDate Value Date
AssignmentReference P_APLineItem_3 AssignmentReference Assignment Reference
DocumentItemText P_APLineItem_3 DocumentItemText Text
PartnerCompany P_APLineItem_3 PartnerCompany Trading Partner
CostCenter P_APLineItem_3 CostCenter Cost Center
OrderID P_APLineItem_3 OrderID Order ID
BillingDocument P_APLineItem_3 BillingDocument SD Document
SalesDocument P_APLineItem_3 SalesDocument SD Document
SalesDocumentItem P_APLineItem_3 SalesDocumentItem Sales Document Item
ScheduleLine P_APLineItem_3 ScheduleLine Schedule Line
MasterFixedAsset P_APLineItem_3 MasterFixedAsset Fixed Asset
FixedAsset P_APLineItem_3 FixedAsset Sub-number
IsUsedInPaymentTransaction P_APLineItem_3 IsUsedInPaymentTransaction Is Used In Payment Transaction
GLAccount P_APLineItem_3 GLAccount General Ledger
Branch P_APLineItem_3 Branch Repository branch
DueCalculationBaseDate P_APLineItem_3 DueCalculationBaseDate Due Calculation Base Date
PaymentTerms P_APLineItem_3 PaymentTerms Pyt Terms
CashDiscount1Days P_APLineItem_3 CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days P_APLineItem_3 CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays P_APLineItem_3 NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent P_APLineItem_3 CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent P_APLineItem_3 CashDiscount2Percent Disc. Percent 2
CashDiscountBaseAmount P_APLineItem_3 CashDiscountBaseAmount Cash Dscnt Base Amt
CashDiscountAmtInCoCodeCrcy P_APLineItem_3 CashDiscountAmtInCoCodeCrcy Discount Amt
CashDiscountAmount P_APLineItem_3 CashDiscountAmount CD Amount
PaymentMethod P_APLineItem_3 PaymentMethod Pymt Meth.
PaymentBlockingReason P_APLineItem_3 PaymentBlockingReason Pmnt block
FixedCashDiscount P_APLineItem_3 FixedCashDiscount Fixed Cash Discount
InvoiceReference P_APLineItem_3 InvoiceReference Invoice Reference
FollowOnDocumentType P_APLineItem_3 FollowOnDocumentType Follow-On Document Type
StateCentralBankPaymentReason P_APLineItem_3 StateCentralBankPaymentReason SCB Ind.
SupplyingCountry P_APLineItem_3 SupplyingCountry Supplying Ctry/Reg.
InvoiceList P_APLineItem_3 InvoiceList Invoice List
BillOfExchangeUsage P_APLineItem_3 BillOfExchangeUsage BoE Usage
DunningKey P_APLineItem_3 DunningKey Dunning Key
DunningBlockingReason P_APLineItem_3 DunningBlockingReason Set Dunning Block
LastDunningDate P_APLineItem_3 LastDunningDate Last Dunned
DunningLevel P_APLineItem_3 DunningLevel Dunning Level
DunningArea P_APLineItem_3 DunningArea Dunning Area
WithholdingTaxAmount P_APLineItem_3 WithholdingTaxAmount Withholding Tax Amt
WithholdingTaxExemptionAmt P_APLineItem_3 WithholdingTaxExemptionAmt WTax-Exempt
Plant P_APLineItem_3 Plant Valuation Area
PurchasingDocument P_APLineItem_3 PurchasingDocument Purchasing Document
PurchasingDocumentItem P_APLineItem_3 PurchasingDocumentItem Purchasing Doc. Item
ProfitCenter P_APLineItem_3 ProfitCenter Profit Center
TreasuryContractType P_APLineItem_3 TreasuryContractType Treasury Contract Type
AssetContract P_APLineItem_3 AssetContract Asset Contract
CashFlowType P_APLineItem_3 CashFlowType Flow Type
WBSElement P_APLineItem_3 WBSElement WBS Internal ID
AlternativeGLAccount P_APLineItem_3 AlternativeGLAccount Group Account
AmountInAdditionalCurrency1 P_APLineItem_3 AmountInAdditionalCurrency1 Amount in Additional Currency 1
AmountInAdditionalCurrency2 P_APLineItem_3 AmountInAdditionalCurrency2 LC2 Amount
AmountInFunctionalCurrency P_APLineItem_3 AmountInFunctionalCurrency Amount in Functional Currency
ValuationDiffAmtInAddlCrcy2 P_APLineItem_3 ValuationDiffAmtInAddlCrcy2
ClearingIsReversed P_APLineItem_3 ClearingIsReversed Clearing Is Reversed
PaymentMethodSupplement P_APLineItem_3 PaymentMethodSupplement Pmnt Meth. Sup.
Reference1IDByBusinessPartner P_APLineItem_3 Reference1IDByBusinessPartner Reference Key 1
Reference2IDByBusinessPartner P_APLineItem_3 Reference2IDByBusinessPartner Reference Key 2
PaymentCardItem P_APLineItem_3 PaymentCardItem Payment Card Item
PaymentCardPaymentSettlement P_APLineItem_3 PaymentCardPaymentSettlement Payment Card Payment Settlement
CreditControlArea P_APLineItem_3 CreditControlArea Credit Control Area
PayableAlternativePayee P_APLineItem_3 PayableAlternativePayee
Reference3IDByBusinessPartner P_APLineItem_3 Reference3IDByBusinessPartner Reference Key 3
DataExchangeInstruction1 P_APLineItem_3 DataExchangeInstruction1 Instruction 1
DataExchangeInstruction2 P_APLineItem_3 DataExchangeInstruction2 Instruction 2
DataExchangeInstruction3 P_APLineItem_3 DataExchangeInstruction3 Instruction 3
DataExchangeInstruction4 P_APLineItem_3 DataExchangeInstruction4 Instruction 4
HasPaymentOrder P_APLineItem_3 HasPaymentOrder Payment Sent
PaymentReference P_APLineItem_3 PaymentReference Payment Reference
HedgedAmount P_APLineItem_3 HedgedAmount
PaymentCurrency P_APLineItem_3 PaymentCurrency Payment Currency
AmountInPaymentCurrency P_APLineItem_3 AmountInPaymentCurrency Amount in Payment Currency
BusinessPlace P_APLineItem_3 BusinessPlace Business place
TaxSection P_APLineItem_3 TaxSection Tax Section
AccountsReceivableIsPledged P_APLineItem_3 AccountsReceivableIsPledged Accounts Receivable Is Pledged
RealEstateObject P_APLineItem_3 RealEstateObject Real Estate Key
FundsCenter P_APLineItem_3 FundsCenter Funds Center
SettlementReferenceDate P_APLineItem_3 SettlementReferenceDate Reference date
IsSalesRelated P_APLineItem_3 IsSalesRelated Is Sales Related
PostingDate P_APLineItem_3 PostingDate Posting Date for GR
AccountingDocumentCategory P_APLineItem_3 AccountingDocumentCategory Journal Entry Category
FiscalPeriod P_APLineItem_3 FiscalPeriod Tax period
DocumentDate P_APLineItem_3 DocumentDate Journal Entry Date
AccountingDocumentType P_APLineItem_3 AccountingDocumentType Journal Entry Type
TransactionCurrency P_APLineItem_3 TransactionCurrency Transaction Currency
PlannedAmtInTransactionCrcy P_APLineItem_3 PlannedAmtInTransactionCrcy Plnd Amt Trans. Crcy
NetDueDate P_APLineItem_3 NetDueDate Net Due Date
CashDiscount1DueDate P_APLineItem_3 CashDiscount1DueDate Cash Discount 1
SourceCompanyCode P_APLineItem_3 SourceCompanyCode
DocumentReferenceID P_APLineItem_3 DocumentReferenceID Reference
AccountingDocumentCreationDate P_APLineItem_3 AccountingDocumentCreationDate Journal Entry Date
AccountingDocCreatedByUser P_APLineItem_3 AccountingDocCreatedByUser User which created overhead document
AdditionalCurrency1 P_APLineItem_3 AdditionalCurrency1 Local curr. 2
AdditionalCurrency2 P_APLineItem_3 AdditionalCurrency2 Local curr. 3
FunctionalCurrency P_APLineItem_3 FunctionalCurrency Functional Currency
OffsettingAccount P_APLineItem_3 OffsettingAccount Offsetting Acct
OffsettingAccountType P_APLineItem_3 OffsettingAccountType Offset Acct Type
AcctgDocTypeAuthorizationGroup AccDocumentType AuthorizationGroup AuthorizGroup
ITEM_TYPE_BRANCH P_APLineItem_3 ITEM_TYPE_BRANCH
DocumentIsArchived P_APLineItem_3 DocumentIsArchived
TargetTaxCode P_APLineItem_3 TargetTaxCode
DPNOTDUE P_APLineItem_3 DPNOTDUE
CompanyCodeCurrency P_APLineItem_3 CompanyCodeCurrency Local Currency
BPBankAccountInternalID P_APLineItem_3 BPBankAccountInternalID BP Bank Account
HouseBank P_APLineItem_3 HouseBank House Bank
HouseBankAccount P_APLineItem_3 HouseBankAccount House Bank Account
Debtor P_APLineItem_3 Debtor Debtor
AdditionalCurrency1Role AdditionalCurrency1Role LC2 Crcy Type
AdditionalCurrency2Role AdditionalCurrency2Role LC3 Crcy Type
BranchCode BranchCode Branch Code
ReferenceDocumentType ReferenceDocumentType Reference Document Type
OriginalReferenceDocument OriginalReferenceDocument Reference Key
ReferenceDocumentLogicalSystem ReferenceDocumentLogicalSystem Ref. Doc. Lgcl Syst.
PaymentReason PaymentReason Payment Reason
BillOfExchangeUsageDocument BillOfExchangeUsageDocument
BOEUsageDocFiscalYear BOEUsageDocFiscalYear
BOEUsageDocLineItem BOEUsageDocLineItem
JointVenture JointVenture Joint venture
JointVentureCostRecoveryCode JointVentureCostRecoveryCode Recovery Ind.
JointVentureBillingType JointVentureBillingType
JointVentureCorporateEquityGrp JointVentureCorporateEquityGrp
_CompanyCode _CompanyCode
_PaymentDifferenceReason _PaymentDifferenceReason
_Creditor _Creditor
_Supplier _Supplier
_SupplierCompany _SupplierCompany
_JournalEntry _JournalEntry
_Customer _Customer
_CustomerCompany _CustomerCompany

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 P_APLineItem_2.
-- 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: PAPLINEITEM2
-- Parameters: P_KeyDate : vdm_v_key_date, P_TodayDate : abap.dats

CREATE VIEW P_APLineItem_2 AS
SELECT
  P_APLineItem_3.CompanyCode AS CompanyCode,
  P_APLineItem_3.AccountingDocument AS AccountingDocument,
  P_APLineItem_3.FiscalYear AS FiscalYear,
  P_APLineItem_3.AccountingDocumentItem AS AccountingDocumentItem,
  P_APLineItem_3.KEYDT2 AS KEYDT2,
  P_APLineItem_3.PaymentDifferenceReason AS PaymentDifferenceReason,
  P_APLineItem_3.Supplier AS Supplier,
  P_APLineItem_3.ClearingDate AS ClearingDate,
  P_APLineItem_3.ClearingDocFiscalYear AS ClearingDocFiscalYear,
  P_APLineItem_3.ClearingAccountingDocument AS ClearingAccountingDocument,
  P_APLineItem_3.PostingKey AS PostingKey,
  P_APLineItem_3.FinancialAccountType AS FinancialAccountType,
  P_APLineItem_3.SpecialGLCode AS SpecialGLCode,
  P_APLineItem_3.SpecialGLTransactionType AS SpecialGLTransactionType,
  P_APLineItem_3.DebitCreditCode AS DebitCreditCode,
  P_APLineItem_3.BusinessArea AS BusinessArea,
  P_APLineItem_3.TaxCode AS TaxCode,
  P_APLineItem_3.TaxCountry AS TaxCountry,
  P_APLineItem_3.TaxReportingDate AS TaxReportingDate,
  P_APLineItem_3.AmountInCompanyCodeCurrency AS AmountInCompanyCodeCurrency,
  P_APLineItem_3.AmountInTransactionCurrency AS AmountInTransactionCurrency,
  P_APLineItem_3.AmountInBalanceTransacCrcy AS AmountInBalanceTransacCrcy,
  P_APLineItem_3.BalanceTransactionCurrency AS BalanceTransactionCurrency,
  P_APLineItem_3.WithholdingTaxBaseAmount AS WithholdingTaxBaseAmount,
  P_APLineItem_3.ValuationDiffAmtInCoCodeCrcy AS ValuationDiffAmtInCoCodeCrcy,
  P_APLineItem_3.ValuationDiffAmtInAddlCrcy1 AS ValuationDiffAmtInAddlCrcy1,
  P_APLineItem_3.ValueDate AS ValueDate,
  P_APLineItem_3.AssignmentReference AS AssignmentReference,
  P_APLineItem_3.DocumentItemText AS DocumentItemText,
  P_APLineItem_3.PartnerCompany AS PartnerCompany,
  P_APLineItem_3.CostCenter AS CostCenter,
  P_APLineItem_3.OrderID AS OrderID,
  P_APLineItem_3.BillingDocument AS BillingDocument,
  P_APLineItem_3.SalesDocument AS SalesDocument,
  P_APLineItem_3.SalesDocumentItem AS SalesDocumentItem,
  P_APLineItem_3.ScheduleLine AS ScheduleLine,
  P_APLineItem_3.MasterFixedAsset AS MasterFixedAsset,
  P_APLineItem_3.FixedAsset AS FixedAsset,
  P_APLineItem_3.IsUsedInPaymentTransaction AS IsUsedInPaymentTransaction,
  P_APLineItem_3.GLAccount AS GLAccount,
  P_APLineItem_3.Branch AS Branch,
  P_APLineItem_3.DueCalculationBaseDate AS DueCalculationBaseDate,
  P_APLineItem_3.PaymentTerms AS PaymentTerms,
  P_APLineItem_3.CashDiscount1Days AS CashDiscount1Days,
  P_APLineItem_3.CashDiscount2Days AS CashDiscount2Days,
  P_APLineItem_3.NetPaymentDays AS NetPaymentDays,
  P_APLineItem_3.CashDiscount1Percent AS CashDiscount1Percent,
  P_APLineItem_3.CashDiscount2Percent AS CashDiscount2Percent,
  P_APLineItem_3.CashDiscountBaseAmount AS CashDiscountBaseAmount,
  P_APLineItem_3.CashDiscountAmtInCoCodeCrcy AS CashDiscountAmtInCoCodeCrcy,
  P_APLineItem_3.CashDiscountAmount AS CashDiscountAmount,
  P_APLineItem_3.PaymentMethod AS PaymentMethod,
  P_APLineItem_3.PaymentBlockingReason AS PaymentBlockingReason,
  P_APLineItem_3.FixedCashDiscount AS FixedCashDiscount,
  P_APLineItem_3.InvoiceReference AS InvoiceReference,
  P_APLineItem_3.FollowOnDocumentType AS FollowOnDocumentType,
  P_APLineItem_3.StateCentralBankPaymentReason AS StateCentralBankPaymentReason,
  P_APLineItem_3.SupplyingCountry AS SupplyingCountry,
  P_APLineItem_3.InvoiceList AS InvoiceList,
  P_APLineItem_3.BillOfExchangeUsage AS BillOfExchangeUsage,
  P_APLineItem_3.DunningKey AS DunningKey,
  P_APLineItem_3.DunningBlockingReason AS DunningBlockingReason,
  P_APLineItem_3.LastDunningDate AS LastDunningDate,
  P_APLineItem_3.DunningLevel AS DunningLevel,
  P_APLineItem_3.DunningArea AS DunningArea,
  P_APLineItem_3.WithholdingTaxAmount AS WithholdingTaxAmount,
  P_APLineItem_3.WithholdingTaxExemptionAmt AS WithholdingTaxExemptionAmt,
  P_APLineItem_3.Plant AS Plant,
  P_APLineItem_3.PurchasingDocument AS PurchasingDocument,
  P_APLineItem_3.PurchasingDocumentItem AS PurchasingDocumentItem,
  P_APLineItem_3.ProfitCenter AS ProfitCenter,
  P_APLineItem_3.TreasuryContractType AS TreasuryContractType,
  P_APLineItem_3.AssetContract AS AssetContract,
  P_APLineItem_3.CashFlowType AS CashFlowType,
  P_APLineItem_3.WBSElement AS WBSElement,
  P_APLineItem_3.AlternativeGLAccount AS AlternativeGLAccount,
  P_APLineItem_3.AmountInAdditionalCurrency1 AS AmountInAdditionalCurrency1,
  P_APLineItem_3.AmountInAdditionalCurrency2 AS AmountInAdditionalCurrency2,
  P_APLineItem_3.AmountInFunctionalCurrency AS AmountInFunctionalCurrency,
  P_APLineItem_3.ValuationDiffAmtInAddlCrcy2 AS ValuationDiffAmtInAddlCrcy2,
  P_APLineItem_3.ClearingIsReversed AS ClearingIsReversed,
  P_APLineItem_3.PaymentMethodSupplement AS PaymentMethodSupplement,
  P_APLineItem_3.Reference1IDByBusinessPartner AS Reference1IDByBusinessPartner,
  P_APLineItem_3.Reference2IDByBusinessPartner AS Reference2IDByBusinessPartner,
  P_APLineItem_3.PaymentCardItem AS PaymentCardItem,
  P_APLineItem_3.PaymentCardPaymentSettlement AS PaymentCardPaymentSettlement,
  P_APLineItem_3.CreditControlArea AS CreditControlArea,
  P_APLineItem_3.PayableAlternativePayee AS PayableAlternativePayee,
  P_APLineItem_3.Reference3IDByBusinessPartner AS Reference3IDByBusinessPartner,
  P_APLineItem_3.DataExchangeInstruction1 AS DataExchangeInstruction1,
  P_APLineItem_3.DataExchangeInstruction2 AS DataExchangeInstruction2,
  P_APLineItem_3.DataExchangeInstruction3 AS DataExchangeInstruction3,
  P_APLineItem_3.DataExchangeInstruction4 AS DataExchangeInstruction4,
  P_APLineItem_3.HasPaymentOrder AS HasPaymentOrder,
  P_APLineItem_3.PaymentReference AS PaymentReference,
  P_APLineItem_3.HedgedAmount AS HedgedAmount,
  P_APLineItem_3.PaymentCurrency AS PaymentCurrency,
  P_APLineItem_3.AmountInPaymentCurrency AS AmountInPaymentCurrency,
  P_APLineItem_3.BusinessPlace AS BusinessPlace,
  P_APLineItem_3.TaxSection AS TaxSection,
  P_APLineItem_3.AccountsReceivableIsPledged AS AccountsReceivableIsPledged,
  P_APLineItem_3.RealEstateObject AS RealEstateObject,
  P_APLineItem_3.FundsCenter AS FundsCenter,
  P_APLineItem_3.SettlementReferenceDate AS SettlementReferenceDate,
  P_APLineItem_3.IsSalesRelated AS IsSalesRelated,
  P_APLineItem_3.PostingDate AS PostingDate,
  P_APLineItem_3.AccountingDocumentCategory AS AccountingDocumentCategory,
  P_APLineItem_3.FiscalPeriod AS FiscalPeriod,
  P_APLineItem_3.DocumentDate AS DocumentDate,
  P_APLineItem_3.AccountingDocumentType AS AccountingDocumentType,
  P_APLineItem_3.TransactionCurrency AS TransactionCurrency,
  P_APLineItem_3.PlannedAmtInTransactionCrcy AS PlannedAmtInTransactionCrcy,
  P_APLineItem_3.NetDueDate AS NetDueDate,
  P_APLineItem_3.CashDiscount1DueDate AS CashDiscount1DueDate,
  P_APLineItem_3.SourceCompanyCode AS SourceCompanyCode,
  P_APLineItem_3.DocumentReferenceID AS DocumentReferenceID,
  P_APLineItem_3.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  P_APLineItem_3.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  P_APLineItem_3.AdditionalCurrency1 AS AdditionalCurrency1,
  P_APLineItem_3.AdditionalCurrency2 AS AdditionalCurrency2,
  P_APLineItem_3.FunctionalCurrency AS FunctionalCurrency,
  P_APLineItem_3.OffsettingAccount AS OffsettingAccount,
  P_APLineItem_3.OffsettingAccountType AS OffsettingAccountType,
  AccDocumentType.AuthorizationGroup AS AcctgDocTypeAuthorizationGroup,
  P_APLineItem_3.ITEM_TYPE_BRANCH AS ITEM_TYPE_BRANCH,
  P_APLineItem_3.DocumentIsArchived AS DocumentIsArchived,
  P_APLineItem_3.TargetTaxCode AS TargetTaxCode,
  P_APLineItem_3.DPNOTDUE AS DPNOTDUE,
  P_APLineItem_3.CompanyCodeCurrency AS CompanyCodeCurrency,
  P_APLineItem_3.BPBankAccountInternalID AS BPBankAccountInternalID,
  P_APLineItem_3.HouseBank AS HouseBank,
  P_APLineItem_3.HouseBankAccount AS HouseBankAccount,
  P_APLineItem_3.Debtor AS Debtor,
  AdditionalCurrency1Role,
  AdditionalCurrency2Role,
  BranchCode,
  ReferenceDocumentType,
  OriginalReferenceDocument,
  ReferenceDocumentLogicalSystem,
  PaymentReason,
  BillOfExchangeUsageDocument,
  BOEUsageDocFiscalYear,
  BOEUsageDocLineItem,
  JointVenture,
  JointVentureCostRecoveryCode,
  JointVentureBillingType,
  JointVentureCorporateEquityGrp
FROM P_APLineItem_3
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [1..1]
LEFT OUTER JOIN I_PaymentDifferenceReason AS _PaymentDifferenceReason ON CompanyCode = _PaymentDifferenceReason.CompanyCode AND PaymentDifferenceReason = _PaymentDifferenceReason.PaymentDifferenceReason  -- association [0..1]
LEFT OUTER JOIN lfa1 AS _Creditor ON Supplier = _Creditor.lifnr  -- association [1..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [1..1]
LEFT OUTER JOIN I_SupplierCompany AS _SupplierCompany ON CompanyCode = _SupplierCompany.CompanyCode AND Supplier = _SupplierCompany.Supplier  -- association [1..1]
LEFT OUTER JOIN I_JournalEntry AS _JournalEntry ON AccountingDocument = _JournalEntry.AccountingDocument AND CompanyCode = _JournalEntry.CompanyCode AND FiscalYear = _JournalEntry.FiscalYear  -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Debtor = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_CustomerCompany AS _CustomerCompany ON CompanyCode = _CustomerCompany.CompanyCode AND Debtor = _CustomerCompany.Customer  -- association [0..1]
;