My name in passport is:
My name : XXX YYY
surname : ZZZ
The name which I gave in flight ticket is:
First name : XXX
Last name : YYY
Is it possible to change my name?
I am assuming that you will fly from lufthansa:
It is not possible to make a retroactive name change for a booking.
Lufthansa provides the carriage service to the passenger named in the ticket only and only against presentation of a corresponding valid ticket that contains the flight coupon for the relevant flight, all subsequent flight coupons and the passenger’s coupon.
In the case of electronic tickets, instead of presenting the ticket the electronic ticket may also be stored in the reservation system for the passenger named in the booking.
Your Lufthansa Service Centre will be happy to help you if you require further information. If you have booked an award ticket, please contact your Miles & More Service Team.
In this case, I believe that lufthansa is assuming changing the person.
Here what I found in other website:
Name change: You cannot transfer a ticket to another person. Spelling mistakes of 1-3 letters should be okay to correct. For bigger changes or name changes, you will need to cancel the ticket within 24 hours of booking. More details: Call the hotline on 0371 945 9747
So, I believe you need to call and explain your situation.
In many cases, it will be possible to change the name on your ticket although a fee may apply. Contact the airline or agent that issued the ticket, and they will advise you whether or not this can be done (or if it needs to be done), together with details of any fees that will apply .