cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Experts,

I am posting invoices using BAPI_INCOMINGINVOICE_CREATE. These invoices have POs associated with the Item Details. This is working fine for me.

I want to post invoices that DO NOT have a PO. Can someone please point me to a BAPI that is similar to BAPI_INCOMINGINVOICE_CREATE in functionality but does not require a PO?

Thanks,

- Vik.

0 Likes
View Entire Topic
Former Member
0 Likes

I too was looking for a BAPI for non PO invoice posting. I found that the above counsel did not work for me. Instead of creating a buyside invoice, it just created a journal entry. What DID work for me was BAPI_ACC_INVOICE_RECEIPT_POST.

Below, I am pasteing the subroutines that I created for its calling. In it, for my purposes, only the invoice amount is parameter driven. My needs allowed all other BAPI parameters to stay the same.

I hope that this helps someone.

Donald Nigro

-


FORM create_buyside_invoice USING value(invoice_amt) TYPE p.

DATA:

gd_documentheader LIKE bapiache03,

it_accountpayable LIKE bapiacap03 OCCURS 0 WITH HEADER LINE,

it_accountgl LIKE bapiacgl03 OCCURS 0 WITH HEADER LINE,

it_accounttax LIKE bapiactx01 OCCURS 0 WITH HEADER LINE,

it_currencyamount LIKE bapiaccr01 OCCURS 0 WITH HEADER LINE,

it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

DATA:

wa_obj_key(20) TYPE c.

  • fill header

gd_documentheader-username = sy-uname.

gd_documentheader-header_txt = 'E-Payables Invoice'.

gd_documentheader-comp_code = 'EAUS'.

gd_documentheader-doc_date = sy-datum.

gd_documentheader-pstng_date = sy-datum.

gd_documentheader-doc_type = 'KR'.

CONCATENATE 'BOA' sy-datum sy-uzeit(4)

INTO gd_documentheader-ref_doc_no.

  • fill AP (line 1)

it_accountpayable-itemno_acc = 1.

IF sy-sysid(3) = 'DEV'.

it_accountpayable-vendor_no = '0600013370'.

ELSE.

it_accountpayable-vendor_no = '0600009022'.

ENDIF.

APPEND it_accountpayable.

  • fill GL (line 2)

it_accountgl-itemno_acc = 2.

it_accountgl-gl_account = '0001112227'.

it_accountgl-comp_code = 'EAUS'.

it_accountgl-pstng_date = sy-datum.

it_accountgl-fisc_year = sy-datum(4).

it_accountgl-fis_period = sy-datum+4(2).

it_accountgl-bus_area = '0100'.

APPEND it_accountgl.

  • fill currency ammounts for lines 1 & 2

it_currencyamount-currency = 'USD'.

it_currencyamount-itemno_acc = 1.

it_currencyamount-amt_doccur = invoice_amt * -100.

APPEND it_currencyamount.

it_currencyamount-itemno_acc = 2.

it_currencyamount-amt_doccur = invoice_amt * 100..

APPEND it_currencyamount.

CALL FUNCTION 'BAPI_ACC_INVOICE_RECEIPT_CHECK'

EXPORTING

documentheader = gd_documentheader

TABLES

accountpayable = it_accountpayable

accountgl = it_accountgl

accounttax = it_accounttax

currencyamount = it_currencyamount

return = it_return.

PERFORM invoice_error_check TABLES it_return.

CALL FUNCTION 'BAPI_ACC_INVOICE_RECEIPT_POST'

EXPORTING

documentheader = gd_documentheader

IMPORTING

obj_key = wa_obj_key

TABLES

accountpayable = it_accountpayable

accountgl = it_accountgl

accounttax = it_accounttax

currencyamount = it_currencyamount

return = it_return.

PERFORM invoice_error_check TABLES it_return.

COMMIT WORK.

WRITE: / 'ePayables Bank of America'.

WRITE: / ' Invoice Document Number:',

wa_obj_key(10).

ENDFORM.

----


  • Form invoice_error_check

----


FORM invoice_error_check TABLES it_return STRUCTURE bapiret2.

DATA:

bapi_success(5) TYPE c VALUE 'false'.

LOOP AT it_return.

IF it_return-type = 'S' AND bapi_success = 'false'.

bapi_success = 'true'.

ENDIF.

ENDLOOP.

IF bapi_success = 'false'.

WRITE: / 'Unable to post a buyside invoice with',

'BAPI_ACC_INVOICE_RECEIPT_POST'.

LOOP AT it_return.

WRITE: / 'Message Type: ', it_return-type,

/ 'Message Class: ', it_return-id,

/ 'Message Number: ', it_return-number,

/ 'Message: ', (80) it_return-message.

ENDLOOP.

ROLLBACK WORK.

STOP.

ENDIF.

ENDFORM.