Application Development and Automation 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: 
Read only

bapi for FB60

Former Member
0 Likes
2,019

Hi,

I need to create an accounting number via BAPI for FB60 T.code.

Is there any BAPI readily available for posting document for FB60.

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
1,296

FB60(Creditor) is only a subset of FB01 (genral postings). So you could use bapi BAPI_ACC_DOCUMENT_POST

or good old abap RFBIBL00

A.

6 REPLIES 6
Read only

andreas_mann3
Active Contributor
1,297

FB60(Creditor) is only a subset of FB01 (genral postings). So you could use bapi BAPI_ACC_DOCUMENT_POST

or good old abap RFBIBL00

A.

Read only

Former Member
1,296

Hi,

BAPI_INCOMINGINVOICE_CREATE

BAPI_ACC_INVOICE_RECEIPT_POST

BAPI_ACC_DOCUMENT_POST

Read only

0 Likes
1,296

I am not using po reference here.

Whether BAPI_INCOMINGINVOICE_CREATE is useful to create vendor invoice.any sample code there.

Read only

0 Likes
1,296

Here is my test code, it may help you

REPORT  zsl_teste.

DATA: header_data LIKE bapi_incinv_create_header,
      item_data LIKE bapi_incinv_create_item OCCURS 0,
      acc_data LIKE bapi_incinv_create_account OCCURS 0,
      t_return LIKE bapiret2 OCCURS 0.

DATA: inv_doc LIKE bapi_incinv_fld-inv_doc_no,
      fis_year LIKE bapi_incinv_fld-fisc_year.

PERFORM fill_header.
PERFORM fill_item.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
  EXPORTING
    headerdata                = header_data
*   ADDRESSDATA               =
 IMPORTING
   invoicedocnumber          = inv_doc
   fiscalyear                = fis_year
  TABLES
    itemdata                  = item_data
*   ACCOUNTINGDATA            =
*   GLACCOUNTDATA             =
*   MATERIALDATA              =
*   TAXDATA                   =
*   WITHTAXDATA               =
*   VENDORITEMSPLITDATA       =
    return                    = t_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.


*&---------------------------------------------------------------------*
*&      Form  fill_header
*&---------------------------------------------------------------------*
FORM fill_header .

  header_data-invoice_ind = 'X'.
*header_data-DOC_TYPE
  header_data-doc_date = '20080202'."mandatory
  header_data-pstng_date = '20080202'."mandatory
*header_data-REF_DOC_NO = '12345'.
  header_data-comp_code = 'Z001'."mandatory
  header_data-currency = 'EUR'."mandatory
  header_data-gross_amount = 100.

ENDFORM.                    " fill_document_header
*&---------------------------------------------------------------------*
*&      Form  fill_item
*&---------------------------------------------------------------------*
FORM fill_item .

  DATA: wa_item_data LIKE bapi_incinv_create_item.

  wa_item_data-invoice_doc_item = '00001'.
  wa_item_data-po_number = '4500000021'.
  wa_item_data-po_item = '00010'.
*wa_item_data-REF_DOC = '12345'.
*item_data-REF_DOC_YEAR
*item_data-REF_DOC_IT
*item_data-DE_CRE_IND
  wa_item_data-tax_code = 'S2'.
*item_data-TAXJURCODE
  wa_item_data-item_amount = 100.
  wa_item_data-quantity = 10.
  wa_item_data-po_unit = 'CS'.
  wa_item_data-po_unit_iso = 'CS'.

  APPEND wa_item_data TO item_data.

ENDFORM.                    " fill_i

Read only

0 Likes
1,296

but here u r using the reference of the PO number here.

In FB60 we are not referring any po number.guide me if am wrong

Read only

0 Likes
1,296

HI,

Using BAPI_ACC_DOCUMENT_POST should do be able to post the document for FB60. However, you can plan on using one of the following two as alternative:

AC_DOCUMENT_CREATE

POSTING_INTERFACE_DOCUMENT

For your [referrence|;.

May it helps you.

Regards.

DS