This is what I did, changed the keypad pin from 4 to 15.
I added the following code in the setup
while(!mySerial){ ; }
delay(500);
///////////////////////////////SD_Memory
Serial.print("Initializing SD card...");
if (!SD.begin(4)) { Serial.println("initialization failed!"); return; }
Serial.println("initialization done.");
This is a link to the barcode scanner that I used
http://playground.arduino.cc/ComponentLib/BarcodeScanner
and I added this code before the setup
#include <SPI.h>
#include <SD.h>
File myFile;
But the SD card did not initialised