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

return message from function module

Former Member
0 Likes
3,971

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
Read only

Former Member
0 Likes
1,995

Hi,

make use of exceptions here.

if sy-subrc EQ <exeption Number>

message 1.

elseif sy-subrc EQ <ex number2>

message2.

endif.

Read only

Former Member
0 Likes
1,995

Hi Ricky

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

Regards

MD

Read only

Former Member
0 Likes
1,995

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

Read only

Former Member
0 Likes
1,995

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

Read only

0 Likes
1,995

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

Read only

Former Member
0 Likes
1,995

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

Read only

0 Likes
1,995

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

Given points

Thanks

Read only

0 Likes
1,995

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..

Read only

0 Likes
1,995

My mail ID is harsha_tiwari@yahoo.com

Thx