The process for inbound and outbound is different. I don't know why you keep mentioning MASTER_IDOC_DISTRIBUTE. It has nothing to do with the inbound process. Have you tried using Google to find an example program for inbound IDoc?
I'm not sure what exactly you're trying to do though, you'd need to provide more specific information if expecting meaningful replies.