cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

sivakumar_mobility
Active Participant
0 Kudos

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.

0 Kudos

Hi Shiva,

But the header structure 'DOCUMENTHEADER' has no field which can be used for this purpose. How can i solve this problem?

Regards

Mallikarjunan K

sivakumar_mobility
Active Participant
0 Kudos

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.