10-09-2007 4:00 PM
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
10-09-2007 4:03 PM
Hi,
make use of exceptions here.
if sy-subrc EQ <exeption Number>
message 1.
elseif sy-subrc EQ <ex number2>
message2.
endif.
10-09-2007 4:05 PM
Hi Ricky
Probably you can check back the table AENR, whether the change number is created, if yes, than it success
Regards
MD
10-09-2007 4:08 PM
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
10-09-2007 4:08 PM
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
10-10-2007 5:28 AM
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
10-10-2007 5:31 AM
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
10-10-2007 3:51 PM
Its a very helpful answer. Will test again and let you know....
Given points
Thanks
12-04-2007 11:55 AM
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..
12-04-2007 12:12 PM