I found a blog with the above description but would like to get an example of the coding for the solution below, I am assuming the BADI is RSR_OLAP_BADI.
Financial Statement Item (0GLACCEXT) is enabled as a hierarchy under the Row and the key figure Balance (0BALANCE) placed under the Column.
The 0GLACCEXT is something I added to 0FIGL_O10, and I created a BAdI for virtual characteristic to derive the value of 0GLACCEXT during the query runtime based on the value of 0BALANCE, e.g. account 30001010 appears under two different parent nodes Assets and Liabilities in the 0GLACCEXT hierarchy. And in the BEx report it should go to Assets if the run-time balance is larger than zero otherwise it should go to Liabilities.