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.
- SAP S/4HANA Cloud 2102
- SAP S/4HANA Cloud 2105
Reproducing the Issue
- 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.
- The same operation is done to fetch header text from a credit memo. However the text cannot be fetched.
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'
Always use this API request to retrieve billing document header text where its billing type belongs to any of the following ones:
In case some other billing types are necessary for your business requirement, please create a new feature request to Customer Influence per KBA 2963059.
- 2963059 - How to Submit Feature Requests for SAP S/4HANA Cloud Product
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