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: 

Questions about BAPI_ACC_GL_POSTING_CHECK and BAPI_ACC_GL_POSTING_POST.

Former Member
0 Kudos

Dear Experts,

I'm using BAPI_ACC_GL_POSTING_CHECK and BAPI_ACC_GL_POSTING_POST to post GL accounting documents into SAP. they can do their job successfully, But I have some questions:

1. in BAPI_ACC_GL_POSTING_CHECK, every time it gets an FI document number from number range. No matter it checks OK or not, the number cannot be used anymore.

Can I put the number back if check error? Or should I use another function module?

2. The functions did not check 'amount' field. if amount = 0, it gave me "check successfully" or "post successfully" in return message. But actually, I cannot find any document in BKPF and BSEG. the number is used too.

Do you know any other function modules can give me actual message about the post result?

Thank you for your answer.

Joanne

6 REPLIES 6

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Joanne,

In the BAPI use the structure RETURN in the interface, for instance T_RETURN,

After, do this coding, and for instance, store in a customer table (ztable)


 READ TABLE t_return WITH KEY type   = 'S'
                               id     = 'RW'
                               number = '605'.

    UPDATE ztable
       SET belnr = t_return-message_v2(10)
           bukrs = t_return-message_v2+10(4)
           gjahr = t_return-message_v2+14(4)
      WHERE ....

Or debug after the BAPI and see the data for T_RETURN.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Hi

Something doesn't sound good:

1. in BAPI_ACC_GL_POSTING_CHECK, every time it gets an FI document number from number range. No matter it checks OK or not, the number cannot be used anymore.

Can I put the number back if check error? Or should I use another function module?

The BAPI_ACC_GL_POSTING_CHECK shouldn't get any FI number, this BAPI is for the checking only

2. The functions did not check 'amount' field. if amount = 0, it gave me "check successfully" or "post successfully" in return message. But actually, I cannot find any document in BKPF and BSEG. the number is used too. 
Do you know any other function modules can give me actual message about the post result?

In generally if a single item has amount equal to 0 is ignored, so the document can be posted, the problem can be all items have the amount equal to 0: but this is very strange posting and it should be checked before posting it.

Max

0 Kudos

To Eduardo,

I got the Successful message in table RETURN. but still no data in BKPF and BSEG.

To Max,

if i don't give OBJ_KEY in DOCUMENTHEADER, the BAPI had error message in RETURN.

Please help, thanks!

Joanne

0 Kudos

Hi

You don't need to transfer OBJ_KEY

Max

0 Kudos

Hi

Are you using 'BAPI_TRANSACTION_COMMIT' after the BAPI? See SAP Note 306504 - Collective note: BAPIs for the AC

interface

Regards

Eduardo

edgar_almonte
Participant
0 Kudos

like Mr E_HINOJOSA say , need the do the commit before BAPI_ACC_GL_POSTING_POST