It appears that your code has some debugging statements it prints to the serial port. You should be able to program your arduino and monitor the output on the serial port to look at the messages are being printed. That will help you isolate the problem. Your starting point is to see what messages are being printed to the arduino serial monitor (Ctrl+Shift+M) in the Arduino IDE when your sketch is running. Try to write out some more messages using Serial.println() as debugging aids between the different steps. If your sketch is based on this one, are you seeing "failed" messages in your serial monitor? This would indicate that the connection is being dropped. etc.
Note that based on just this code snippet, depending on how often you call this function, you could be trying to post to http://www.thingspeak.com every 0.02 seconds. This is likely just wasting your GPRS data as the current data rate to http://www.thingspeak.com is one write per channel every 15 seconds.