Skip to Content
Jul 02, 2018 at 07:12 PM

Error in I_BILLINGDOCUMENT CDS view extension for Email template

313 Views Last edit Jul 05, 2018 at 12:54 AM 2 rev

Hello Gurus,

With respect to Email template for Billing document in S4 Output Management we need to get few fields - SalesDocument and PO Reference Number.

@AbapCatalog.sqlViewAppendName: 'ZEXTBIL'
@EndUserText.label: 'Extension view for I_BILLINGDOCUMENT'
extend view I_BillingDocument with Zv_extndd_billing 
association [1..1] to P_BillingDocumentItemBasic as _bill_itm
on  _extension.BillingDocument = _bill_itm.BillingDocument and
    _bill_itm.BillingDocumentItem = '000010'

// To get Sales Document since DocumentReference in I_BILLINGDOCUMENT is having different value.
association [1..1] to  I_SalesDocument  as _SD
on  salesdocument = _bill_itm.SalesDocument 
 _SD.SalesDocument ,
 PurchaseOrderByCustomer as Customer_Reference,
  case SDDocumentCategory
  when 'M' then 'Invoice'
  when 'O' then 'Credit Memo'
  when 'P' then 'Debit Memo'
  else ' '
  end  as Description

I am getting the below error-

I have referred Horst Keller's link - From Open SQL Joins to CDS Association

What is not clear is how to get the SalesDocument from I_SALESDOCUMENT and PurchaseorderByCustomer together.


for-sdn.png (15.0 kB)