Applet Example

Team-Fly

This example walks you through setting up an applet using one of the sample pieces of code that comes with the Java RFC toolkit. The specific example is the RfcGetCustomer sample, which logs in to a SAP system and then retrieves data on customers that you specify. The easiest way to set up this applet is to build an HTML page that points to the class files that come with the Automation toolkit. Using the default path, they are located at

\Sap\SAPAuto45A\Auto2\Jrfc\client\classes\JrfcSamples\

When building the HTML page, you also need to set the CODEBASE parameter for the APPLET tag to point to the classes directory, as shown in the sample HTML that follows. For this example I created the HTML file in the directory that contains the applet code.

<!-Test HTML page for Java Sap Applet functions -> <html> <head><title>Test Page for Java Sap Applets</title> </head> <body> <applet code=JRfcSamples/RfcCustomerGet/Applet/GetCustomerApplet.class          codebase=/Sap/SAPAuto45A/Auto2/Jrfc/Client/classes     height=500      width=750 >  Java not supported with this browser </applet> </body> </html>

Executing this HTML file will produce a screen similar to that in Figure 5.12.

click to expand

Figure 5.12: Sample of GetCustomerApplet executed in a browser

This example can also be modified so that certain variables, such as login and password, are set up in the HTML script instead of through the input prompts. More details on setting up applets in HTML and the HTML language in general are given in Appendix B, 'Basic HTML Reference.'


Team-Fly


Java & BAPI Technology for SAP
Java & BAPI Technology for SAP
ISBN: 761523057
EAN: N/A
Year: 1998
Pages: 199

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net