Table Export Excell with PHP (Charts and Table)
System Requirements
-Apache Web Server
-PHP
-SAPRFC (PHP Addon)
-PHPExcell
1-) Download PHPExcell library
Download Link : https://phpexcel.codeplex.com/releases/view/119187
2-) Download and Install SAPRFC
Download Link : SAPRFC Homepage
- Installation
1) Extract zip file saprfc-$VERSION$-$PHP_VERSION$.zip
2) Copy php-saprfc.dll to your extensions directory (e.g. C:\PHP\extensions)
3) Edit php.ini file (in windows system dircetory, e.g. C:\WINNT, C:\WINDOWS)
and add line: ‘extension=php_saprfc.dll’
4) Copy librfc32.dll (from SAPGUI install CD) to the windows system
directory or simple install SAPGUI on your machine.
3-) Creating SAP Table
We have added the time in the (H.i) format database. Example : 01.00 , 03.00 . You must add them in this way.Otherwise, the application will not work correctly.
Example :
SAP TABLE – TIME – | PHP APPLICATION CONVERT |
---|---|
01.00 | 01:00 |
08.00 | 08:00 |
4-) Create Function Module
The Function Module is attached.
File : ZREPORT_ASCENDINGDATE.txt
The important line in the function module :
SELECT * FROM (QUERY_TABLE) INTO <WA> WHERE (OPTIONS) ORDER BY TIME ASCENDING .
This function module is edited from RFC_READ_TABLE .
5-) Build PHP Application
PHP files is attached.
File : connect.txt
File : excellreport.txt
You must edit connect.php .