cancel
Showing results for 
Search instead for 
Did you mean: 

Error in I_BILLINGDOCUMENT CDS view extension for Email template

ajay_mukundan2
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (0)