Let me quote a reply from SAP for the same issue when loading customer masters:
"Idoc processing works with potentially many separate call transactions.As a result, there can be many data completely updated prior the idoc isset in status 51 .
A DEBMAS idoc have the general data segments like E1KNA1M.
It might have several company code data segments like E1KNB1M...
several sales area segments like E1KNVVM...
All these segments leads to separate batch input transaction to be run.
It can be XD02, followed by several XD01 (for creating a sales area of
a customer).
As a result, the processing of an idoc can finish with status 51 and
have some master data processed successfully."