on 06-05-2012 6:54 AM
Hi All.
I am new to sap. I need to park an invoice using BAPI_INCOMINGINVOICE_PARK using jco library.
Can anybody help me please ?
Thanks,
Nitin
Hi,
Have a look at this example by SAP on how to use JCo and let us know if you have some detailed question:
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/634503d4e9501ae10000000a42189b/content.htm
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Grzegorz,
I have the idea how to use JCo, but I need to know the details of BAPI_INCOMINGINVOICE_PARK.
When I see the input parameters for this BAPI in the java code, I see only two tables HEADERDATA and ADDRESSDATA.
Where are the other tables like ITEMDATA, TAXDATA ?
I am using this piece of code.
try {
// Get a function template from the repository
IFunctionTemplate ftemplate = repository
.getFunctionTemplate("BAPI_INCOMINGINVOICE_PARK");
// if the function definition was found in backend system
if (ftemplate != null) {
// Create a function from the template
JCO.Function function = ftemplate.getFunction();
// Get a client from the pool
client = JCO.getClient(SID);
// Fill in input parameters
JCO.Structure ret = function.getImportParameterList().getStructure("HEADERDATA");
System.out.println("ret HEADERDATA == "+ret.getMetaData());
ret = function.getImportParameterList().getStructure("ADDRESSDATA");
System.out.println("ret ADDRESSDATA == "+ret.getMetaData());
JCO.ParameterList ret2 = function.getImportParameterList();
System.out.println("parameter list = "+ret2);
Date date = new Date();
System.out.println(ret.getFieldCount());
ret.setValue("X", "INVOICE_IND");
ret.setValue(date, "DOC_DATE");
ret.setValue(date, "PSTNG_DATE");
ret.setValue("1000", "COMP_CODE");
ret.setValue(116.00, "GROSS_AMOUNT");
ret.setValue("USD", "CURRENCY");
client.execute(function);
JCO.ParameterList str = function.getExportParameterList();
System.out.println("str.getName() = "+str.getName());
} else {
}// if
} catch (Exception ex) {
System.out.println("Caught an exception: \n" + ex);
} finally {
// Release the client to the pool
JCO.releaseClient(client);
}
Thanks,
Nitin
Dear Nitin,
Good to know that you are not starting from scratch . This method getImportParameterList() gets the Import parameters (that you can see in Import tab of se37). The other (table type) parameters that you mention are returned by another method: getTableParameterList(). See an example here:
http://www.sapdev.co.uk/java/jco/jco_callfunc.htm
Regards,
Greg
Dear Nitin,
Let me give you a rod, not a fish . In ECC in transaction BAPI, locate the BAPI you are using (personally I prefer the Alphabetical tab, find IncomingInvoice there, and the method ParkFromData). Then in the Documentation tab page you will find an extended description of how to use the BAPI, with an example of how to fill the input parameters. Moreover, you can find such documentation for many of the BAPIs available.
Regards,
Greg
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.