Condition based COMMIT of IDocs
I am creating ALEAUD Idocs from an incoming CONTRL or BANSTA file. This incoming file can have multiple BANSTA/CONTRL messages, for which I need to create atleast one ALEAUD(maybe multiple) per BANSTA/CONTRL message. The requirement here is that the IDocs be committed only when all the IDocs corresponding to the incoming message are successfully created i.e. if the incoming file has 10 messages, then 10 IDocs have to be created, but committed only when all these 10 are successfully created.
I tried using the FM 'IDOC_INBOUND_SINGLE' by setting the error flag and do_commit parameter but it works only when there is an error in the header of the IDoc and cannot be created. It does not work in case the IDoc is created but with in an error status.
Can anyone please suggest what else are the possibilities ?
Thanks in advance,