Please read OSS note 2122786, you can find detailed description how ATP check works with MRP areas (in customizing you can influence the behaviour with indicator T441V-OLGPR).
SAP help also provides basic information about it ( ATP Check with MRP Areas):
You could also check OSS note 154682 which describes a special case (when you enter the batch manually - based on your description it is not the case but you may use this scenario as well).