on 09-11-2007 11:01 AM
Hi all,
I am new to JSP's. I need java scriptlet code for jsp initialization.Also in my jsp page i need to make a link and on clicking, this link should fetch data from the backend R3 system.
Suggest some help.
Pooja Gehani
I think You need to read something about JCO (JavaConnector) - is java based library thanks to it You can make calls to function modules in R3 system (for example fetch data using some function module). When it comes to jsp please check some tutorials in SDN or Google cause it is difficult to explain You jsp technology in few words.
Below is example of jsp page which connects to R3 System, invoke some function with some parameters, gets return table and save it to file rettab.html.
Remeber to add sapjco.jar to classpath.
Please reward points if it was helpful.
<%@ page import = "com.sap.mw.jco.JCO.*" %>
<HTML>
<head>
</head>
<body>
<%
JCO.Client mConnection;
mConnection = JCO.createClient("001","koperski","password",null,
"127.0.0.1","01");
JCO.Repository mRepository;
mRepository = new JCO.Repository("myRep", mConnection);
try {
mConnection.connect();
IFunctionTemplate funcTemplate =
mRepository.getFunctionTemplate("someFunction");
JCO.Function function = funcTemplate.getFunction();
ParameterList parameterList = function.getImportParameterList();
parameterList.setValue("0010000000082","someParameter");
JCO.Table retTable =
function.execute(); function.getTableParameterList().getTable("SomereturnTab");
retTable.writeHTML("f:\rettab.html");
mConnection.disconnect();
catch (Exception e) {}
%>
</body>
</HTML>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.