SAP Knowledge Base Article - Public

3030004 - Header text from certain billing types cannot be retrieved by API Billing Document - Read, Cancel, GetPDF - SAP S/4HANA Cloud

Symptom

Header text is being retrieved by API Billing Document - Read, Cancel, GetPDF. A GET method is being operated, but a behavior difference is found where it can be retrieved from a billing document invoice but cannot from a credit memo.

Environment

  • SAP S/4HANA Cloud 2102
  • SAP S/4HANA Cloud 2105

Reproducing the Issue

  1. A GET method with request URI like '/sap/opu/odata/sap/API_BILLING_DOCUMENT_SRV/A_BillingDocument(BillingDocument='XXXXXXXX')/to_Text' is being triggered to fetch header text from a billing document invoice. The text is retrieved successfully.
  2. The same operation is done to fetch header text from a credit memo. However the text cannot be fetched.

Cause

The billing header texts are stored in CDS view A_BillingDocumentText. Only billing documents whose SD document category is 'M' that can be stored in this CDS view.
The definition of the CDS view is stated as below for your reference:

define view A_BillingDocumentText

  as select from P_BillingDocumentText( P_SAPClient : $session.client, P_td_object : 'VBBK' ) as BillingText
    inner join   I_BillingDocumentBasic                                 as BillingDocumentBasic on  BillingDocumentBasic.BillingDocument = BillingText.BillingDocument
                                                                                                and SDDocumentCategory                   = 'M'

Resolution

Always use this API request to retrieve billing document header text where its billing type belongs to any of the following ones:

  • CBD1
  • CBD2
  • CI01
  • CI02
  • CIX1
  • F2
  • FAZ

In case some other billing types are necessary for your business requirement, please create a new feature request to Customer Influence per KBA 2963059.

See Also

  • 2963059 - How to Submit Feature Requests for SAP S/4HANA Cloud Product

Keywords

to_Text, API_BILLING_DOCUMENT_SRV, SDDocumentCategory, VBBK, A_BILLINGDOCUM07_GET_ENTITYSET, CL_API_BILLING_DOCUMEN_DPC , KBA , SD-BIL , Billing , SD-BIL-IV , Processing Billing Documents , Problem

Product

SAP S/4HANA Cloud 2102 ; SAP S/4HANA Cloud 2105