SAP Knowledge Base Article - Public

3841138 - Purchase order long text line breaks replaced by spaces in PlainLongText via OData V4 – SAP S/4HANA Cloud Public Edition

Symptom

When a purchase order header or item text includes line breaks, released interfaces return PlainLongText as a single line, with each line break replaced by a space (U+0020), while the deprecated OData V2 API returns the text with line feeds (LF, U+000A).

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Enter a purchase order header or item long text with line breaks in Manage Purchase Orders.
  2. Read the text using OData V2 API or OData V4 API.
  3. Observe that PlainLongText is returned as a single line with line breaks replaced by spaces in Odata V4.

Cause

This is a known gap in the purchase order OData V4 : OData V4 uses a CDS view intended for ESH scenarios that does not handle text formatting (line breaks), while OData V2 reads via ABAP text function modules (for example, READ_TEXT) that preserve line feeds.

Resolution

As a workaround, we recommend continuing to use the Purchase Order OData V2 API for scenarios that require formatted header text. Since OData V2 correctly handles text formatting, using this API for the relevant data retrieval remains the most reliable approach at present.

We currently do not have a specific timeline for the decommissioning of the Purchase Order OData V2 API. For the latest information, please refer to: 3598071 - Decommission of PurchaseOrderAPI - SAP for Me

See Also

Keywords

PlainLongText, line breaks, LF, U+000A, spaces, U+0020, OData V4, OData V2, CE_PURCHASEORDER_0001, I_PurchaseOrderTP_2, purchase order long text, RAP BO, text formatting, READ_TEXT , KBA , MM-PUR-PO-2CL , Purchase Orders (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions