09-29-2011 10:45 AM
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
09-29-2011 10:56 AM
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
09-29-2011 11:18 AM
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
09-29-2011 11:59 AM
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
09-29-2011 1:42 PM
09-29-2011 3:10 PM
Hi
Are you using 'BAPI_TRANSACTION_COMMIT' after the BAPI? See SAP Note 306504 - Collective note: BAPIs for the AC
interface
Regards
Eduardo
09-29-2011 4:04 PM
like Mr E_HINOJOSA say , need the do the commit before BAPI_ACC_GL_POSTING_POST