Hi Sajmal
Are you saying you only want users to see in their user menu all of the custom Z and Y transaction codes that they are authorised to use?
If so, Thorben has already provided the correct answer: You need to build PFCG roles with the transaction codes in the role menu and assign the user the access they need.
The user will end up with SAP Standard Menu and SAP User Menu. SAP User Menu will be all folders, transaction codes, etc that the user receives from their PFCG roles.
If you do not want the user to see other transactions that they should not have access, then you can make transaction within role menu hidden OR you can hide role menu in GUI and/or PFCG (Google role menu in help.sap.com for this information)
Have you had basic SAP security training (i.e. ADM940 course)
Regards
Colleen