cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC: Handling Exceptions on Remote Enabled Functions

Former Member
0 Kudos

Hi we have a custom function we are calling from java webdynpro...


FUNCTION z_perform_action.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(REFNR) TYPE  Z08
*"     VALUE(ACTION) TYPE  Z53
*"     VALUE(ADHOCAPPROVER) TYPE  Z32 OPTIONAL
*"     VALUE(DEVICE) TYPE  ZE73 OPTIONAL
*"     VALUE(NOTES) TYPE  CHAR2048 OPTIONAL
*"  EXCEPTIONS
*"      USER_NOT_APPROVER
*"      INVALID_USER_AS_APPROVER
*"      UNABLE_UPDATE_IMAGE_NOTES
*"----------------------------------------------------------------------

For example, If the exception USER_NOT_APPROVER is raised, how do we get the short text of the exception in java webdynpro?

I can successfully get the value "USER_NOT_APPROVER" by doing the following...however cannot get the short text: ( with e.getMessage() )


		try
		{

			wdContext.currentZ_Ixcp_Perform_Action_InputElement().modelObject().execute();
			wdContext.nodeOutputPerformAction().invalidate();

		}
		catch (WDDynamicRFCExecuteException e)
		{

			

			wdComponentAPI.getMessageManager().raiseException(e.getMessage(), true);

		}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

So Raj, are you saying I should have an error handling table that makes it available in the webdynpro context as either an EXPORTING param or TABLE param in the RFC?

and I should not use the EXCEPTIONS params in the RFC?

Former Member
0 Kudos

Ferguson,

I think you understood it correctly, but doing it wrongly. Read the below points.

1. Your message is stored in Exceptions Node, not in WDDynamicRFCExecuteException.

2. WDDynamicRFCExecuteException will contain the system level messages, not the USER_NOT_APPROVER messages.

3. You can use Exceptions node, no problem, but not as e.getmessage. Like this. WdContext.CurrentExceptionsNode.getUSER_NOT_APPROVER.

Let me know if you need any help.

Thanks,

Raj.

Answers (1)

Answers (1)

Former Member
0 Kudos

Ferguson,

Exception and error message are both different. If you want to get the error message from backend, you should get it from Output Node, but not from the exception. Exception is at system level. Your Message USER_NOT_APPROVER is at Application level.

So try to get it like this: wdContext.Current<Error Node Name>Element.get<Error Attribute>( );

Let me know if this is what you are looking for.

Thanks,

Raj.