Sometimes I am getting the amplification when it is as cDNA, but by taking that amplified fragment and cloning into a vector it is not amplifying. What could be possible reasons for this?
Self-ligation of the vector seems likely reason here.
If you re using classical cloning (restriction - ligation) make sure to de-phosphorylate the digested vector to avoid self-ligation. Best would be to use kits (pBAD works WONDERFULLY) or at least two-cut vector (two different enzymes at 3' and 5' region of the insert).
I think you have to check whether your plasmid having the insert or not by restriction digestion of both the vector and vector containing the insert.
If yes,
It may also possible that some rearrangement may have take place due to which it may possible that primer site may get modified/mutated and in that case you may not be able to amplify the product by using gene specific primers.
you can also confirm this possibility by using vector primers harboring your insert sequence ( don't forgot to include the PCR of vector DNA , as positive ctr to check whether your vector primer condition are OK or not) or combination of one vector and one insert primer as Forward and reverse primer can be used to amplify the product.
Best way to dephosphorylates the digested vector before ligation as suggested by Marcin but there will still chance of ligation among the insert molecules and these multimer molecules can ligation with your dephosphoryated vector which can give dimer or multimer insert ligation which you can confirm by using vector specific primer pairs on the basis of amplicon sizes.
More appropriate is to screen 4-5 positive clones both by PCR as well as by restriction digestion and select the some of the clones based on PCR and restriction digestion results and finally confirmed by sequencing.
1) Modify your original PCR primers so that each adds a unique (=different) restriction site to your ORF to be cloned (add some extra NNs to ensure you stay in the correct reading frame).
2) Chose a vector in accordance with those restriction sites, in its multi-cloning site.
3) Double-digest the plasmid, dephosphorylate (just in case).
4) Ligate (=directional ligation with those unique restriction sites) and subclone.
5) As suggested by Ravi, control-digest the isolated subloned plasmids and/or control-PCR them with one vector-specific+one insert-specific primers.