P_ARLINEITEM_7

CDS View

P_ARLINEITEM_7 is a CDS View in S/4HANA. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_ClearedItem1 view union_all CONSUMPTION
@AbapCatalog.sqlViewName: 'PARLINEITEM7'
@VDM.viewType: #BASIC
@VDM.private:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_ARLineItem_7
  as select from bsad_bck

  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,

      // 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 ReceivableAlternativePayer,
      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,
      buzid                                                                         as AccountingDocumentItemType,
      
      /************************************************************************
       * 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,
              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 Fund,
              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

              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'       
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"BSAD_BCK"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"P_ARPCURROLE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/