on 01-15-2008 1:15 PM
Hello SAP experts,
I´m a student from Germany. I have a Problem with die Exportparameter of a SAP Function in a JAVA
Application.
The Function in the SAP System works. Ihe Importparameter and the Exportparameter of the Funktion also.
I tested it in the SAP System. But the Exportparamter in my JAVA Application in the Form of a String
unfortunately has the Value of null.
Here ist my Coding:
import com.sap.mw.jco.*;
import com.sap.mw.jco.JCO.ParameterList;
import java.util.*;
import java.io.*;
public class JCOTestString {
public static JCO.Client client;
public static final String SID = "SAP System";
public static IRepository repository;
public static void main(String[] args){
try {
JCO.Pool pool = JCO.getClientPoolManager().getPool(SID);
if (pool == null) {
int maxConnections = 1;
JCO.addClientPool(SID, maxConnections,
"00",
"RFC",
"password",
"DE",
"sapserver",
"00");
}
repository = JCO.createRepository("Repository", SID);
IFunctionTemplate ftemplate = repository
.getFunctionTemplate("Z_TEST");
JCO.Function function = new JCO.Function(ftemplate);
function.getImportParameterList().setValue("KEY", "TEST1");
String g = function.getExportParameterList().getString("RESULT");
System.out.print(g); //---> unfortunately NULL
} catch (Exception e) {
JCO.releaseClient(client);
// Fehler falls catch ausgeführt wird.
System.out.println("Fehler abgefangen:
" + e);
}
JCO.releaseClient(client);
}
}
Is anyone able to help me and to solve the Problem?
Regards
Marc
Hello Marc,
In your code i am missing the
"client.execute(function);"
That is to be done after the setvalue of the import!!
Good Luck,
Dharmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.