Unlike Session method,error handling is not done by the system in CALL TRANSACTION method.
So,in call transaction method error handling is done by using the BDCMSGCOLL structure.
The error messages are collected into an internal table for messages(say it_message) which is of type structure BDCMSGCOLL.
Example : CALL TRANSACTION 'MM01' USING it_bdcdata MODE 'N' UPDATE 'S'
MESSAGES INTO it_message.
However, it_message here contains only the message id and message number values.
So, we have to get the message out of it using the function module 'MESSAGE_TEXT_BUILD' or 'FORMAT_MESSAGE'.
Example :
LOOP AT it_message INTO wa_message WHERE msgtyp EQ 'E'.
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = wa_message-msgid
MSGNR = wa_message-msgnr
* MSGV1 = ' '
* MSGV2 = ' '
* MSGV3 = ' '
* MSGV4 = ' '
IMPORTING
MESSAGE_TEXT_OUTPUT = wa_text
ENDLOOP.
Here, wa_text holds the actual message which we can append to an internal table for further use.
So,in call transaction method error handling is done by using the BDCMSGCOLL structure.
The error messages are collected into an internal table for messages(say it_message) which is of type structure BDCMSGCOLL.
Example : CALL TRANSACTION 'MM01' USING it_bdcdata MODE 'N' UPDATE 'S'
MESSAGES INTO it_message.
However, it_message here contains only the message id and message number values.
So, we have to get the message out of it using the function module 'MESSAGE_TEXT_BUILD' or 'FORMAT_MESSAGE'.
Example :
LOOP AT it_message INTO wa_message WHERE msgtyp EQ 'E'.
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = wa_message-msgid
MSGNR = wa_message-msgnr
* MSGV1 = ' '
* MSGV2 = ' '
* MSGV3 = ' '
* MSGV4 = ' '
IMPORTING
MESSAGE_TEXT_OUTPUT = wa_text
ENDLOOP.
Here, wa_text holds the actual message which we can append to an internal table for further use.