Inserting values in to fields through server side script

Well i am trying to enter the details into a stock entry from the details obtained from batch doctype ,although it was not showing an error but i am not getting anything …can anyone please help me out from this …