SAP Writing
RFC_IDOC_INBOUND_ASYNCHRONOUS_1.getIDOC_INBOUND_ASYNCHRONOUS().unmarshal( IDOC.marshal() );
RFC_IDOC_INBOUND_ASYNCHRONOUS_1.getIDOC_INBOUND_ASYNCHRONOUS().executeAsynchron ous( "GUIID" );
The byte array marshalled from the IDOC 947 bytes long. The StringIndexOutOfBoundsException occurs at position 1063 on the first line shown above. Their is no error in the marshalling, only that the marshalling is producing a byte array that is too short for the IDOC to be written. So when the RFC_IDOC_INBOUND_ASYNCHRONOUS_1 (BAPI) tries to unmarshal the IDOC it fails because it is too small (i.e 947 bytes and not 1063)
What could make the IDOC marshal method produce a byte array that is too short? This is puzzling since if I don't set all of the IDOC properties (both for the control record and for the message itself) then I get another error. So in theory, the IDOC should be fully populated.

