‎2008 Jun 17 10:14 AM
Hi,
I have created RFC function module with import, export and return parameters.
How can we display multiple error messages in Return table.
I am getting only one error message in return table.
Can you please reply for this. as I need to deliver it today.
thanks&Regards
Rama Devi
‎2008 Jun 17 10:19 AM
Hi,
Loop your error messages return table and then populate in one internal table and then display.
Thanks
Vikranth
‎2008 Jun 17 10:22 AM
Hi Rama,
If return is an exporting parameter in your RFC then only one error message will come.
If you want multiple error messages in return parameter then define this return as TABLE parameter instead of export parameter.
If it is defined as a TABLE parameter then the messages are not appended in the RFC for return parameter.
Regards,
Ravi K
‎2008 Jun 17 10:24 AM
for the multiple records we need to write in the tables..
return like bapireturn2
‎2008 Jun 17 10:26 AM
Hi Rama devi,
The return parameter (error) table should be the table type.
in your code collect all the error in the internal table ET_ERROR of type
BAPIRETTAB.
if you are getting error, update the errror to the internal table ET_ERROR.
Reward if found helpful
Regards,
Boobalan Suburaj
‎2008 Jun 17 10:32 AM
I think within ur FM for each validation ur checking the sy-subrc value and if it not euals to 0 u r populating the Return table and exit from FM. If i am correct then pl. remove the exit statement and use a flag and set this flag when an error occurs.Finally check the flag value and based on that do the final processing.
Ex:
FUNCTION 'XXXX'.
if val1 is initial.
l_error = 'X'.
i_return-msgty = 'E'.
i_return-text = 'Error message'.
append i_return.
endif.
if val2 is initial.
l_error = 'X'.
i_return-msgty = 'E'.
i_return-text = 'Error message'.
append i_return.
endif.
if l_error is initial.
do final processing.
endif.
ENDFUNCTION.
Regards,
Joy.