That's called hidden-city ticketing, and has been covered a lot here. What happens when you don't board your flight AMS-BCN, the rest of your trip (BCN-AMS-home) gets cancelled, and you're stuck.
If you do two one-way trips, then it's possible. However, the airline may come after you for the difference in fare.