P_APLINEITEM_6

CDS View

Created from DDL source P_APLineItem_6

P_APLINEITEM_6 is a CDS View in S/4HANA. Created from DDL source P_APLineItem_6. It contains 107 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_APLineItem_4 view_entity union_all COMPOSITE Created from DDL source P_APLINEITEM_4

Fields (107)

KeyField CDS FieldsUsed in Views
KEY AccountingDocument AccountingDocument 1
KEY AccountingDocumentItem AccountingDocumentItem 1
KEY FiscalYear FiscalYear 1
AccountingDocumentCategory AccountingDocumentCategory 1
AccountingDocumentType AccountingDocumentType 1
AccountsReceivableIsPledged AccountsReceivableIsPledged 1
AmountInAdditionalCurrency1 AmountInAdditionalCurrency1 1
AmountInAdditionalCurrency2 AmountInAdditionalCurrency2 1
AmountInBalanceTransacCrcy AmountInBalanceTransacCrcy 1
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency 1
AmountInPaymentCurrency AmountInPaymentCurrency 1
AmountInTransactionCurrency AmountInTransactionCurrency 1
AssetContract AssetContract 1
AssignmentReference AssignmentReference 1
BalanceTransactionCurrency BalanceTransactionCurrency 1
BillingDocument BillingDocument 1
BillOfExchangeUsage BillOfExchangeUsage 1
BPBankAccountInternalID BPBankAccountInternalID 1
Branch Branch 1
BusinessArea BusinessArea 1
BusinessPlace BusinessPlace 1
CashDiscount1Days CashDiscount1Days 1
CashDiscount1Percent CashDiscount1Percent 1
CashDiscount2Days CashDiscount2Days 1
CashDiscount2Percent CashDiscount2Percent 1
CashDiscountAmount CashDiscountAmount 1
CashDiscountAmtInCoCodeCrcy CashDiscountAmtInCoCodeCrcy 1
CashDiscountBaseAmount CashDiscountBaseAmount 1
CashFlowType CashFlowType 1
ClearingAccountingDocument ClearingAccountingDocument 1
ClearingDate ClearingDate 1
ClearingDocFiscalYear ClearingDocFiscalYear 1
ClearingIsReversed ClearingIsReversed 1
CostCenter CostCenter 1
CreationDate AccountingDocumentCreationDate 1
CreditControlArea CreditControlArea 1
DataExchangeInstruction1 DataExchangeInstruction1 1
DataExchangeInstruction2 DataExchangeInstruction2 1
DataExchangeInstruction3 DataExchangeInstruction3 1
DataExchangeInstruction4 DataExchangeInstruction4 1
DebitCreditCode DebitCreditCode 1
Debtor Debtor 1
DocumentDate DocumentDate 1
DocumentIsArchived DocumentIsArchived 1
DocumentItemText DocumentItemText 1
DocumentReferenceID DocumentReferenceID 1
DueCalculationBaseDate DueCalculationBaseDate 1
DunningArea DunningArea 1
DunningBlockingReason DunningBlockingReason 1
DunningKey DunningKey 1
DunningLevel DunningLevel 1
FiscalPeriod FiscalPeriod 1
FixedAsset FixedAsset 1
FixedCashDiscount FixedCashDiscount 1
FollowOnDocumentType FollowOnDocumentType 1
FundsCenter FundsCenter 1
GLAccount GLAccount 1
HasPaymentOrder HasPaymentOrder 1
HedgedAmount HedgedAmount 1
HouseBank HouseBank 1
HouseBankAccount HouseBankAccount 1
InvoiceList InvoiceList 1
InvoiceReference InvoiceReference 1
IsUsedInPaymentTransaction IsUsedInPaymentTransaction 1
LastDunningDate LastDunningDate 1
MasterFixedAsset MasterFixedAsset 1
NetPaymentDays NetPaymentDays 1
OrderID OrderID 1
OriginalReferenceDocument OriginalReferenceDocument 1
PartnerCompany PartnerCompany 1
PayableAlternativePayee PayableAlternativePayee 1
PaymentBlockingReason PaymentBlockingReason 1
PaymentCardItem PaymentCardItem 1
PaymentCardPaymentSettlement PaymentCardPaymentSettlement 1
PaymentCurrency PaymentCurrency 1
PaymentDifferenceReason PaymentDifferenceReason 1
PaymentMethod PaymentMethod 1
PaymentMethodSupplement PaymentMethodSupplement 1
PaymentReference PaymentReference 1
PaymentTerms PaymentTerms 1
PostingDate PostingDate 1
PostingKey PostingKey 1
ProfitCenter ProfitCenter 1
RealEstateObject RealEstateObject 1
Reference1IDByBusinessPartner Reference1IDByBusinessPartner 1
Reference2IDByBusinessPartner Reference2IDByBusinessPartner 1
Reference3IDByBusinessPartner Reference3IDByBusinessPartner 1
ReferenceDocumentLogicalSystem ReferenceDocumentLogicalSystem 1
ReferenceDocumentType ReferenceDocumentType 1
SalesDocument SalesDocument 1
SalesDocumentItem SalesDocumentItem 1
ScheduleLine ScheduleLine 1
SettlementReferenceDate SettlementReferenceDate 1
SpecialGLCode SpecialGLCode 1
SpecialGLTransactionType SpecialGLTransactionType 1
StateCentralBankPaymentReason StateCentralBankPaymentReason 1
Supplier Supplier 1
SupplyingCountry SupplyingCountry 1
TaxCode TaxCode 1
TaxCountry TaxCountry 1
TaxSection TaxSection 1
TransactionCurrency TransactionCurrency 1
TreasuryContractType TreasuryContractType 1
ValuationDiffAmtInAddlCrcy1 ValuationDiffAmtInAddlCrcy1 1
ValuationDiffAmtInAddlCrcy2 ValuationDiffAmtInAddlCrcy2 1
ValuationDiffAmtInCoCodeCrcy ValuationDiffAmtInCoCodeCrcy 1
WBSElement WBSElement 1
@AbapCatalog.sqlViewName: 'PAPLINEITEM6'
@VDM.viewType: #BASIC
@VDM.private:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_APLineItem_6
  as select from bsad_bck

    inner join   fap_mult_mix_acc as MixedAccount on  bsad_bck.kunnr = MixedAccount.debtor
                                                  and bsad_bck.bukrs = MixedAccount.companycode

  association [1..1] to I_CompanyCode as _CompanyCode               on $projection.CompanyCode = _CompanyCode.CompanyCode

  association [0..1] to P_ARPCurRole  as _AdditionalCompanyCurrency on $projection.CompanyCode = _AdditionalCompanyCurrency.CompanyCode
{
      /************************************************************************
       * general/header
       ***********************************************************************/
  key bukrs                                                                         as CompanyCode,
  key kunnr                                                                         as Debtor,
  key umsks                                                                         as SpecialGLTransactionType,
  key umskz                                                                         as SpecialGLCode,
  key augdt                                                                         as ClearingDate,
  key augbl                                                                         as ClearingAccountingDocument,
  key zuonr                                                                         as AssignmentReference,
  key gjahr                                                                         as FiscalYear,
  key belnr                                                                         as AccountingDocument,
  key buzei                                                                         as AccountingDocumentItem,
      budat                                                                         as PostingDate,
      bldat                                                                         as DocumentDate,
      auggj                                                                         as ClearingDocFiscalYear,
      waers                                                                         as TransactionCurrency,
      blart                                                                         as AccountingDocumentType,
      cast( cast( concat( '0', monat ) as abap.numc( 3 ) ) as fins_fiscalperiod )   as FiscalPeriod,
      bschl                                                                         as PostingKey,
      gsber                                                                         as BusinessArea,
      prctr                                                                         as ProfitCenter,
      kostl                                                                         as CostCenter,
      hkont                                                                         as GLAccount,
      filkd                                                                         as Branch,
      bstat                                                                         as AccountingDocumentCategory,
      sgtxt                                                                         as DocumentItemText,
      xnegp                                                                         as IsNegativePosting,
      cession_kz                                                                    as AccountsReceivableIsPledged,
      cpudt                                                                         as CreationDate,
      xarch                                                                         as DocumentIsArchived,
      pswsl                                                                         as BalanceTransactionCurrency,
      MixedAccount.supplier                                                         as Supplier,

      // write corrected SHKZG to DebitCreditCode but use original SHKZG to derive signs of amounts

      case xnegp when 'X' then
          case shkzg
              when 'S' then 'H'
              when 'H' then 'S'
              else ''         // must not happen but returning invalid value helps searching for such data inconsistencies

          end
          else shkzg
      end                                                                           as DebitCreditCode,

      /************************************************************************
       * general amounts
       ***********************************************************************/
      case shkzg
          when 'H' then cast(-wrbtr as abap.curr(23,2))
          else          cast( wrbtr as abap.curr(23,2))
      end                                                                           as AmountInTransactionCurrency,
      case shkzg
          when 'H' then cast(-dmbtr as abap.curr(23,2))
          else          cast( dmbtr as abap.curr(23,2))
      end                                                                           as AmountInCompanyCodeCurrency,
      case shkzg
          when 'H' then cast(-dmbe2 as abap.curr(23,2))
          else          cast( dmbe2 as abap.curr(23,2))
      end                                                                           as AmountInAdditionalCurrency1,
      case shkzg
          when 'H' then cast(-dmbe3 as abap.curr(23,2))
          else          cast( dmbe3 as abap.curr(23,2))
      end                                                                           as AmountInAdditionalCurrency2,
      case shkzg
          when 'H' then cast(-bdiff as abap.curr(23,2))
          else          cast( bdiff as abap.curr(23,2))
      end                                                                           as ValuationDiffAmtInCoCodeCrcy,
      case shkzg
          when 'H' then cast(-bdif2 as abap.curr(23,2))
          else          cast( bdif2 as abap.curr(23,2))
      end                                                                           as ValuationDiffAmtInAddlCrcy1,
      case shkzg
          when 'H' then cast(-bdif3 as abap.curr(23,2))
          else          cast( bdif3 as abap.curr(23,2))
      end                                                                           as ValuationDiffAmtInAddlCrcy2,
      case shkzg
          when 'H' then cast(-pswbt as abap.curr(23,2))
          else          cast( pswbt as abap.curr(23,2))
      end                                                                           as AmountInBalanceTransacCrcy,
      case shkzg
          when 'H' then cast(-absbt as abap.curr(23,2))
          else          cast( absbt as abap.curr(23,2))
      end                                                                           as HedgedAmount,

      /************************************************************************
       * references
       ***********************************************************************/
      xblnr                                                                         as DocumentReferenceID,
      aufnr                                                                         as OrderID,
      anln1                                                                         as MasterFixedAsset,
      anln2                                                                         as FixedAsset,
      rebzg                                                                         as InvoiceReference,
      samnr                                                                         as InvoiceList,
      vbund                                                                         as PartnerCompany,
      vbeln                                                                         as BillingDocument,
      rebzt                                                                         as FollowOnDocumentType,
      lzbkz                                                                         as StateCentralBankPaymentReason,
      landl                                                                         as SupplyingCountry,
      vertt                                                                         as TreasuryContractType,
      vertn                                                                         as AssetContract,
      vbewa                                                                         as CashFlowType,
      projk                                                                         as WBSElement,
      xref1                                                                         as Reference1IDByBusinessPartner,
      xref2                                                                         as Reference2IDByBusinessPartner,
      xref3                                                                         as Reference3IDByBusinessPartner,
      imkey                                                                         as RealEstateObject,
      vbel2                                                                         as SalesDocument,
      posn2                                                                         as SalesDocumentItem,
      eten2                                                                         as ScheduleLine,
      fistl                                                                         as FundsCenter,
      bupla                                                                         as BusinessPlace,

      /************************************************************************
       * tax
       ***********************************************************************/
      mwskz                                                                         as TaxCode,
      tax_country                                                                   as TaxCountry,
      secco                                                                         as TaxSection,

      /************************************************************************
       * cash discount
       ***********************************************************************/
      zfbdt                                                                         as DueCalculationBaseDate,
      zterm                                                                         as PaymentTerms,
      zbd1t                                                                         as CashDiscount1Days,
      zbd2t                                                                         as CashDiscount2Days,
      zbd3t                                                                         as NetPaymentDays,
      zbd1p                                                                         as CashDiscount1Percent,
      zbd2p                                                                         as CashDiscount2Percent,
      zlsch                                                                         as PaymentMethod,
      zlspr                                                                         as PaymentBlockingReason,
      zbfix                                                                         as FixedCashDiscount,
      case shkzg
          when 'H' then cast(-skfbt as abap.curr(23,2))
          else          cast( skfbt as abap.curr(23,2))
      end                                                                           as CashDiscountBaseAmount,
      case shkzg
          when 'H' then cast(-sknto as abap.curr(23,2))
          else          cast( sknto as abap.curr(23,2))
      end                                                                           as CashDiscountAmtInCoCodeCrcy,
      case shkzg
          when 'H' then cast(-wskto as abap.curr(23,2))
          else          cast( wskto as abap.curr(23,2))
      end                                                                           as CashDiscountAmount,

      /************************************************************************
       * dunning
       ***********************************************************************/
      mansp                                                                         as DunningBlockingReason,
      mschl                                                                         as DunningKey,
      madat                                                                         as LastDunningDate,
      manst                                                                         as DunningLevel,
      maber                                                                         as DunningArea,

      /************************************************************************
       * payment
       ***********************************************************************/
      xzahl                                                                         as IsUsedInPaymentTransaction,
      rstgr                                                                         as PaymentDifferenceReason,
      wverw                                                                         as BillOfExchangeUsage,
      xragl                                                                         as ClearingIsReversed,
      uzawe                                                                         as PaymentMethodSupplement,
      dabrz                                                                         as SettlementReferenceDate,
      rfzei                                                                         as PaymentCardItem,
      ccbtc                                                                         as PaymentCardPaymentSettlement,
      kkber                                                                         as CreditControlArea,
      empfb                                                                         as PayableAlternativePayee,
      dtws1                                                                         as DataExchangeInstruction1,
      dtws2                                                                         as DataExchangeInstruction2,
      dtws3                                                                         as DataExchangeInstruction3,
      dtws4                                                                         as DataExchangeInstruction4,
      xpypr                                                                         as HasPaymentOrder,
      kidno                                                                         as PaymentReference,
      pycur                                                                         as PaymentCurrency,
      bvtyp                                                                         as BPBankAccountInternalID,
      case shkzg
          when 'H' then cast(-pyamt as abap.curr(23,2))
          else          cast( pyamt as abap.curr(23,2))
      end                                                                           as AmountInPaymentCurrency,
      hbkid                                                                         as HouseBank,
      hktid                                                                         as HouseBankAccount,

      /************************************************************************
       * dummy fields
       ***********************************************************************/
      cast( '     ' as fis_awtyp )                                                  as ReferenceDocumentType,
      cast( '                    ' as fac_awkey )                                   as OriginalReferenceDocument,
      cast( '          ' as fis_awsys )                                             as ReferenceDocumentLogicalSystem,     
      
      /************************************************************************
       * exposed associations
       ***********************************************************************/
      _AdditionalCompanyCurrency,
      _CompanyCode

      /************************************************************************
       * skipped fields as not in Calculation View

              zumsk                   as TargetSpecialGLCode,
              mwsts                   as TaxAmountInCoCodeCrcy,
              wmwst                   as TaxAmount,
              projn                   as Project,
              saknr                   as OperationalGLAccount,
              hbkid                   as HouseBank,
              rebzj                   as InvoiceReferenceFiscalYear,
              rebzz                   as InvoiceItemReference,
              xcpdd                   as AddressAndBankIsSetManually,
              mwsk1                   as TaxDistributionCode1,
              mwsk2                   as TaxDistributionCode2,
              mwsk3                   as TaxDistributionCode3,
              stceg                   as VATRegistration,
              egbld                   as DelivOfGoodsDestCountry,
              eglld                   as DelivOfGoodsOriginCountry,
              fipos                   as CommitmentItem,
              nplnr                   as ProjectNetwork,
              aufpl                   as OrderInternalBillOfOperations,
              aplzl                   as OrderIntBillOfOperationsItem,
              xegdr                   as IsEUTriangularDeal,
              xstov                   as ReversalIsPlanned,
              lzbkz                   as StateCentralBankPaymentReason,
              landl                   as SupplyingCountry,
              geber                   as Funds,
              qsskz                   as WithholdingTaxCode,
              grant_nbr               as GrantID,
              gmvkz                   as CustomerIsInExecution,           // note: original was CustomerIsInExceution with typo

              fkber                   as FunctionalArea,
              intreno                 as AncestorInternalRealEstateNmbr,
              pprct                   as PartnerProfitCenter,              
              budget_pd               as BudgetPeriod,
              mndid                   as SEPAMandate,
              gkont                   as OffsettingAccount,
              gkart                   as OffsettingAccountType,
              vname                   as JointVenture,
              egrup                   as JointVentureEquityGroup,

              bvtyp                   , // not yet approved in GFC: PartnerBankAccountInternalID

              xnetb                   , // not yet approved in GFC: CashDiscIsDeductedFrmVndrInvc

              xinve                   , // not yet approved in GFC: CapitalGoodIsAffected


              dmbt1                   , // not in GFC, variants of dmbtr = AmountInCompanyCodeCurrency?

              wrbt1                   , // not in GFC, variants of wrbtr = AmountInTransactionCurrency?

              dmbt2                   , // not in GFC

              wrbt2                   , // not in GFC

              dmbt3                   , // not in GFC

              wrbt3                   , // not in GFC

              dmb21                   , // not in GFC

              dmb22                   , // not in GFC

              dmb23                   , // not in GFC

              dmb31                   , // not in GFC

              dmb32                   , // not in GFC

              dmb33                   , // not in GFC

              mwst2                   , // not in GFC, variants of mwsts = TaxAmountInCoCodeCrcy?

              mwst3                   , // not in GFC

              sknt2                   , // not in GFC, variants of sknto = CashDiscountAmtInCoCodeCrcy?

              sknt3                   , // not in GFC


              fkont                   , // not in GFC, Financial Budget Item

              anfbn                   , // not in GFC, Document Number of the Bill of Exchange Payment Request

              anfbj                   , // not in GFC, Fiscal Year of the Bill of Exchange Payment Request Document

              anfbu                   , // not in GFC, Company Code in Which Bill of Exch.Payment Request Is Posted

              anfae                   , // not in GFC, Bill of Exchange Payment Request Due Date

              xanet                   , // not in GFC, Indicator: Down Payment in Net Procedure?

              infae                   , // not in GFC, Inverted Date for Net Due Date

              xnoza                   , // not in GFC, Indicator: Account is not counted

              vpos2                   , // not in GFC

              zinkz                   , // not in GFC, Exempted from Interest Calculation

              ppdiff                  , // not in GFC, Realized Exchange Rate Gain/Loss 1.Loc.Curr.(Part Payments)

              ppdif2                  , // not in GFC, Realized Exchange Rate Gain/Loss 2.Loc.Curr.(Part Payments)

              ppdif3                  , // not in GFC, Realized Exchange Rate Gain/Loss 3.Loc.Curr.(Part Payments)

              kblnr                   as EarmarkedFundsDocument,
              kblpos                  , // not in GFC, Earmarked Funds: Document Item -> NEW EarmarkedFundsDocumentItem??

              srtype                  , // not in GFC, Type of Additional Receivable

              lotkz                   , // not in GFC, Lot Number for Requests

              buzid                   , // not in GFC, Identification of the Line Item

              pays_prov               , // not in GFC, Payment Service Provider

              pays_tran               , // not in GFC, Payment Reference of Payment Service Provider

              ghkon                   , // not in GFC, G/L Acct of Offsetting Acct in General Ledger Accounting

              btype                   , // not in GFC, Payroll Type

              propmano                , // not in GFC, Mandate, Mandate-Opening Contract


       ************************************************************************/
}
// BSAD/K_BCK tables were originally introduced as index tables for cleared items and later used for archiving exclusively

// As not archived items are still persisted in BSEG/ACDOCA, we restrict to archived items here

where
  xarch = 'X'