P_APLineItem_1

DDL: P_APLINEITEM_1 SQL: PAPLINEITEM1 Type: view COMPOSITE

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

Data Sources (1)

SourceAliasJoin Type
P_APLineItem_2 P_APLineItem_2 from

Parameters (3)

NameTypeDefault
P_KEYDATE vdm_v_key_date
P_TodayDate abap.dats
P_Language sylangu

Associations (2)

CardinalityTargetAliasCondition
[0..1] t016t _IndustryName $projection.SupplierIndustry = _IndustryName.brsch and $projection.Language = _IndustryName.spras
[0..1] I_RegionText _RegionText $projection.SupplierCountry = _RegionText.Country and $projection.SupplierRegion = _RegionText.Region and $projection.Language = _RegionText.Language

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PAPLINEITEM1 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 (204)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_APLineItem_2 CompanyCode Receiver Company Code
KEY AccountingDocument P_APLineItem_2 AccountingDocument Journal Entry
KEY FiscalYear P_APLineItem_2 FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem P_APLineItem_2 AccountingDocumentItem Posting View Item
Language
KEYDT2 P_APLineItem_2 KEYDT2
PaymentDifferenceReason P_APLineItem_2 PaymentDifferenceReason Reason Code
Supplier P_APLineItem_2 Supplier Supplier
ClearingDate P_APLineItem_2 ClearingDate Clearing Date
ClearingDocFiscalYear P_APLineItem_2 ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
ClearingAccountingDocument P_APLineItem_2 ClearingAccountingDocument Clearing Journal Entry
PostingKey P_APLineItem_2 PostingKey Posting Key
FinancialAccountType P_APLineItem_2 FinancialAccountType Fin. Account Type
SpecialGLCode P_APLineItem_2 SpecialGLCode Special G/L Ind
SpecialGLTransactionType P_APLineItem_2 SpecialGLTransactionType Transact.Type
DebitCreditCode P_APLineItem_2 DebitCreditCode Single-Character Flag
BusinessArea P_APLineItem_2 BusinessArea Business Area
TaxCode P_APLineItem_2 TaxCode Tax Code
TaxCountry P_APLineItem_2 TaxCountry Tax Ctry/Reg.
TaxReportingDate P_APLineItem_2 TaxReportingDate Tax Reporting Date
AmountInCompanyCodeCurrency P_APLineItem_2 AmountInCompanyCodeCurrency Local Crcy Amt
AmountInTransactionCurrency P_APLineItem_2 AmountInTransactionCurrency Pt Crcy Amt
AmountInBalanceTransacCrcy P_APLineItem_2 AmountInBalanceTransacCrcy Amount in Balance Transaction Currency
BalanceTransactionCurrency P_APLineItem_2 BalanceTransactionCurrency Currency
WithholdingTaxBaseAmount P_APLineItem_2 WithholdingTaxBaseAmount WTax Base Amt
ValuationDiffAmtInCoCodeCrcy P_APLineItem_2 ValuationDiffAmtInCoCodeCrcy
ValuationDiffAmtInAddlCrcy1 P_APLineItem_2 ValuationDiffAmtInAddlCrcy1
ValueDate P_APLineItem_2 ValueDate Value Date
AssignmentReference P_APLineItem_2 AssignmentReference Assignment Reference
DocumentItemText P_APLineItem_2 DocumentItemText Text
PartnerCompany P_APLineItem_2 PartnerCompany Trading Partner
CostCenter P_APLineItem_2 CostCenter Cost Center
OrderID P_APLineItem_2 OrderID Order ID
BillingDocument P_APLineItem_2 BillingDocument SD Document
SalesDocument P_APLineItem_2 SalesDocument SD Document
SalesDocumentItem P_APLineItem_2 SalesDocumentItem Sales Document Item
ScheduleLine P_APLineItem_2 ScheduleLine Schedule Line
MasterFixedAsset P_APLineItem_2 MasterFixedAsset Fixed Asset
FixedAsset P_APLineItem_2 FixedAsset Sub-number
IsUsedInPaymentTransaction P_APLineItem_2 IsUsedInPaymentTransaction Is Used In Payment Transaction
GLAccount P_APLineItem_2 GLAccount General Ledger
Branch P_APLineItem_2 Branch Repository branch
DueCalculationBaseDate P_APLineItem_2 DueCalculationBaseDate Due Calculation Base Date
PaymentTerms P_APLineItem_2 PaymentTerms Pyt Terms
CashDiscount1Days P_APLineItem_2 CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days P_APLineItem_2 CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays P_APLineItem_2 NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent P_APLineItem_2 CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent P_APLineItem_2 CashDiscount2Percent Disc. Percent 2
CashDiscountBaseAmount P_APLineItem_2 CashDiscountBaseAmount Cash Dscnt Base Amt
CashDiscountAmtInCoCodeCrcy P_APLineItem_2 CashDiscountAmtInCoCodeCrcy Discount Amt
CashDiscountAmount P_APLineItem_2 CashDiscountAmount CD Amount
PaymentMethod P_APLineItem_2 PaymentMethod Pymt Meth.
PaymentBlockingReason P_APLineItem_2 PaymentBlockingReason Pmnt block
FixedCashDiscount P_APLineItem_2 FixedCashDiscount Fixed Cash Discount
FollowOnDocumentType P_APLineItem_2 FollowOnDocumentType Follow-On Document Type
StateCentralBankPaymentReason P_APLineItem_2 StateCentralBankPaymentReason SCB Ind.
SupplyingCountry P_APLineItem_2 SupplyingCountry Supplying Ctry/Reg.
InvoiceList P_APLineItem_2 InvoiceList Invoice List
BillOfExchangeUsage P_APLineItem_2 BillOfExchangeUsage BoE Usage
DunningKey P_APLineItem_2 DunningKey Dunning Key
DunningBlockingReason P_APLineItem_2 DunningBlockingReason Set Dunning Block
LastDunningDate P_APLineItem_2 LastDunningDate Last Dunned
DunningLevel P_APLineItem_2 DunningLevel Dunning Level
DunningArea P_APLineItem_2 DunningArea Dunning Area
WithholdingTaxAmount P_APLineItem_2 WithholdingTaxAmount Withholding Tax Amt
WithholdingTaxExemptionAmt P_APLineItem_2 WithholdingTaxExemptionAmt WTax-Exempt
Plant P_APLineItem_2 Plant Valuation Area
PurchasingDocument P_APLineItem_2 PurchasingDocument Purchasing Document
PurchasingDocumentItem P_APLineItem_2 PurchasingDocumentItem Purchasing Doc. Item
ProfitCenter P_APLineItem_2 ProfitCenter Profit Center
TreasuryContractType P_APLineItem_2 TreasuryContractType Treasury Contract Type
AssetContract P_APLineItem_2 AssetContract Asset Contract
CashFlowType P_APLineItem_2 CashFlowType Flow Type
WBSElement P_APLineItem_2 WBSElement WBS Internal ID
AlternativeGLAccount P_APLineItem_2 AlternativeGLAccount Group Account
AmountInAdditionalCurrency1 P_APLineItem_2 AmountInAdditionalCurrency1 Amount in Additional Currency 1
AmountInAdditionalCurrency2 P_APLineItem_2 AmountInAdditionalCurrency2 LC2 Amount
AmountInFunctionalCurrency P_APLineItem_2 AmountInFunctionalCurrency Amount in Functional Currency
ValuationDiffAmtInAddlCrcy2 P_APLineItem_2 ValuationDiffAmtInAddlCrcy2
ClearingIsReversed P_APLineItem_2 ClearingIsReversed Clearing Is Reversed
PaymentMethodSupplement P_APLineItem_2 PaymentMethodSupplement Pmnt Meth. Sup.
Reference1IDByBusinessPartner P_APLineItem_2 Reference1IDByBusinessPartner Reference Key 1
Reference2IDByBusinessPartner P_APLineItem_2 Reference2IDByBusinessPartner Reference Key 2
PaymentCardItem P_APLineItem_2 PaymentCardItem Payment Card Item
PaymentCardPaymentSettlement P_APLineItem_2 PaymentCardPaymentSettlement Payment Card Payment Settlement
Reference3IDByBusinessPartner P_APLineItem_2 Reference3IDByBusinessPartner Reference Key 3
DataExchangeInstruction1 P_APLineItem_2 DataExchangeInstruction1 Instruction 1
DataExchangeInstruction2 P_APLineItem_2 DataExchangeInstruction2 Instruction 2
DataExchangeInstruction3 P_APLineItem_2 DataExchangeInstruction3 Instruction 3
DataExchangeInstruction4 P_APLineItem_2 DataExchangeInstruction4 Instruction 4
HasPaymentOrder P_APLineItem_2 HasPaymentOrder Payment Sent
PaymentReference P_APLineItem_2 PaymentReference Payment Reference
HedgedAmount P_APLineItem_2 HedgedAmount
PaymentCurrency P_APLineItem_2 PaymentCurrency Payment Currency
AmountInPaymentCurrency P_APLineItem_2 AmountInPaymentCurrency Amount in Payment Currency
BusinessPlace P_APLineItem_2 BusinessPlace Business place
TaxSection P_APLineItem_2 TaxSection Tax Section
AccountsReceivableIsPledged P_APLineItem_2 AccountsReceivableIsPledged Accounts Receivable Is Pledged
RealEstateObject P_APLineItem_2 RealEstateObject Real Estate Key
FundsCenter P_APLineItem_2 FundsCenter Funds Center
SettlementReferenceDate P_APLineItem_2 SettlementReferenceDate Reference date
IsSalesRelated P_APLineItem_2 IsSalesRelated Is Sales Related
PostingDate P_APLineItem_2 PostingDate Posting Date for GR
AccountingDocumentCategory P_APLineItem_2 AccountingDocumentCategory Journal Entry Category
FiscalPeriod P_APLineItem_2 FiscalPeriod Tax period
DocumentDate P_APLineItem_2 DocumentDate Journal Entry Date
AccountingDocumentType P_APLineItem_2 AccountingDocumentType Journal Entry Type
TransactionCurrency P_APLineItem_2 TransactionCurrency Transaction Currency
PlannedAmtInTransactionCrcy P_APLineItem_2 PlannedAmtInTransactionCrcy Plnd Amt Trans. Crcy
NetDueDate P_APLineItem_2 NetDueDate Net Due Date
CashDiscount1DueDate P_APLineItem_2 CashDiscount1DueDate Cash Discount 1
SourceCompanyCode P_APLineItem_2 SourceCompanyCode
DocumentReferenceID P_APLineItem_2 DocumentReferenceID Reference
AccountingDocumentCreationDate P_APLineItem_2 AccountingDocumentCreationDate Journal Entry Date
AccountingDocCreatedByUser P_APLineItem_2 AccountingDocCreatedByUser User which created overhead document
AdditionalCurrency1 P_APLineItem_2 AdditionalCurrency1 Local curr. 2
AdditionalCurrency2 P_APLineItem_2 AdditionalCurrency2 Local curr. 3
FunctionalCurrency P_APLineItem_2 FunctionalCurrency Functional Currency
OffsettingAccount P_APLineItem_2 OffsettingAccount Offsetting Acct
OffsettingAccountType P_APLineItem_2 OffsettingAccountType Offset Acct Type
ITEM_TYPE_BRANCH P_APLineItem_2 ITEM_TYPE_BRANCH
DPNOTDUE P_APLineItem_2 DPNOTDUE
DocumentIsArchived P_APLineItem_2 DocumentIsArchived
TargetTaxCode P_APLineItem_2 TargetTaxCode
KeyDate P_APLineItem_2 KeyDate Maturity Key Date
CompanyCodeCurrency P_APLineItem_2 CompanyCodeCurrency Local Currency
AcctgDocTypeAuthorizationGroup P_APLineItem_2 AcctgDocTypeAuthorizationGroup AuthorizGroup
BPBankAccountInternalID P_APLineItem_2 BPBankAccountInternalID BP Bank Account
HouseBank P_APLineItem_2 HouseBank House Bank
HouseBankAccount P_APLineItem_2 HouseBankAccount House Bank Account
PayableAlternativePayee P_APLineItem_2 PayableAlternativePayee
AlternativePayeeIsAllowed _Creditor xzemp Payee in doc.
SupplierSearchText _Supplier SortField Sort Field
SupplierName _Supplier SupplierName Supplier Name
SupplierIndustry _Supplier Industry Industry Sector
SupplierCreationDate _Supplier CreationDate Time Stamp
SupplierCreatedByUser _Supplier CreatedByUser User Name
SupplierCorporateGroup _Supplier SupplierCorporateGroup Group
SupplierAccountGroup _Supplier SupplierAccountGroup Account group
Customer _Supplier Customer Sold-to Party
PostingIsBlockedForSupplier _Supplier PostingIsBlocked Posting Block
SupplierTaxID1 _Supplier TaxNumber1 VAT Reg. No.
SupplierTaxID2 _Supplier TaxNumber2 Tax Number 2
SupplierTaxID3 _Supplier TaxNumber3
SupplierTaxID4 _Supplier TaxNumber4
SupplierTaxID5 _Supplier TaxNumber5
SupplierIsOneTimeAccount _Supplier IsOneTimeAccount One-time acct
SupplierVATRegistration _Supplier VATRegistration VAT Registration No.
SupplierTaxJurisdiction _Supplier TaxJurisdiction Tax Jurisdiction
SupplierCountry
SupplierCityName
SupplierPOBox
SupplierPOBoxPostalCode
SupplierPostalCode
SupplierRegion
AccountingClerk _SupplierCompany AccountingClerk Clerk Abbrev.
ReconciliationAccount _SupplierCompany ReconciliationAccount Recon. account
InterestCalculationCode _SupplierCompany InterestCalculationCode Interest Indic.
SupplierHeadOffice _SupplierCompany SupplierHeadOffice Head Office
AlternativePayee _SupplierCompany AlternativePayee Alternat.payee
SupplierPaymentBlockingReason _SupplierCompany PaymentBlockingReason Pmnt block
InterestCalculationDate _SupplierCompany InterestCalculationDate Last Key Date
IntrstCalcFrequencyInMonths _SupplierCompany IntrstCalcFrequencyInMonths Int.Calc.Freq.
APARToleranceGroup _SupplierCompany APARToleranceGroup Tolerance Group
ItemIsToBePaidSeparately _SupplierCompany ItemIsToBePaidSeparately Individual Payt
PaymentIsToBeSentByEDI _SupplierCompany PaymentIsToBeSentByEDI Pmt adv. by EDI
SupplierAccountNote _SupplierCompany SupplierAccountNote Account Memo
SupplierBasicAuthorizationGrp _Supplier AuthorizationGroup AuthorizGroup
SupplierFinsAuthorizationGrp _SupplierCompany AuthorizationGroup AuthorizGroup
CompanyCodeName _CompanyCode CompanyCodeName Company Name
IsDisputed _PaymentDifferenceReason IsDisputed
SupplierendasCustomerSupplierAccount
InvoiceReferenceendasInvoiceReference
FiscalYearPeriod
CreditControlAreaendasCreditControlArea
dec70endendasNetDueArrearsDays
dec70endendasCashDiscount1ArrearsDays
zfbdt_today
ValuatedAmtInCompanyCodeCrcy
ValuatedAmtInAdditionalCrcy1
ValuatedAmtInAdditionalCrcy2
Debtor P_APLineItem_2 Debtor Debtor
AdditionalCurrency1Role AdditionalCurrency1Role LC2 Crcy Type
AdditionalCurrency2Role AdditionalCurrency2Role LC3 Crcy Type
BranchCode P_APLineItem_2 BranchCode Branch Code
ReferenceDocumentType P_APLineItem_2 ReferenceDocumentType Reference Document Type
OriginalReferenceDocument P_APLineItem_2 OriginalReferenceDocument Reference Key
ReferenceDocumentLogicalSystem P_APLineItem_2 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
_IndustryName _IndustryName
_RegionText _RegionText
_JournalEntry _JournalEntry
_Customer _Customer
_CustomerCompany _CustomerCompany
_Supplier _Supplier
_SupplierCompany _SupplierCompany

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_1.
-- 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: PAPLINEITEM1
-- Parameters: P_KEYDATE : vdm_v_key_date, P_TodayDate : abap.dats, P_Language : sylangu

