cancel
Showing results for 
Search instead for 
Did you mean: 

Catching error from R/3 in EP

Former Member
0 Kudos

Hi Friends

We are working on ESS business package implemented on EP. For the users who do not have access to 'Working time', I am getting the following error message:

Exception condition "PROFILE_NOT_INITIALIZED" raised., error key: RFC_ERROR_SYSTEM_FAILURE

Exception condition "PROFILE_NOT_INITIALIZED" raised., error key: RFC_ERROR_SYSTEM_FAILURE

com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Exception condition "PROFILE_NOT_INITIALIZED" raised., error key: RFC_ERROR_SYSTEM_FAILURE at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101)

at com.sap.xss.hr.cat.record.blc.RfcManager.rfcExecute(RfcManager.java:486)

at com.sap.xss.hr.cat.record.blc.RfcManager.init(RfcManager.java:864)

at com.sap.xss.hr.cat.record.blc.wdp.InternalRfcManager.init(InternalRfcManager.java:247)

at com.sap.xss.hr.cat.record.blc.FcCatRecordInterface.onInit(FcCatRecordInterface.java:279)

and so on....

My requirement is to catch this error message in EP or using WebDynpro, and display a proper error message for this.

Do anybody have an idea, how it can be accomplished?

with thanks

amit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi amit,

after executing the RFC in the exception use this code.

final Writer wr = new StringWriter();

final PrintWriter pw = new PrintWriter(wr);

e.printStackTrace(pw);

wdComponentAPI.getMessageManager().reportSuccess("Error:" + wr.toString());

wdComponentAPI.getMessageManager().reportSuccess("Error:" + e.getMessage());

Regards,

Gopi

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

When a user in R/3 is assigned some roles, the profile needs to be generated to make those roles "active". Check with your admins if those profiles are activated.

Hope it helps,

Rajit

Former Member
0 Kudos

Hi gopi

Thanks for the input, but this doesnt work. Actually this is an unrecoverable exception and if I write the code as told by you, it gives a webdynpro error. However as of now I have been able to change the error message by writing following line of code:

msgMgr.deleteAllMessages(wdThis.wdGetAPI().getComponent());

msgMgr.raiseException(wdThis.wdGetAPI().getComponent(),"RFC_ERROR_SYSTEM_FAILURE","@link#PROFILE_NOT_INITIALIZED","You are not allowed to view this page");

But the stack trace still remains there. My problem will be solved even if we are able to remove the trace. Can you please help me in this regard.

with thanks

amit

Former Member
0 Kudos

hi amit,

<b> RFC_ERROR_SYSTEM_FAILURE</b> you get when there is a short dump in the RFC. check ST22 transaction in the R/3. The RFC is giving a short dump..

The code i have given is to trace the error.

to display the errors just loop through the Bapi or RFC Return node and display the message field when type is "E".

wdComponentAPI.getMessageManager.reportException(message,boolean);

Regards,

Gopi