Skip to Content
avatar image
Former Member

BAPI to update or change XREF1_HD Field in BKPF table in RERAIV

Hi All,

After posting is done using contract number a document number is created, for that contract number we are raising invoice using RERAIV t-code.

While creating invoice for a contract number an invoice number is generated, that invoice number should be updated in XREF1_HD field in BKPF table.

I have tried using bapi_acc_document_post but bkpf table is not getting updated .Is there anyother BAPI which is used to update BKPF table?

If someone have resolved this issue please let me know.

Thanking you.

Mallikarjunan K

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 12, 2017 at 07:43 AM

    Hi dear,

    You should use below Function module after calling bapi_acc_document_post

    if sy-subrc eq 0 .
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'.

    endif.

    Then only It will update BKPF table.

    or else You need to customize your own Function module from bapi_acc_document_post.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      You need to pass some data in document header . Create one work area for document header like this.

      data: gs_head type BAPIACHE09.

      Then pass required data in it.

      gs_head-username = sy-uname.

      gs_head-comp_code = <companycode>.

      gs_head-doc_type = 'SA'. "Document Type
      gs_head-ref_doc_no = <reference text. "Reference No
      gs_head-fisc_year = <fiscal year>.

      gs_head-doc_date = <date>

      gs_head-pstng_date = <date>.

      After that pass gs_head to document header.

      Then Bapi will work.