on 04-15-2013 3:28 PM
Hi,
We have few Update and Create Services being called, once these services are called and the record is updated or created, is there a way to get the success of error messages posted to the front end?
Thank you in Advance.
Hi,
Yes, its possible for that you have to add little code in ABAP level to show successful message in device. You have to do the following steps.
1. Capture the message in RFC RETURN table.
2.
if lt_return is not initial.
read table lt_return into ls_return index 1 .
message = ls_return-message.
raise exception type /iwbep/cx_mgw_busi_exception
exporting
textid = /iwbep/cx_mgw_busi_exception=>business_error
message = message.
endif.
Thnaks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
I did raise the exception in my RFC FM. But the Gateway service ran into errors without even creating the record in backend.
Let me explain my scenario in detail.
I have a Gateway System connected to SolMan. The OData services are consumed by sharepoint. Its a complete Z Solution in SolMan so an RFC is consumed by the service. The Create service is called from sharepoint application and the record got created successfully in SolMan. However,GW system is unable to catch the return message and throws an exception /iwfnd/cx_mgw_tech_exception. I debugged the entire scenario and I could see that the message is being passed from SolMan but somehow, GW is unable to catch it.
Am I doing something wrong here ? Please let me know your inputs as I'm new to Gateway
Regards,
Naresh
Hi Arun,
Is it possible to fetch the return messages from BAPIRET2 table in Odata service.
In my scenario the BAPI is returning success messages like ''Contact Created or Lead Created'', i have to fetch those messages in Odata service.
Could you please tell me what should be done for that and where I need to add the code for fetching the success message.
With Regards
Neha Pandey
Why only index 1?
IF lt_return IS NOT INITIAL.
mo_context->get_message_container( )->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>
gcs_leading_msg_search_option-first ).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = mo_context->get_message_container( ).
ENDIF.
Hi,
if i just raise the below exception code in my method in sap gateway is it going to take care of message handling or i have do anything explicitly in the font end too? If so how to do it
raise exception type /iwbep/cx_mgw_busi_exception
exporting
textid = /iwbep/cx_mgw_busi_exception=>business_error
message = message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Passing error messages back by the exception channel is normal but I do not advocate the use of success messages, they are meaningless when you have the HTTP status codes. Why do people have to start clagging up a nice simple system? Keep simple things simple guys.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
" is there a way to get the success of error messages posted to the front end" means ?
Regards,
Jibin Joy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.