Arduino GSM Sensor interfacing without shield

I’am trying to combine a program to interface an ultrasonic sensor and a gsm module

it doesn’t work together (though it works perfectly fine when interfacing is done separately )

Also I would like to know what a shield is … is it absolutely necessary to use one in this situation???

code
:
#include <SoftwareSerial.h>
//#include <SoftwareSerial.h>

#define trigger 3
#define echo 4
int time_;
float distance, dist_limit = 20.00;//cms
String pilih;

int buzz = 13;

void setup()

{

Serial.begin(9600); // Setting the baud rate of GSM Module

Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)

//RecieveMessage();

delay(100);
pinMode(buzz, OUTPUT);
pinMode(trigger, OUTPUT);
pinMode(echo, INPUT);
digitalWrite(buzz, LOW); //set the buzzer in off mode (initial condition)

}

void loop()

{ int c=ultrasound();
if (c==1)
{
digitalWrite(buzz,HIGH);

if (Serial.available()>0)
SendMessage();
}
else
{
digitalWrite(buzz,LOW);
}

}

void SendMessage()

{

Serial.println(“AT+CMGF=1”); //Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second

Serial.println(“AT+CMGS=”+9072433114"\r"); // Replace x with mobile number

delay(1000);

Serial.println(“Message Send :)”);// The SMS text you want to send

Serial.println(pilih);

delay(100);

Serial.println((char)26);// ASCII code of CTRL+Z

delay(1000);

}

int ultrasound(void)
{
digitalWrite(trigger, HIGH);
delayMicroseconds(10);
digitalWrite(trigger, LOW);
time_ = pulseIn(echo,HIGH);
distance = time_*0.01725;
Serial.println(distance);
if (distance <= dist_limit)
return 1;
else
return 0;
}

You use softwareserial incorrectly. see examples

Sorry I'm new to programming.... ...... Can you please show an example? Thank you

There is an examle in your IDEs menu:
‘file’ - ‘examples’ - ‘Softwareserial’. (two examples to be found…)

This is one of them:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}