Hi Ankit,
Try below function modules.
CALL FUNCTION 'MESSAGES_INITIALIZE'. "clear the buffer messages on starting
LOOP at <internal table>. "to collect messages
CALL FUNCTION 'MESSAGE_STORE' "add your message
EXPORTING
ARBGB = '' "Message ID
MSGTY = '' "Type of message (I, S, W, E, A)
TXTNR = '' "Message Number
ENDLOOP.
CALL FUNCTION 'MESSAGES_SHOW'. "Show messages at end
Regards,
Mordhwaj