Application Development 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: 

return message from function module

Former Member
0 Kudos

Hello Folks

How can we get the return message from function modules where there

is no return table associated? I am using a FM 'CCAP_ECN_CREATE', CCAP_REVLEVL_MAINTAIN etc. None of these has a return table associated to fetch the return message. Any ideas are appreciated

Thanks

Ricky

9 REPLIES 9

Former Member
0 Kudos

Hi,

make use of exceptions here.

if sy-subrc EQ <exeption Number>

message 1.

elseif sy-subrc EQ <ex number2>

message2.

endif.

Former Member
0 Kudos

Hi Ricky

Probably you can check back the table AENR, whether the change number is created, if yes, than it success

Regards

MD

Former Member
0 Kudos

Hi Ricky,

Mainly, return strucutures are used with BAPI modules. Most regular FM use the system variable sy-subrc for return codes. You can look in transaction se37 under exceptions to see the exceptions codes associated with sy-subrc for any given FM.

thanks.

Jamie

Former Member
0 Kudos

When there is no return message table, you can check the return code or exceptions. If you view the function module in transaction SE37, you can see what the coded exceptions are. I hope this helps.

- April King

0 Kudos

Thanks guys. But I wanna capture the real system error message. Not based on sy-subrc.

Right now, I am using a select statement after calling the function module

SELECT SINGLE text INTO return-message FROM t100

WHERE sprsl = sy-langu

AND arbgb = sy-msgid

AND msgnr = sy-msgno.

But here for error, I am getting the message with & in it which gets populated inside the standard function module. How can I replace this & with the real value. and populate the return-message with the same.

Thanks

Ricky

Former Member
0 Kudos

Hi,

You can use the function module FORMAT_MESSAGE to prepare the message text for the corresponding message id, number and place holders (&)

Thanks

Naren

0 Kudos

Its a very helpful answer. Will test again and let you know....

Given points

Thanks

0 Kudos

Can you please help me on this, if you have got your problem resolved.

As i a also facing the same problem. I also tried many ways but i am not able to get the actual message.

Thanks in Advance..

0 Kudos

My mail ID is harsha_tiwari@yahoo.com

Thx