Skip to Content
author's profile photo Former Member
Former Member

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

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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Feb 20, 2018 at 08:06 PM

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

    Add a comment
    10|10000 characters needed 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.


  • Posted on Feb 21, 2018 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)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.