Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Example program for BAPI_INCOMINGINVOICE_CREATE

Former Member
0 Kudos

Hi Exports

Can anyone send me the example program to post the vendor Invoice using the bapi BAPI_INCOMINGINVOICE_CREATE.

Thanks in advance.

Regards

Rajaram

8 REPLIES 8

Former Member
0 Kudos

check this..

program.......LBBPIU01

0 Kudos

can you give any other example program pls,

regards

rajaram

0 Kudos

When i try the following code to post the invoice, am getting the following error,

Enter goods receipt data only when working with GR-based IV

What could be the reason, pls advise me ont his.

data:it_head like bapi_incinv_create_header,

it_item like bapi_incinv_create_item occurs 0 with header line,

it_acct like bapi_incinv_create_account occurs 0 with header line,

it_gl like bapi_incinv_create_gl_account occurs 0 with header line,

it_mat like bapi_incinv_create_material occurs 0 with header line,

it_ven like bapi_incinv_create_vendorsplit occurs 0 with header line,

it_ret like bapiret2 occurs 0 with header line.

data: inv_doc like bapi_incinv_fld-inv_doc_no,

fisc_yr like bapi_incinv_fld-fisc_year.

data: zinvdoc(50) type c, zfiscyr(30) type c.

*fill the data....

clear it_head.

move 'x' to it_head-invoice_ind.

move '1000' to it_head-comp_code.

move sy-datum to it_head-doc_date .

move sy-datum to it_head-pstng_date .

move '27-61725' to it_head-ref_doc_no .

move '200' to it_head-gross_amount .

move 'inr' to it_head-currency .

move '27-61725' to it_head-item_text .

move '1WEAVIN20' to it_head-diff_inv .

move 're' to it_head-doc_type .

move sy-datum to it_head-bline_date.

move '2' to it_head-pmtmthsupl.

move 'a' to it_head-pmnt_block.

move 'z' to it_head-pymt_meth.

move '0001' to it_head-pmnttrms.

clear it_item.

it_item-po_number = '4511007408'.

it_item-po_item = '10'.

  • it_item-item_amount

  • it_item-po_unit

it_item-invoice_doc_item = '00001'. " ( i don't know what this is for so i gave this no.)

  • it_item-freight_ve

append it_item.

break sd02.

call function 'BAPI_INCOMINGINVOICE_CREATE'

exporting

headerdata = it_head

  • addressdata

importing

invoicedocnumber = inv_doc

fiscalyear = fisc_yr

tables

itemdata = it_item

  • accountingdata

  • glaccountdata

  • materialdata

  • taxdata

  • withtaxdata

  • vendoritemsplitdata

return = it_ret.

Regards

Rajaram

Former Member
0 Kudos

solved myself

0 Kudos

Hi

I am facing the same problem

"Enter goods receipt data only when working with GR-based IV" while calling "bapi_incominginvoice_create".

Can you please share the resolution.

Thanks & Regards

Ruhi Hira

0 Kudos

Hi,

according to the documentation of BAPI_INCOMINGINVOICE_CREATE when the WEBRE flag (Goods Receipt based Invoice Verification) is checked on the referred PO, you must also fill the following fields in the ItemData table:

REF_DOC (Goods receipt document)

REF_DOC_YEAR (Fiscal year of current period)

REF_DOC_ITEM (Goods receipt document item)

Regards,

Antonio

0 Kudos

Thanks, your comment was really helpful!