BAPI_ACC_GL_POSTING_POST - Auto generate tax lines
I have looked at this thread BAPI_ACC_GL_POSTING_POST - pointers need on enhancing the bapi - EXTENSION1 and managed to use the exit to populate addition field VALUE DATE.
But when I try to populate TAX CODE and CALCULATE TAX so that a tax line would be generated automatically, SAP throws me an error that the transaction amount does not balance.
The data I passed in are:
GL1, $1000, Tax Code P7, Calculate Tax ticked
The document I expected:
GL3, $70 (This tax line is to be generated by the system.
The document would be posted if I post directly in F-02.
Anybody knows how I can get the BADI to post the tax line? Or must I code the logic to add the additional tax line in the Exit