cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_INCOMINGINVOICE_PARK using jco code

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

former_member184681
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Grzegorz,

Thanks for this. It was helpful to me.

Can you please tell me where do we define the vendor name while parking the invoice ?

or do you have any example of specific BAPI_INCOMINGINVOICE_PARK ?

That will be pretty helpful to me.

Thanks,

Nitin

former_member184681
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Grzegorz,

can you please tell what is ECC ? or if you have the link to that ?

Thanks,

Nitin

former_member184681
Active Contributor
0 Kudos

ECC = ERP = your backend system

Former Member
0 Kudos

Ok Grzegorz, thanks for helping.

Let me try these things and whatever the result is, I'll get back to you

Thanks,

Nitin

Former Member
0 Kudos

Hi Greg,

I am really close to park an invoice now I am getting one error

Item 00011 for purchasing document 4500000000 not selectable

Can you tell me how to solve this ?

Thanks,

Nitin

Former Member
0 Kudos

Probably that invoice item 00011 has been already invoiced. So you need to select different item or PO. I suggest you have a discussion with your MM functional person to understand the functionality for invoice parking and then it would be easy for you to try it with BAPI the same way.

Former Member
0 Kudos

Hi,

there is no SAP guy available here at this moment. So i'll have to solve it myself.

That error has been resolved, but now i am getting a new message

"Enter a reference to a valid goods receipt (line 000001)"

Kindly suggest

Thanks,

Nitin

Answers (0)