Why Ampere's law uses the current which passes through the open surface only? In Ampere's law:
$$
\oint \vec B\cdot d\vec \ell = \mu I
$$
the current in the equation is the current which passes through the open surface. If a surface is chosen such that on the outer region of surface too current flows. That current too contributes to magnetic field at a point on that surface. But why we consider only the inner current? Or is it that Ampere's law find magnetic field only due to inner current?
 A: (a) You are right about the field at P being due to currents both inside your surface and outside it.
(b) But Ampère's law isn't about the field at P but about the line integral of the field around the edge of your open surface. It is this line integral that is independent of currents that don't pass through your surface. Here are two arguments that might help you see why..
• Imagine a straight current-carrying wire running past your open surface, but outside it. Around different arcs of the line bounding your surface this wire's field will make contributions to the line integral that turn out to be equal and opposite.
• There is a good analogy with Gauss's law in electrostatics: The surface integral of electric field strength, that is the electric flux, leaving a closed surface is proportional to the charge inside the surface and independent of charge outside it.
(c) But you might say: Surely we do use Ampère's law to find the magnetic field strength at points like P on the edge of an open surface. Yes, if the current density inside the surface has enough symmetry, we do get information about the field at P. But we only get the field due to currents passing through the surface. We don't get information about the contribution to the field at P made by any currents that don't pass through the surface.
