06-05-2014 11:22 AM
Hi Techies ,
i have a Function module , and it has tables 'e_t_messages' parameter and it is giving all the error messages .
i want to print all the error messages by looping that table , can you please help me in printing those messages .
my code is :
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = 'ZC_REWUI'
i_activate_md = rs_c_true
i_db_commit = abap_true
IMPORTING
e_subrc = lv_rc
TABLES
i_t_attribute = l_t_attributes
i_t_data = l_t_data
e_t_messages = l_t_messages .
IF lv_rc <> 0 .
LOOP at l_t_messages into l_s_messages .
write : '??????????????????????' .
END LOOP.
ENDIF.
i expect answer as my updated code .
update my code and fill in .
Thanks and Kind Regards,
Praveen Bindla..
06-05-2014 1:10 PM
Hi Praveen,
Then you can move forward with the code that I had written.
LOOP at l_t_messages into l_s_messages .
write : l_s_messages-MSGTXTP .
END LOOP.
Regards,
Abijith
06-05-2014 11:32 AM
Hi Praveen,
You can try to achieve this as follows:
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = 'ZC_REWUI'
i_activate_md = rs_c_true
i_db_commit = abap_true
IMPORTING
e_subrc = lv_rc
TABLES
i_t_attribute = l_t_attributes
i_t_data = l_t_data
e_t_messages = l_t_messages .
IF lv_rc <> 0 .
LOOP at l_t_messages into l_s_messages .
write : l_s_messages-MSGTXTP .
END LOOP.
ENDIF.
Please put a break point at the loop an check whether the field MSGTXTP is containing message with all the parameters.
Regards,
Abijith
06-05-2014 11:44 AM
Hi Praveen,
If you are not getting a full message text in the MSGTXTP field, then you can make use of the function module RPY_MESSAGE_COMPOSE to prepare the message. In this FM you need to pass the message class, message no and the message parameters and it will return the full message.
Regards,
Abijith
06-05-2014 11:46 AM
Hello Praveen,
Use FM FORMAT_MESSAGE
LOOP AT it_message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_message-msgid
lang = it_message-msgspra
no = it_message-msgnr
v1 = it_message-msgv1
v2 = it_message-msgv2
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
write 😕 V_smg.
ENDLOOP.
06-05-2014 12:08 PM
Hello Chandra and Always,
both RPY_MESSAGE_COMPOSE and 'FORMAT_MESSAGE' getting the same message as it was contained in the variable l_s_messages-MSGTXTP .
06-05-2014 1:10 PM
Hi Praveen,
Then you can move forward with the code that I had written.
LOOP at l_t_messages into l_s_messages .
write : l_s_messages-MSGTXTP .
END LOOP.
Regards,
Abijith
06-05-2014 1:37 PM
Ya Thanks chandra .
i already did mine , but forgot to give u correct answer .