There is an outbound document on SAP server having number "3710513" and some IDoc status "X".
Using Java I want to change this document status to a different value, for example "12".
I managed to find that common approach to send acknowledgements (and change IDoc status as well) is using ALEAUD
message.
This is what I'm trying to do
var XML = """
<ALEAUD01>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<MESTYP>ALEAUD</MESTYP>
<IDOCTYP>ALEAUD01</IDOCTYP>
<SNDPOR>MY_SNDPOR</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>MY_SNDPRN</SNDPRN>
</EDI_DC40>
<E1ADHDR SEGMENT="1">
<E1STATE SEGMENT="1">
<DOCNUM>3710513</DOCNUM>
<STATUS>12</STATUS>
</E1STATE>
</E1ADHDR>
</IDOC>
</ALEAUD01>
""";
JCoDestination destination = getDestinationFromMyCurrentSAPConnecton();
IDocRepository iDocRepository = JCoIDoc.getIDocRepository(destination);
IDocFactory iDocFactory = JCoIDoc.getIDocFactory();
String tid = destination.createTID();
IDocXMLProcessor processor = iDocFactory.getIDocXMLProcessor();
IDocDocumentList iDocList = processor.parse(iDocRepository, XML);
JCoIDoc.send(iDocList, IDocFactory.IDOC_VERSION_DEFAULT, destination, tid);
destination.confirmTID(tid);
This sending completes without errors.
But on the SAP server in dialogue "Status Monitor for ALE Messages" I see that the target IDoc has two status columns (see scereenshot 1) (first="39", second="12"), and in the history ("Status records") there is only status "39" (see screenshot 2), which was not intended.
Please help me to find out what is the correct way to send a status of IDoc to SAP server, so this status naturally applied to the "Status record" history.