SAP Knowledge Base Article - Public

3736272 - Dynamic Success/Error messages truncated when content length exceeds limit in custom RAP app

Symptom

  • An application was developed that displays success or error messages dynamically based on selected records.
  • When the identifier length exceeds a certain limit, the message is not displayed completely and the last characters are cut off.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Open a custom RAP-based application that shows dynamic success/error messages after processing selected records.
  2. Select one or more records where a key field (for example, material identifier) exceeds roughly 13 characters.
  3. Run the action that raises the dynamic message and observe that the displayed message is truncated, with the last characters missing.

Cause

The message is raised using the standard message SAPB_BEHV(100) as a free text with a single parameter (&1), which restricts the message text to 50 characters; longer texts are truncated.

Resolution

  1. Avoid using SAPB_BEHV(100) free text messages with a single parameter (&1) for dynamic content that can exceed 50 characters.
  2. Create and use a custom message class and define specific message IDs with the required placeholders to accommodate the expected text.
  3. Update the application logic to raise messages from the custom message class and test with values longer than 50 characters to confirm the full text is displayed.

Keywords

RAP, message truncation, SAPB_BEHV, freetext message, 50 characters, dynamic messages, success message, error message, behavior definition, OData, ABAP messages, custom message class, long text, truncation, RAP messaging , KBA , BC-ESI-RAP-SRV , RAP - OData Design Time, Draft, Event Enablement , How To

Product

SAP S/4HANA Cloud Public Edition all versions