Menu

#3 date

open
nobody
None
5
2015-01-03
2003-01-30
No

Hello ,
i not understand why the bapi
SXMI_XMB_SYSLOG_READ return an error
INVALID_DATE_TIME.

i think the format of the date is YYYYMMDD but
this format don't function.

have you an idea ?

require_once("saprfc.php");

// Create saprfc-instance
$sap = new saprfc(array(

"logindata"=>array(
//
"ASHOST"=>"10.1.146.1"
// application server

"ASHOST"=>"10.1.146.7"
// application server

,"SYSNR"=>"00"
// system number

,"CLIENT"=>"008"
// client

,"USER"=>"sap*"
// user

,"PASSWD"=>"maorinz"
// password

//,"CLIENT"=>"007"
// client

//,"USER"=>"RFCUSER"
// user

//,"PASSWD"=>"Y7SR36B4"
// password

,"LANG"=>"FR"

)

,"show_errors"=>false
// let class printout errors

,"debug"=>false)) ;
// detailed debugging information

if ($sap->getStatus() == SAPRFC_OK) {
$result=$sap->callFunction("SXMI_LOGON",

array(

array
("IMPORT","EXTCOMPANY","BORCHERS"),
array
("IMPORT","EXTPRODUCT","PHP"),

array
("IMPORT","INTERFACE","XMB"),

array
("IMPORT","VERSION","0.1"),

array("EXPORT","SESSIONID"),

array("EXPORT","RETURN")

)
);

// Call successfull?
if ($sap->getStatus() != SAPRFC_OK) {
$sap->printStatus();
echo "Erreur";
exit;
}

//FUNCTION SXMI_XMB_SYSLOG_READ.
//----------------------------------------------------------------------
////Lokale Schnittstelle:
// IMPORTING
// VALUE(SERVER_NAME) LIKE TBTCJOB-
EXECSERVER DEFAULT SPACE
// VALUE(EXTERNAL_USER_NAME) LIKE
TXMILOGRAW-EXTUSER
// VALUE(FROM_DATE) LIKE SY-DATUM
DEFAULT SPACE
// VALUE(FROM_TIME) LIKE SY-UZEIT DEFAULT
SPACE
// VALUE(TO_DATE) LIKE SY-DATUM DEFAULT
SPACE
// VALUE(TO_TIME) LIKE SY-UZEIT DEFAULT
SPACE
// VALUE(LIMIT_PAGES) TYPE I DEFAULT 3
// TABLES
// SYSLOG_TBL STRUCTURE BTCSYSLOG
// EXCEPTIONS
// NOT_LOGGED_ON
// EXTERNAL_USER_NAME_MISSING
// INVALID_DATE_TIME
// INVALID_SERVER_NAME
// CANT_LOG_ACTION
// PROBLEM_DETECTED
// INVALID_PAGES
//----------------------------------------------------------------------

$result=$sap->callFunction
("SXMI_XMB_SYSLOG_READ",

array(

array
("IMPORT","EXTERNAL_USER_NAME","BORCHERS"),

array
("IMPORT","FROM_DATE","19980101"),

array
("IMPORT","FROM_TIME","010000"),

array
("IMPORT","TO_DATE","99991231"),

array
("IMPORT","TO_TIME","230000"),

array
("TABLE","SYSLOG_TBL",array())

)
);

if ($sap->getStatus() == SAPRFC_OK) {
// Yes, print out the Userlist
print "Nombre de connection : ".$result
["NUMBER_OF_ENTRIES"]."<BR>";

echo "<table width=\"75%\"
border=2>";

foreach ($result["SYSLOG_TBL"]
as $log) {
$ligne=$log["LINE"];

echo "<tr><td>".$ligne."</td></tr>";
}
echo "</table>";
} else {
// No, print long Version of last
Error
$sap->printStatus();
echo "Erreur";

}
}
$result=$sap->callFunction
("SXMI_LOGOFF",array(array
("IMPORT","INTERFACE","XMB")));
$sap->logoff();

Discussion

  • Eduard Koucky

    Eduard Koucky - 2003-01-30

    Logged In: YES
    user_id=229549

    Hello,

    I tested your example and you are right - it doesn't work.
    It seems that is some problem with handling optional
    parameters in the saprfc extension. But I need more
    investigation to find bug and solve problem.

    Please set import parametr SERVER_NAME to "" (for
    function module SXMI_XMB_SYSLOG_READ) and your
    script should work..

    Thanks,
    Eduard Koucky.

     
  • Eduard Koucky

    Eduard Koucky - 2003-01-31

    Logged In: YES
    user_id=229549

    Fixed in the saprfc 1.3.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.