We calculate the perturbative parts of the structure functions $F_2^c$ and $F_L^c$ for a gluon target having nonzero transverse momentum squared at order $alpha_s$. The results of the double convolution (with respect to the Bjorken variable $x_B$ and the transverse momentum) of the perturbative part and the unintegrated gluon densities are compared with HERA experimental data for $F_2^c$. The contribution from $F_L^c$ structure function ranges (10-30)% of that of $F_2^c$ at the kinematical range of HERA experiments.