Hi Ashwini,
Free memory ID doesn't work in CRM. It is also not a good coding practice.
Instead you can use static attributes or global data context parameters.
refer following threads:
http://scn.sap.com/community/crm/blog/2013/06/10/global-data-context-parametersgdc
https://scn.sap.com/thread/1951893
Regards,
NiK