Skip to Content
After two “Tasting the mix of Ruby and SAP” blogs…I found some time for a new “PHP” blog. body {background} #login {background} if(isset($_POST[‘LOG_IN’]) || isset($_GET[‘LOG_IN’]) ) { if(!isset($_SESSION[“Server”])) { $_SESSION[“Server”] = $_POST[“Server”]; $_SESSION[“Sysnum”] = $_POST[“Sysnum”]; $_SESSION[“Client”] = $_POST[“Client”]; $_SESSION[“User”] = $_POST[“User”]; $_SESSION[“Pass”] = $_POST[“Pass”]; } $Login = new Login(); $Log_Me = $Login->Log_In($_SESSION[“Server”],$_SESSION[“Sysnum”],$_SESSION[“Client”], $_SESSION[“User”],$_SESSION[“Pass”]); $RFC_Me = $Login->RFC_Connection($Log_Me); $Program = $_SESSION[“Program”]; $Program = str_replace(” “,” “,$Program); $Program = str_replace(” ‘”,”‘”,$Program); $Prog_Name = $_SESSION[“Prog_Name”]; $Mode = $_SESSION[“Mode”]; if($Mode == “”) { $Mode = “F”; } ECHO “fce,”PROGRAM”); foreach($Program_Lines as $Line) { $Line = trim($Line); $Line = str_replace(” “,” “,$Line); $PROGRAM = array(“LINE”=>$Line); saprfc_table_append ($this->fce,”PROGRAM”,$PROGRAM); } $rfc_rc = “”; $rfc_rc = saprfc_call_and_receive ($this->fce); if ($rfc_rc != SAPRFC_OK) { if ($rfc == SAPRFC_EXCEPTION ) echo (“Exception raised: “.saprfc_exception($this->fce)); else echo (“Call error: “.saprfc_error($this->fce)); exit; } $Error = saprfc_export ($this->fce,”ERRORMESSAGE”); if($Error == “”) { $Writes_Row = saprfc_table_rows ($this->fce,”WRITES”); for($i=1; $i<=$Writes_Row ;$i++) { $Write_Line = saprfc_table_read ($this->fce,”WRITES”,$i); $Program_Line[$i] = $Write_Line[‘ZEILE’]; ECHO $Program_Line[$i]; ECHO ” “; } } else { ECHO $Error; } ECHO ” “; PRINT(“”); PRINT(” “); PRINT(”   “); PRINT(” “); ECHO ” “; } } ?> With our class up and running, we can write the pseudo Development Environment. image Development.php body {background:#F5F9FF} #login {background} if(isset($_POST[“PROGNAME”])) { $SE38 = new SE38(); $Login = new Login(); $Log_Me = $Login->Log_In($_SESSION[“Server”],$_SESSION[“Sysnum”],$_SESSION[“Client”], $_SESSION[“User”],$_SESSION[“Pass”]); $RFC_Me = $Login->RFC_Connection($Log_Me); $SE38->Show_Program($_POST[“MODE”],$_POST[“PROGNAME”],$_POST[“PROGRAM”],$RFC_Me); } else { echo ” h2. You must enter the program name! “; ECHO ” “; PRINT(“”); PRINT(” “); PRINT(”   “); PRINT(” “); ECHO ” “; } ?> Now, were done…Let’s the result of running our little program. image
To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

    1. Alvaro Tejada Galindo Post author
      Thanx for your comment Subramanian…Actually, I thought about using sessions…But I didn’t thought on Gregor’s solution…Now I can fix it -;)

      Greetings,

      Blag.

      (0) 
    1. Alvaro Tejada Galindo Post author
      Hey Gregor:

      You always save me! -:) How is that I didn’t think on that solution? I’m going to update my blog tonight…I think I need to sleep more -:P

      Greetings,

      Blag.

      (0) 
  1. Andre Labahn
    Hi Blag,

    this is a great example of how to use PHP and SAP. It´s too bad that you can´t demonstrate this to the community at the SDN day or SAP TechED.

    regards andré

    (0) 
    1. Alvaro Tejada Galindo Post author
      Hi Andre:

      Yeah, I know -:'( As I told by mail…I really feel bad about it…Still…There’s more SAP events to come…And there’s more blogs and examples to write…So, I’m planning to do something really good to impress you all next time -;)

      Greetings,

      Blag.

      (0) 
      1. Alvaro Tejada Galindo Post author
        Thanx John! Great to see you again! -:) Wanted to write you, but could find anything in you business card -:(

        Welcome back…And…When are going to see another of your great blogs???

        Greetings,

        Blag.

        (0) 

Leave a Reply