First of all, check out the documentation, namely Macros in X++. Just note that the remark about constants and SysDa framework doesn't apply to AX 2012; these are features introduced by F&O.
You can find many examples in the standard application, but the most common case are these two:
Definition of constant values. Either your own, or you can use constants defined in Microsoft macro libraries, e.g. #MillisecondsPerHour in #TimeConstants.
Field lists in pack() and unpack() methods used in RunBase framework.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.