CREATE VIEW P_APLineItem_1 AS
SELECT
  P_APLineItem_2.CompanyCode AS CompanyCode,
  P_APLineItem_2.AccountingDocument AS AccountingDocument,
  P_APLineItem_2.FiscalYear AS FiscalYear,
  P_APLineItem_2.AccountingDocumentItem AS AccountingDocumentItem,
  :P_Language AS Language,
  P_APLineItem_2.KEYDT2 AS KEYDT2,
  P_APLineItem_2.PaymentDifferenceReason AS PaymentDifferenceReason,
  P_APLineItem_2.Supplier AS Supplier,
  P_APLineItem_2.ClearingDate AS ClearingDate,
  P_APLineItem_2.ClearingDocFiscalYear AS ClearingDocFiscalYear,
  P_APLineItem_2.ClearingAccountingDocument AS ClearingAccountingDocument,
  P_APLineItem_2.PostingKey AS PostingKey,
  P_APLineItem_2.FinancialAccountType AS FinancialAccountType,
  P_APLineItem_2.SpecialGLCode AS SpecialGLCode,
  P_APLineItem_2.SpecialGLTransactionType AS SpecialGLTransactionType,
  P_APLineItem_2.DebitCreditCode AS DebitCreditCode,
  P_APLineItem_2.BusinessArea AS BusinessArea,
  P_APLineItem_2.TaxCode AS TaxCode,
  P_APLineItem_2.TaxCountry AS TaxCountry,
  P_APLineItem_2.TaxReportingDate AS TaxReportingDate,
  P_APLineItem_2.AmountInCompanyCodeCurrency AS AmountInCompanyCodeCurrency,
  P_APLineItem_2.AmountInTransactionCurrency AS AmountInTransactionCurrency,
  P_APLineItem_2.AmountInBalanceTransacCrcy AS AmountInBalanceTransacCrcy,
  P_APLineItem_2.BalanceTransactionCurrency AS BalanceTransactionCurrency,
  P_APLineItem_2.WithholdingTaxBaseAmount AS WithholdingTaxBaseAmount,
  P_APLineItem_2.ValuationDiffAmtInCoCodeCrcy AS ValuationDiffAmtInCoCodeCrcy,
  P_APLineItem_2.ValuationDiffAmtInAddlCrcy1 AS ValuationDiffAmtInAddlCrcy1,
  P_APLineItem_2.ValueDate AS ValueDate,
  P_APLineItem_2.AssignmentReference AS AssignmentReference,
  P_APLineItem_2.DocumentItemText AS DocumentItemText,
  P_APLineItem_2.PartnerCompany AS PartnerCompany,
  P_APLineItem_2.CostCenter AS CostCenter,
  P_APLineItem_2.OrderID AS OrderID,
  P_APLineItem_2.BillingDocument AS BillingDocument,
  P_APLineItem_2.SalesDocument AS SalesDocument,
  P_APLineItem_2.SalesDocumentItem AS SalesDocumentItem,
  P_APLineItem_2.ScheduleLine AS ScheduleLine,
  P_APLineItem_2.MasterFixedAsset AS MasterFixedAsset,
  P_APLineItem_2.FixedAsset AS FixedAsset,
  P_APLineItem_2.IsUsedInPaymentTransaction AS IsUsedInPaymentTransaction,
  P_APLineItem_2.GLAccount AS GLAccount,
  P_APLineItem_2.Branch AS Branch,
  P_APLineItem_2.DueCalculationBaseDate AS DueCalculationBaseDate,
  P_APLineItem_2.PaymentTerms AS PaymentTerms,
  P_APLineItem_2.CashDiscount1Days AS CashDiscount1Days,
  P_APLineItem_2.CashDiscount2Days AS CashDiscount2Days,
  P_APLineItem_2.NetPaymentDays AS NetPaymentDays,
  P_APLineItem_2.CashDiscount1Percent AS CashDiscount1Percent,
  P_APLineItem_2.CashDiscount2Percent AS CashDiscount2Percent,
  P_APLineItem_2.CashDiscountBaseAmount AS CashDiscountBaseAmount,
  P_APLineItem_2.CashDiscountAmtInCoCodeCrcy AS CashDiscountAmtInCoCodeCrcy,
  P_APLineItem_2.CashDiscountAmount AS CashDiscountAmount,
  P_APLineItem_2.PaymentMethod AS PaymentMethod,
  P_APLineItem_2.PaymentBlockingReason AS PaymentBlockingReason,
  P_APLineItem_2.FixedCashDiscount AS FixedCashDiscount,
  P_APLineItem_2.FollowOnDocumentType AS FollowOnDocumentType,
  P_APLineItem_2.StateCentralBankPaymentReason AS StateCentralBankPaymentReason,
  P_APLineItem_2.SupplyingCountry AS SupplyingCountry,
  P_APLineItem_2.InvoiceList AS InvoiceList,
  P_APLineItem_2.BillOfExchangeUsage AS BillOfExchangeUsage,
  P_APLineItem_2.DunningKey AS DunningKey,
  P_APLineItem_2.DunningBlockingReason AS DunningBlockingReason,
  P_APLineItem_2.LastDunningDate AS LastDunningDate,
  P_APLineItem_2.DunningLevel AS DunningLevel,
  P_APLineItem_2.DunningArea AS DunningArea,
  P_APLineItem_2.WithholdingTaxAmount AS WithholdingTaxAmount,
  P_APLineItem_2.WithholdingTaxExemptionAmt AS WithholdingTaxExemptionAmt,
  P_APLineItem_2.Plant AS Plant,
  P_APLineItem_2.PurchasingDocument AS PurchasingDocument,
  P_APLineItem_2.PurchasingDocumentItem AS PurchasingDocumentItem,
  P_APLineItem_2.ProfitCenter AS ProfitCenter,
  P_APLineItem_2.TreasuryContractType AS TreasuryContractType,
  P_APLineItem_2.AssetContract AS AssetContract,
  P_APLineItem_2.CashFlowType AS CashFlowType,
  P_APLineItem_2.WBSElement AS WBSElement,
  P_APLineItem_2.AlternativeGLAccount AS AlternativeGLAccount,
  P_APLineItem_2.AmountInAdditionalCurrency1 AS AmountInAdditionalCurrency1,
  P_APLineItem_2.AmountInAdditionalCurrency2 AS AmountInAdditionalCurrency2,
  P_APLineItem_2.AmountInFunctionalCurrency AS AmountInFunctionalCurrency,
  P_APLineItem_2.ValuationDiffAmtInAddlCrcy2 AS ValuationDiffAmtInAddlCrcy2,
  P_APLineItem_2.ClearingIsReversed AS ClearingIsReversed,
  P_APLineItem_2.PaymentMethodSupplement AS PaymentMethodSupplement,
  P_APLineItem_2.Reference1IDByBusinessPartner AS Reference1IDByBusinessPartner,
  P_APLineItem_2.Reference2IDByBusinessPartner AS Reference2IDByBusinessPartner,
  P_APLineItem_2.PaymentCardItem AS PaymentCardItem,
  P_APLineItem_2.PaymentCardPaymentSettlement AS PaymentCardPaymentSettlement,
  P_APLineItem_2.Reference3IDByBusinessPartner AS Reference3IDByBusinessPartner,
  P_APLineItem_2.DataExchangeInstruction1 AS DataExchangeInstruction1,
  P_APLineItem_2.DataExchangeInstruction2 AS DataExchangeInstruction2,
  P_APLineItem_2.DataExchangeInstruction3 AS DataExchangeInstruction3,
  P_APLineItem_2.DataExchangeInstruction4 AS DataExchangeInstruction4,
  P_APLineItem_2.HasPaymentOrder AS HasPaymentOrder,
  P_APLineItem_2.PaymentReference AS PaymentReference,
  P_APLineItem_2.HedgedAmount AS HedgedAmount,
  P_APLineItem_2.PaymentCurrency AS PaymentCurrency,
  P_APLineItem_2.AmountInPaymentCurrency AS AmountInPaymentCurrency,
  P_APLineItem_2.BusinessPlace AS BusinessPlace,
  P_APLineItem_2.TaxSection AS TaxSection,
  P_APLineItem_2.AccountsReceivableIsPledged AS AccountsReceivableIsPledged,
  P_APLineItem_2.RealEstateObject AS RealEstateObject,
  P_APLineItem_2.FundsCenter AS FundsCenter,
  P_APLineItem_2.SettlementReferenceDate AS SettlementReferenceDate,
  P_APLineItem_2.IsSalesRelated AS IsSalesRelated,
  P_APLineItem_2.PostingDate AS PostingDate,
  P_APLineItem_2.AccountingDocumentCategory AS AccountingDocumentCategory,
  P_APLineItem_2.FiscalPeriod AS FiscalPeriod,
  P_APLineItem_2.DocumentDate AS DocumentDate,
  P_APLineItem_2.AccountingDocumentType AS AccountingDocumentType,
  P_APLineItem_2.TransactionCurrency AS TransactionCurrency,
  P_APLineItem_2.PlannedAmtInTransactionCrcy AS PlannedAmtInTransactionCrcy,
  P_APLineItem_2.NetDueDate AS NetDueDate,
  P_APLineItem_2.CashDiscount1DueDate AS CashDiscount1DueDate,
  P_APLineItem_2.SourceCompanyCode AS SourceCompanyCode,
  P_APLineItem_2.DocumentReferenceID AS DocumentReferenceID,
  P_APLineItem_2.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  P_APLineItem_2.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  P_APLineItem_2.AdditionalCurrency1 AS AdditionalCurrency1,
  P_APLineItem_2.AdditionalCurrency2 AS AdditionalCurrency2,
  P_APLineItem_2.FunctionalCurrency AS FunctionalCurrency,
  P_APLineItem_2.OffsettingAccount AS OffsettingAccount,
  P_APLineItem_2.OffsettingAccountType AS OffsettingAccountType,
  P_APLineItem_2.ITEM_TYPE_BRANCH AS ITEM_TYPE_BRANCH,
  P_APLineItem_2.DPNOTDUE AS DPNOTDUE,
  P_APLineItem_2.DocumentIsArchived AS DocumentIsArchived,
  P_APLineItem_2.TargetTaxCode AS TargetTaxCode,
  P_APLineItem_2.KeyDate AS KeyDate,
  P_APLineItem_2.CompanyCodeCurrency AS CompanyCodeCurrency,
  P_APLineItem_2.AcctgDocTypeAuthorizationGroup AS AcctgDocTypeAuthorizationGroup,
  P_APLineItem_2.BPBankAccountInternalID AS BPBankAccountInternalID,
  P_APLineItem_2.HouseBank AS HouseBank,
  P_APLineItem_2.HouseBankAccount AS HouseBankAccount,
  P_APLineItem_2.PayableAlternativePayee AS PayableAlternativePayee,
  _Creditor.xzemp AS AlternativePayeeIsAllowed,
  _Supplier.SortField AS SupplierSearchText,
  _Supplier.SupplierName AS SupplierName,
  _Supplier.Industry AS SupplierIndustry,
  _Supplier.CreationDate AS SupplierCreationDate,
  _Supplier.CreatedByUser AS SupplierCreatedByUser,
  _Supplier.SupplierCorporateGroup AS SupplierCorporateGroup,
  _Supplier.SupplierAccountGroup AS SupplierAccountGroup,
  _Supplier.Customer AS Customer,
  _Supplier.PostingIsBlocked AS PostingIsBlockedForSupplier,
  _Supplier.TaxNumber1 AS SupplierTaxID1,
  _Supplier.TaxNumber2 AS SupplierTaxID2,
  _Supplier.TaxNumber3 AS SupplierTaxID3,
  _Supplier.TaxNumber4 AS SupplierTaxID4,
  _Supplier.TaxNumber5 AS SupplierTaxID5,
  _Supplier.IsOneTimeAccount AS SupplierIsOneTimeAccount,
  _Supplier.VATRegistration AS SupplierVATRegistration,
  _Supplier.TaxJurisdiction AS SupplierTaxJurisdiction,
  _Supplier._StandardAddress.Country AS SupplierCountry,
  _Supplier._StandardAddress.CityName AS SupplierCityName,
  _Supplier._StandardAddress.POBox AS SupplierPOBox,
  _Supplier._StandardAddress.POBoxPostalCode AS SupplierPOBoxPostalCode,
  _Supplier._StandardAddress.PostalCode AS SupplierPostalCode,
  _Supplier._StandardAddress.Region AS SupplierRegion,
  _SupplierCompany.AccountingClerk AS AccountingClerk,
  _SupplierCompany.ReconciliationAccount AS ReconciliationAccount,
  _SupplierCompany.InterestCalculationCode AS InterestCalculationCode,
  _SupplierCompany.SupplierHeadOffice AS SupplierHeadOffice,
  _SupplierCompany.AlternativePayee AS AlternativePayee,
  _SupplierCompany.PaymentBlockingReason AS SupplierPaymentBlockingReason,
  _SupplierCompany.InterestCalculationDate AS InterestCalculationDate,
  _SupplierCompany.IntrstCalcFrequencyInMonths AS IntrstCalcFrequencyInMonths,
  _SupplierCompany.APARToleranceGroup AS APARToleranceGroup,
  _SupplierCompany.ItemIsToBePaidSeparately AS ItemIsToBePaidSeparately,
  _SupplierCompany.PaymentIsToBeSentByEDI AS PaymentIsToBeSentByEDI,
  _SupplierCompany.SupplierAccountNote AS SupplierAccountNote,
  _Supplier.AuthorizationGroup AS SupplierBasicAuthorizationGrp,
  _SupplierCompany.AuthorizationGroup AS SupplierFinsAuthorizationGrp,
  _CompanyCode.CompanyCodeName AS CompanyCodeName,
  _PaymentDifferenceReason.IsDisputed AS IsDisputed,
  case when P_APLineItem_2.FinancialAccountType = 'D' then P_APLineItem_2._Supplier.Customer else P_APLineItem_2.Supplier end as CustomerSupplierAccount AS SupplierendasCustomerSupplierAccount,
  case when P_APLineItem_2.InvoiceReference = '' and P_APLineItem_2.FollowOnDocumentType = '' then P_APLineItem_2.AccountingDocument else P_APLineItem_2.InvoiceReference end as InvoiceReference AS InvoiceReferenceendasInvoiceReference,
  concat(P_APLineItem_2.FiscalYear, P_APLineItem_2.FiscalPeriod) AS FiscalYearPeriod,
  case when P_APLineItem_2.CreditControlArea != '' then P_APLineItem_2.CreditControlArea else _CompanyCode.CreditControlArea end as CreditControlArea AS CreditControlAreaendasCreditControlArea,
  case when P_APLineItem_2.DPNOTDUE = 'X' then 0 else case when P_APLineItem_2.ClearingDate > '00000000' and P_APLineItem_2.ClearingDate < KeyDate then cast( dats_days_between(P_APLineItem_2.NetDueDate, P_APLineItem_2.ClearingDate) as abap.dec(7,0) ) else cast( dats_days_between(P_APLineItem_2.NetDueDate, KeyDate) as abap.dec(7,0) ) end end as NetDueArrearsDays AS dec70endendasNetDueArrearsDays,
  case when P_APLineItem_2.DPNOTDUE = 'X' then 0 else case when P_APLineItem_2.ClearingDate > '00000000' and P_APLineItem_2.ClearingDate < KeyDate then cast( dats_days_between(P_APLineItem_2.CashDiscount1DueDate, P_APLineItem_2.ClearingDate) as abap.dec(7,0) ) else cast( dats_days_between(P_APLineItem_2.CashDiscount1DueDate, KeyDate) as abap.dec(7,0) ) end end as CashDiscount1ArrearsDays AS dec70endendasCashDiscount1ArrearsDays,
  dats_days_between(P_APLineItem_2.DueCalculationBaseDate, :P_TodayDate) AS zfbdt_today,
  P_APLineItem_2.AmountInCompanyCodeCurrency + P_APLineItem_2.ValuationDiffAmtInCoCodeCrcy AS ValuatedAmtInCompanyCodeCrcy,
  P_APLineItem_2.AmountInAdditionalCurrency1 + P_APLineItem_2.ValuationDiffAmtInAddlCrcy1 AS ValuatedAmtInAdditionalCrcy1,
  P_APLineItem_2.AmountInAdditionalCurrency2 + P_APLineItem_2.ValuationDiffAmtInAddlCrcy2 AS ValuatedAmtInAdditionalCrcy2,
  P_APLineItem_2.Debtor AS Debtor,
  AdditionalCurrency1Role,
  AdditionalCurrency2Role,
  P_APLineItem_2.BranchCode AS BranchCode,
  P_APLineItem_2.ReferenceDocumentType AS ReferenceDocumentType,
  P_APLineItem_2.OriginalReferenceDocument AS OriginalReferenceDocument,
  P_APLineItem_2.ReferenceDocumentLogicalSystem AS ReferenceDocumentLogicalSystem,
  PaymentReason,
  BillOfExchangeUsageDocument,
  BOEUsageDocFiscalYear,
  BOEUsageDocLineItem,
  JointVenture,
  JointVentureCostRecoveryCode,
  JointVentureBillingType,
  JointVentureCorporateEquityGrp
FROM P_APLineItem_2
LEFT OUTER JOIN t016t AS _IndustryName ON SupplierIndustry = _IndustryName.brsch AND Language = _IndustryName.spras  -- association [0..1]
LEFT OUTER JOIN I_RegionText AS _RegionText ON SupplierCountry = _RegionText.Country AND SupplierRegion = _RegionText.Region AND Language = _RegionText.Language  -- association [0..1]
;