Hi Srivaitaran,
I think that what you have asked is not the perfect question. Because SAP is an ERP and Java is a programming language.
Since, I was a SAP PI Consultant for 2 years, then I quit my job to become a Freelance C++ Developer for last 3 years (because it was my dream - and now I am happy living it).
So, I know the best of both worlds.
Now, I'd recommend that no matter what - you should learn Java, and if you can get a job in SAP - go get it. Java is used pretty much in SAP - and as a matter of fact SAP products have been developed in Java itself (as far as I know). Moreover, in SAP XI (which is now SAP PI) we used to use Java for mapping.
I have friends - who started with me as SAP Consultants and are right now working in SAP AG, developing the products of SAP in Java language.
So (in my opinion), in short, do both:
* learn Java
* get a job in SAP
I hope this helps well.
If any more queries, you can mail me from my profile page.
Regards,
S!D