Hi All,
Here is some link for your references for Ledger Journal Posting through X++ Code.
Check following links….
http://dynamicspost.blogspot.in/2011/04/post-ledger-journal-using-x.html
http://dax-world.blogspot.in/2009/01/auto-posting-ledger-journal-in-ax.html
I Hope these links will help full for you.
-Harry