on 09-04-2004 5:40 PM
Hello Friends,
I am facing problem in oder to bring data from SAP system. Actually I am calling a BAPI "BAPI_DEBTOR_GETDETAIL" to show the details of the debtor. Here is the code,
JCO.Repository repository = new JCO.Repository("call" , mConnection);
IFunctionTemplate template = repository.getFunctionTemplate("BAPI_DEBTOR_GETDETAIL");
JCO.Function function = template.getFunction();
function.getImportParameterList().setValue(0000000001 , "DEBTORID");
JCO.Structure str = function.getExportParameterList().getStructure("DEBITOR_GENERAL_DETAIL");
System.out.println("NAME: " + str.getString("NAME"));
The customer 1 is already existed in the system. Please advise me if this the right way, to send the parameter with setValue method (cause atleast it did not give me any exception). And also please advise me how to bring the customer information, cause when i write this
System.out.println("NAME: " + str.getString("NAME"));
It does not print any thing!
Many thanks in advance!
Haider Syed.
Hello,
the problem is in this line:
function.getImportParameterList().setValue(0000000001 , "DEBTORID");
it should be:
function.getImportParameterList().setValue("0000000001" , "DEBTORID");
if you had read the RETURN Structure you would have get more information
JCO.Structure ret = function.getExportParameterList().getStructure("RETURN");
System.out.println("BAPI_DEBTOR_GETDETAIL RETURN: " + ret.getString("MESSAGE"));
If you want more information about the Customer I think it's better to use "BAPI_CUSTOMER_GETDETAIL2".
Reagards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Gregor,
Thanks for your reply,
I have tried now with this:
function.getImportParameterList().setValue("0000000001" , "DEBTORID");
but still it does not print the name of the debetor??
Any suggestions please.
With Regards,
Haider Syed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Gregor,
Yes, your answer was very helpful, and I have already awarded u the points, Thanks indeed, but I dont know why we need to send parameters in "",
The actual problem was, I forgot to execute the function,
mConnection.execute(function);
But after executing the function, it shows me the required information.
With Regards,
Haider Syed
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.