1. Sorry friend, I am not an ABAPer.. I can help you only from functional side.. Like if you want to know about any table and field, then I can tell you. but I am very poor about the ABAP coding..
2. If you see the document.. you can see it needs the both AAC and material group.. Without AAC you can't fetch the account modifier.. Without material group, you can't fetch the valuation class..
Both are important to fetch G/L from table T030 or t-code OBYC..