How is there a magnetic field value along the loop? The problem given to me is 

According to my logic there shouldn't be any B.dl along the loop as the current passing through the loop is zero but according to the question it isn't. I don't want you to solve the entire problem, I just want to know the logic about how and why will there be a B.dl value.
 A: The problem is in the following.
You're talking about the circulation theorem which states that for any surface $D$ and its boundary $\partial D$ the following relation holds
$$
\int \limits_D (\vec{j}, \vec{dS}) \sim \int \limits_{\partial D} (\vec{B}, \vec{dl})
$$
where $j$ is current density and $B$ is magnetic field. Its statement is only self-consistent when for any closed surface one has $\int \limits_D (\vec{j}, \vec{dS})=0$, which is a condition for that charge doesn't accumulate anywhere in space; thus, it is valid only in stationary situation. But for your problem this is not true: if a wire intersects the closed surface $D$, integral is non-zero; that means that actually you have an accumulation of charge at the end of the wire, which, in turn, implies the existence of time-dependent electric field from that charge.
You still can calculate the magnetic field using Biot-Savart law, but circulation theorem is non-valid. Instead (to find the same result) you could use the more general Maxwell equation with changing electric field term ("displacement current")
$$
 \int \limits_{\partial D} (\vec{B}, \vec{dl}) = \mu_0 \int \limits_D (\vec{j}, \vec{dS}) + \epsilon_0 \mu_0 \int \limits_D (\frac{\partial E}{\partial t}, \vec{dS}) 
$$
It will give you the same answer, if you calculate how electric field from that charge changes over time.
A: Aleksandr gives a more detailed answer, but I can try to provide some intuition. The hint is this. If you take the in the diagram, loop and pick the surface closes it with a disk, there doesn't appear to be any current density that crosses it. However, we aren't required to choose a particular surface. We may choose any surface where the boundary is that loop. So you could think about how when blowing a bubble, the surface of the bubble is initially the disk, but if you start to blow it, the film will stretch out in all kinds of shapes. Certainly there is one in which the wire intersects the surface. 
In fact, this is what Maxwell discovered when he modified Ampere's law. The problem was similar. If you chose a loop around a capacitor, there is nothing between the plates, and therefore no current. However, if we stretch the surface past the conductor, it intersects the wire again. This was a problem, but since we know that Electromagnetism is a consistent theory, there is a way around this, and Aleksandr's answer provides better evidence of that. 
A: You can't apply Ampère's law to this set-up because you don't know how the circuit is completed beyond P. The circuit needs to be completed because Ampère's law, pure and simple, applies for a steady current.
What you can do is to find $\vec B$ at each point on the loop due to the semi-infinite wire ending at P by integrating up the fields $d \vec B$ due to infinitesimal elements of the wire, as given by the Biot-Savart law. It is then trivial to find your line integral around the loop.
