if you could refer me to an example about hardware serial connection i would be very greatful
The pins for the hardware serial ports are clearly labeled on the Mega. Pick a pair with matching numbers, like TX2 and RX2. Then, remove the #include of the SoftwareSerial header file, and replace all occurrences of GPRS with SerialN, where N matches the TXN and RXN values.