Help Needed: Correcting <PERS_NO> in BAPI message bodies for known IntegrationEntryIds and requesting an demo

Background
Some BAPI requests contain an incorrect <PERS_NO> in the XML body, which causes SAP posting failures. We already have the list of IntegrationEntryIds that must be corrected.
Error (RESULT):
BAPI process failed due to: Error during posting confirmation (err:x08) Personnel master record 02965274 not found (check entry) The error was reported by action ERPOutputMessageHandlerAction.

Request snippet:****

** **<PERS_NO>02965274</PERS_NO>

What we need

An minimal demo/sample (script/action/pipeline config) showing how to do this.

The PERS_NO above should be replaced with a valid personnel number 02967667

Hi Joy,

Updates of Integration Messages payloads are not supported. Example:

You’d need to create a new Integration Entry with the updated payload. In simple steps:

  1. Load the original Integration Entry and its message:
var serviceProvider = (IServiceProvider)Input["ServiceProvider"];
var entityFactory = serviceProvider.GetService<IEntityFactory>();

var ie = entityFactory.Create<IIntegrationEntry>();
ie.Load("<IE_NAME>");
ie.LoadIntegrationMessage();

var message2 = Encoding.UTF8.GetString(ie.IntegrationMessage.Message);
  1. Change the payload data according to your requirement.
  2. Create a new Integration Entry with the same metadata (source, target, message type,etc. )

For tips on how to programatically create a new Integration Entry see my response to this post: How to create a MES to MES Integration Entries using DEE, please give an example code, thanks a lot! - #2 by Ricardo_Cunha