on 05-11-2006 3:45 AM
Dear Mr.Craig,
Thanx a lot. We are running SRM 5.0 (RAMP - Implementation).
My initial requirement is to write a server-side script to display server date and time. Could you give more inside on how to achieve it?
Regards,
Deva.
So I understand, you want to write a PHP script which will show the server (your SRM server) date and time?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since this is PHP specific I moved it over here to the PHP forum.
Are you familiar with ABAP? Transaction SE37 in your system? You need to go there and you can do a time or date and hit F4 this will search all the available function modules on your system for one that you can access to give you the info.
Perhaps that will help.
[code]
<html>
<h1>Access System time and date</h1>
<?
// saprfc-class-library
require_once("saprfc.php");
$sap = new saprfc(array(
"logindata"=>array(
"ASHOST"=>"localhost" // application server
,"SYSNR"=>"00" // system number
,"CLIENT"=>"000" // client
,"USER"=>"bcuser" // user
,"PASSWD"=>"minisap" // password
)
,"show_errors"=>false // let class printout errors
,"debug"=>false)) ; // detailed debugging information
$result=$sap->callFunction("MSS_GET_SY_DATE_TIME",
array( array("EXPORT","SAPTIME",array()),
array("EXPORT","SAPDATE",array())));
if ($sap->getStatus() == SAPRFC_OK) {
echo "Time: ".$result["SAPTIME"];
echo "<br>Date: ".$result["SAPDATE"];
echo "<br>or<br>";
echo "Server is showing: "
.substr($result["SAPDATE"], 0, 4)
."-".substr($result["SAPDATE"], 4, 2)
."-".substr($result["SAPDATE"], 6, 2)
." and "
.substr($result["SAPTIME"], 0, 2)
.":".substr($result["SAPTIME"], 2, 2)
.":".substr($result["SAPTIME"], 4, 2);
} else {
$sap->printStatus();
}
$sap->logoff();
?>
[/code]
Dear Mr.Craig,
I worked with it. I coded inside my Intenet Service BBPSTART and HTML template BBPGLOBAL_300, but it doens't work. I changed those logon parameters before testing it.
Thanx a lot. Working with PHP should be interesting.
Rather I tried it working with SSI (Server-Side Includes). I tested it over the default website running at port 80 (with all the administration needed at server end to execute SSI's), it worked fine. But I keep guessing on how to enable SSI's inside SRM application server, which is running on port 8000. So I cudn't work find a way out.
Still struggling.
Regards,
Deva.
writing your own incredible function module would help to avoid future problems if the implementation of the MSS-function module gets changed. Here it is
FUNCTION ZTW_TIME.
*"-------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(SYSTEMDATE) TYPE SY-DATUM
*" VALUE(SYSTEMTIME) TYPE SY-UZEIT
*"-------------------------------------------------------
systemdate = sy-datum.
systemtime = sy-uzeit.
ENDFUNCTION.
Hi,
I was wondering if you could help. We have a PHP application that is calling SAP using SAPRFC. Unfortunately we need to change the target SAP IP address (the server has changed), but we don't know where this needs to change (the user who developed this application is no longer with the company).
Any help is appreciated.
Thanks.
JP
hi JP,
from a distance you can't exactly tell where the server address is saved. but ...
- mabe the app contains an admin section where the IP is being set; search the applicqation for a suitable link for admin login or seach the application's folder structure for an admin login page
- PHP-scripts are uncompiled text files. go to the folder of the application and simply do a textsearch for the old IP across all application files.
- the IP might not be hardcoded but be saved in a database. either examine the database for a suitable table holding config information or search again across all application files for a string like
$rfc = saprfc_open (array ("ASHOST"=>$server,"SYSNR"=>"20","CLIENT"=>"400",
"USER"=>"test", "PASSWD" =>"test"));
$server would be the variable holding the IP adress. Analyze the file (and possible includes) to find out how $server is retrieved.
hope it helps,
anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.