Skip to Content

Bapi BAPI_ACC_DOCUMENT_POST is not auto deriving G/L account for Asset journal entries posting.

Feb 20 at 04:57 PM


avatar image
Former Member

Hi Gurus,

I'm using bapi BAPI_ACC_DOCUMENT_POST to post journal entries. I'm getting the input data in an excel file. Bapi is working fine for other cases like vendor etc. except for the Asset scenario.

When we post Asset journal entries manually through FB01 transaction the asset G/L will be derived automatically due to this reason i'm not getting the G/L account corresponding to Asset record in input file but G/L is mandatory field in BAPI.

My requirement is to get the asset G/L account on the basis of company code, Asset number, Asset subnumber & Transaction Type.

I already tried the below logic:-

Pass Company code(BUKRS), Asset number(ANLN1) & Asset sub number(ANLN2) in ANLA table & get Account determination(KTOGR). After fetching Account determination(KTOGR) from ANLA, Pass it in T095 table along with Chart of accounts(KTOPL) as ‘GCCA’ & Real depreciation area(AFABE) as ‘1’ and get KTANSW(Bal. sheet account: Acquisition & production costs). Use KTANSW as Asset G/L account. I'm able to post asset entries though this logic.

But as per my functional the G/L should be derived in combination of asset number & transaction type because corresponding asset G/L might change accordingly as this combination will change. My functional consultants are not providing me the logic to derive the G/l because it is auto derived in Standard SAP.

I really appreciate your help here.



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Feb 20 at 08:06 PM

Try using BAPI_ACC_DOCUMENT_CHECK before POST. I hope you are passing BUS_ACT as RFBU

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Pratik,

Thanks for your response.

I'm already using BAPI_ACC_DOCUMENT_CHECK before BAPI_ACC_DOCUMENT_POST. I tried it with BUS_ACT with value RFBU & without any value as well. Unfortunately this is not working.

My requirement is to get G/L account corresponding to Asset number & asset transaction type combination.


Raymond Giuseppi
Feb 21 at 10:28 AM

First, use a FM like AMSP_ASSET_READ_FOR_POSTING to read required data (ANTS) and TABWV_READ to convert activity type to AA transaction type. Then call FIAA_CHECK_ACCOUNTING_OBJECT to get a COBL structure to use in your program. (or analyze those FM and build your own code)

10 |10000 characters needed characters left characters exceeded