on 01-15-2007 10:15 PM
Hello,
I would like to export data with IDOC using JCo. There is a sample of program with some fonction which will help me to do this.
I understand how they connect to SAP server .But I still have a problem with the method who create the IDOC with the following code:
protected void handleRequest(JCO.Function function)
{
System.out.println("Incoming function request '" + function.getName() + "'...");
String filename = function.getName() + "_" +
timestampFormat.format(new java.util.Date()) + ".xml";
System.out.println("Storing function request as XML file '" + filename + "'...");
function.writeXML(incomingPath + filename);
I don't know what is the type JCO.Function and I have no idea what parameters I have to put in. For information we try to export the IDOC LOIPR01.
I found this help in JCo but it is not clear for me:
public static class JCO.Function
extends java.lang.Object
implements java.io.Serializable
Class that represents a function. A function consists of name, an import parameter list, an export parameter list and a table parameter list.
JCO.Function(IFunctionTemplate template)
Creates an instance of the function from a template
JCO.Function(java.lang.String name)
Creates an instance of the function
JCO.Function(java.lang.String name, JCO.ParameterList input, JCO.ParameterList output, JCO.ParameterList tables)
Creates an instance of the function
Hi,
You have to understand how the JCo Server programs works. The JCo server program runs and waits for requests from an foreign system (ABAP or what else is supported).
E.g. processing in ABAP works as followed. You have a function module which has a defined RFC connection which is defined in transaction SM59 and has as defined server program the JCo Server program id. If the function module is now executed it sends the request over the RFC connection to the JCo Server which now his states. Now handleRequest( ... ) is processed with the mapped function module as parameter.
Have a look at the JCo examples to understand how this works. I thing that the processing of the IDOCs will be clearer.
regards
daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.