Looks like you are generating one single XML with multiple ST/SE combination, and then sending to B2B.
If my above understanding is correct, thisoption will not work well. Instead you can send one 856 XML message each to B2B, and B2B will take care of batching all the required ST/SE's for the particulat partner and then send one single EDI message to partner.
You can use the Batching feature of B2B (https://docs.oracle.com/middleware/12212/b2b/b2b-ug/GUID-3BC359BF-F3F4-4CFC-A692-70C3070D0A42.htm#XBBUG1381 ) You can use the batching feature and trigger the batched messages to send to trading partner based on the
- regular interval of time
- based on the number of messages (count)
- The total size of batch
Hope this helps