Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RFC return table

Former Member
0 Likes
2,359

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,086

Hi,

Loop your error messages return table and then populate in one internal table and then display.

Thanks

Vikranth

Read only

Former Member
0 Likes
1,086

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

Read only

Former Member
0 Likes
1,086

for the multiple records we need to write in the tables..

return like bapireturn2

Read only

Former Member
0 Likes
1,086

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

Read only

Former Member
0 Likes
1,086

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.