Hello Kiichiro,
Please let us know what is the Idoc type and message type which you are using for the confirmation.
For inbound idoc go to the function module which processes the idoc and find exit in it, then do your changes to update the batch no.
Also please explain in detail about your requirement like, what is the structure of the idoc you are using and also batch no. is received from Idoc or to be calculated within the system.
Regards,
TP