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: 

BAPI_ACC_DOCUMENT_POST not updating the BKPF / BSEG.

Former Member
0 Kudos

Hi,

We are updating G/L Account through this BAPI. The BAPI is not giving any errors ..It giving success message as "Document number posted xx...successfully ".. But when I check in BKPF / BSEF ..there is no updation.

I created a test data in BAPI and commited the changes using BAPI_TRANSACTION_COMMIT.

I am giving the values as: - objecttype = 'FKKSU'

But If i give BKPF / EBKPF / BKPFF in the object type ...It is showing error . But this entry exists in tthe table ttyp.

Please let me know the problem.

Points will be awarded for useful answers.

Thanks

Hk.

11 REPLIES 11

Former Member
0 Kudos

Try with this

BAPI_ACC_GL_POSTING_POST

0 Kudos

Hi,

I tried with your FM also..but same error.

Thanks

Hk.

Former Member
0 Kudos

Hi,

Try to run back ground. I am not sure about that.

Thanks

Ravi

0 Kudos

I tried ..but it is not working..

0 Kudos

don't fill in the objecttype...

and must use 'BAPI_TRANSACTION_COMMIT' after BAPI_ACC_DOCUMENT_POST ...

Regards,

Rolf

0 Kudos

Hi Rolf,

Object type,

Object key,

Object sys are mandatory fields in BAPI_ACC_DOCUMENT_POST.

I am using BAPI_TRANSACTION_COMMIT after the bapi success.

But still database changes are not taking place.

Thanks

Hk.

0 Kudos

Hi,

Rolf is right, do as he says...dont fill in the objtype/objsys fields....dont worry about mandatory or not! Don't use 'BKPFF' etc. but fill in the header as below. After calling the BAPI use BAPI_TRANSACTION_COMMIT.


FORM fill_header.

  gd_documentheader-username   = sy-uname.
  gd_documentheader-header_txt = t_hdr-text.
  gd_documentheader-comp_code  = t_hdr-bukrs.
  gd_documentheader-doc_date   = t_hdr-bldat.
  gd_documentheader-pstng_date = t_hdr-budat.
  gd_documentheader-doc_type   = t_hdr-blart.
  gd_documentheader-ref_doc_no = t_hdr-ref.
  gd_documentheader-bus_act    = 'RFBU'.

ENDFORM.                    " fill_header

Message was edited by:

Sougata Chatterjee

0 Kudos

Hi Friends,

I solved by my own.

we no need to give objtype/objsys fields. Based on the configuration problem I am unable to get the document number. Now it is working fine.

Thanks.

Hari krishna.

0 Kudos

No, <b><u>you did not solve it on your own!</b></u> Rolf & I solved it for you!! Learn to say Thank You.

0 Kudos

Hi all,

I am having a similar issue,

I am trying to create a G/L account by using the BAPI 'BAPI_ACC_DOCUMENT_POST'. When i run my program, the Bapi is returning success message, but i am not able see the documents in BKPF/BSEG.

If i do not give the object type & object sys fields, i get error.

I saw the message from Hari mention about some customization to be done.

Can any body please help me solve this issue for me.

I have tried all different combinations & i am not able to track why its not creating any documents, even tough it returns me a success message.

I am using SAP version 7.0. And heres code that i have used to fill the header structure:

docheader-obj_type = 'REACI'.

docheader-obj_key = 'TEST'.

docheader-obj_sys = 'ECSCLNT010'.

docheader-bus_act = 'RFBU'.

docheader-username = sy-uname.

docheader-header_txt = 'HDR TEXT'.

docheader-comp_code = 'SC01'.

docheader-doc_date = sy-datum.

docheader-pstng_date = sy-datum.

CASE wa_input_tmp-batch_type .

WHEN '0'.

docheader-doc_type = 'SA'.

WHEN '1'.

docheader-doc_type = 'RA'.

ENDCASE.

Thanks in Advance,

Suresh

0 Kudos

Hi,

I am facing same problem.

Did you get the solution for yours? If so, could you pls reply me.

Thanks in advance,

Nidhya