‎2014 Apr 29 2:13 PM
Hey, Guys
Is there any possible way to connect PHP with our ABAP?How?
just like PHP with my MYSQL.
‎2014 May 14 6:39 AM
Hello Darshan & Mike,
Please write a Function Module as RFC then try with follwing code.
Write into notepad saveas 'php2abap.php'
$host = "dessrv011"; // DEV 00 666
$sysnr = 00;
$client = 666;
$user = "phpusr";
$passwd = "port#ph1";
$codepage = 1404;
$login = array ( "ASHOST"=>"$host",
"SYSNR"=>"$sysnr",
"CLIENT"=>"$client",
"USER"=>"$user",
"PASSWD"=>"$passwd",
"CODEPAGE"=>"$codepage");
//Try to connect to SAP using our Login array
$rfc = saprfc_open ($login );
if (!$rfc) { echo "The RFC connection failed with the following error:".saprfc_error(); exit; }
//Discover interface for function module YMT_TESTFI
$fce = saprfc_function_discover($rfc,"YMT_TESTFI");
if (! $fce ) { echo "Discovering interface of function module failed"; exit; }
after complete 'php2abap.php', you run through internet explorer as
http://localhost/test/php2abap.php
Thanks
Manob
‎2014 May 13 6:19 PM
‎2014 May 14 6:39 AM
Hello Darshan & Mike,
Please write a Function Module as RFC then try with follwing code.
Write into notepad saveas 'php2abap.php'
$host = "dessrv011"; // DEV 00 666
$sysnr = 00;
$client = 666;
$user = "phpusr";
$passwd = "port#ph1";
$codepage = 1404;
$login = array ( "ASHOST"=>"$host",
"SYSNR"=>"$sysnr",
"CLIENT"=>"$client",
"USER"=>"$user",
"PASSWD"=>"$passwd",
"CODEPAGE"=>"$codepage");
//Try to connect to SAP using our Login array
$rfc = saprfc_open ($login );
if (!$rfc) { echo "The RFC connection failed with the following error:".saprfc_error(); exit; }
//Discover interface for function module YMT_TESTFI
$fce = saprfc_function_discover($rfc,"YMT_TESTFI");
if (! $fce ) { echo "Discovering interface of function module failed"; exit; }
after complete 'php2abap.php', you run through internet explorer as
http://localhost/test/php2abap.php
Thanks
Manob
‎2014 May 14 6:55 AM
Hi Manob,
Here the problem is of the usage saprfc_open like functions which RFC prvides.
I couldn't install the extension saprfc to my php version. So that I am not being able to use any of those functions.
I am using PHP 5.3.8 on windows (32bit)
I tried many ways to install saprfc extension, but it doesn't seems to be working. Due to not having the proper compilation of the extension which suits to my php version.
So if you have ever done this, please share.
Thanks Again!
Mike
‎2014 Dec 23 2:52 PM
Hi, You can follow the link
Connecting SAP and PHP | Ramindu Deshapriya
Credits to blogger, hope this help!
Regards