Depends on the airport, and everyplace is different. In Spain it shouldn't generally be much of a problem to get to the gate or the ramp with your pilot credentials.
My line for one issues an Xtra-Crew boarding pass that is valid to get you through security. In any case, whether you go to the aircraft, the boarding gate, check-in counter or sales counter just make sure that your request is passed on to the Captain -ask to see a supervisor if you have to. It usually works.
Email me any time if you have something in mind and need any help.