Hi Madan,
Ok that is easy to fix.
Go to your Exception class in transaction SE24 and have a look at the tab Texts.
There will be line there that matches your class and shows the default text for that class.
For example, you can see in standard exception class CX_BO_INSTANCE_NOT_FOUND that the default text is "Error while searching for existing instance of business class '&CLASS_NAME&': Instance not found"
Now go to the Methods tab of your exception class. You will see there are two methods:
IF_MESSAGE~GET_TEXT and IF_MESSAGE~GET_LONG_TEXT. These are the methods that build the texts that you see in the workflow log. They will have default implementations but you can override them if you need to.
Notice in the CONSTRUCTOR method of CX_BO_INSTANCE_NOT_FOUND how the attribute TEXTID has been filled. This is important, because the existence of a text id dictates whether the text methods are called and thus whether the workflow log is filled.
Now look at the Attributes of your exception class. These can be used as placeholders in your message text - you can see how this is done in the default text of CX_BO_INSTANCE_NOT_FOUND above. If you need additional attributes to be passed by the calling program, all you need to do is create the attributes in your exception class, reference them in your default text or in your GET_TEXT method and activate your class.
By doing this, the attributes will then become input parameters of your RAISE EXCEPTION statement for this exception class.
And of course what you enter in the default text or via the GET_TEXT method will end up in the workflow log.
Hope that helps.
Rgds,
Jocelyn