This question already has an answer here:
I have schengen visa issued by French embassy and my longer stay would also be in the same country. My first stay would also be at Paris. However, as per my flight, I will break the journey at Frankfurt, Germany and have to go for immigration before taking connecting flight to Paris in next two hours. Will it have any problem at immigration at Frankfurt?