cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Exception: RFC_ERROR_SYSTEM_FAILURE: "CNTL_ERROR" raised

Former Member
0 Kudos

Hi,

I built a BAPI, and want to use JCO to pass a parameter to that BAPI, but the JAVA program gives me the following error.

Could anyone provide some information on below JCO Exception, or how I can test if the BAPI I built is correct? Thank you so much!

com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Exception condition "CNTL_ERROR" raised.

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)

at DownloadConnect.<init>(DownloadConnect.java:41)

at DownloadConnect.main(DownloadConnect.java:75)

Regards,

Bing

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hallo Noyan,

Generally when you get an error of the type "RFC_ERROR_SYSTEM_FAILURE", a system dump is generated in the remote system. Could you check the logs in the SAP system (ST22 in case you are not aware of it) and see what the logs say about the error?

Could you also mention the BAPI that you are using?

T00th

Former Member
0 Kudos

Hi there,

I used ST22 and see the "Name of runtime error" is "RAISE EXCEPTION".

The BAPI I created only has one method, which is a function module. The function module has only one input parameter, which should be a string with length less than 100. I tested the function module by using the menu: function module -> test -> test function module, and it works. I also released the BAPI, and I can see the status of the BAPI using BAPI EXPLORER.

I suspect the problem is how I transfer the input string to the BAPI. In the BAPI, I defined the type of my input parameter as ZA-ZB, where ZA is a structure and ZB is a field of the structure. In the Java part, I used the following statement to pass the string:

String myImportValue = "BAPI_SALESORDER_CHANGE";

function.getImportParameterList().setValue(myImportValue, "FM_DOWNLOAD");

I am a newbie of ABAP. And I am really struggling with these problems. Any ideas and suggestions are highly appreciated.

Regards,

Bing

Former Member
0 Kudos

Hi,

Since you say that you tested the BAPI in the SAP System and it works, and your code snippet seems ok, I have a question - when you test the BAPI in the SAP System, does a window or message pop-up during execution? The reason is that if a GUI element is called in the BAPI, the JCO part goes haywire. GUI Elements cannot be handled by JCO.

Therefore, if a new window or message/dialog box is called during the execution of the BAPI, it often leads to an error.

In ST22, you can scroll down to see exactly on which line in ABAP the exception was thrown. Could you perhaps post that?

T00th

Former Member
0 Kudos

Hi T00th,

When I test the BAPI in the SAP system, it shows me a form where I input the "input parameter of BAPI", and then I push F8 to let it run. It didn't have any windows showed up when it was running.

Some detailed information got from ST22 shows below.

-


Information on where terminated

Termination occurred in the ABAP program "CL_GUI_FRONTEND_SERVICES======CP" -

in "CONSTRUCTOR".

The main program was "SAPMSSY1 ".

In the source code you have the termination point in line 28

of the (Include) program "CL_GUI_FRONTEND_SERVICES======CM002".

-


-


Source Code Extract

-


Line

SourceCde

-


1

2

METHOD CONSTRUCTOR .

3

  • ...

4

data: IsPlatin_Gui type c,

5

CLS_ID(64) type C.

6

7

  • dont create info control on SAPGUI for HTML

8

check WWW_ACTIVE IS INITIAL.

9

10

*check for platin_gui--


11

CALL FUNCTION 'GUI_HAS_JAVABEANS'

12

IMPORTING

13

RETURN = IsPlatin_Gui.

14

15

IF IsPlatin_Gui = 'X'.

16

CLS_ID = 'SAPINFO'.

17

ELSE.

18

CLS_ID = 'SAPGUI.InfoCtrl.1'.

19

ENDIF.

20

21

CALL METHOD SUPER->CONSTRUCTOR

22

EXPORTING

23

CLSID = CLS_ID

24

EXCEPTIONS

25

OTHERS = 1.

26

27

if sy-subrc <> 0.

>>>>>

raise CNTL_ERROR.

29

endif.

30

31

ENDMETHOD. "

-


Thank you very much for your help.

Sincerely,

Bing

Former Member
0 Kudos

Hi Noyan,

I think my guess turned out to be correct - the BAPI tries to send back a GUI Element ("it shows me a form...") over the RFC connection which cannot be handled through JCo because, well its an RFC connection and not a Gui connection.

If possible, try to talk to someone at your place who works with ABAP and ask him if this call can be temporarily taken out so that you can at least test your JCo program. If that works, maybe your ABAP guy can think of a workaround which will get you around the problem.

Bye!

T00th

Former Member
0 Kudos

Hi T00th,

I am sorry that I might misdescribe the problem. I think "the form" I mentioned might not be the GUI that programmed by ABAP person. When I test it in SAP system, I push F8, and then it shows me the text field for the input parameter, the checkbox for "Uppercase/Lowercase", and the text field for "RFC target sys".

I tested with a new BAPI which is blank (includes no statement), which obviously doesn't require a GUI when it is running . After push F8, it shows me the checkbox for "Uppercase/Lowercase", and the text field for "RFC target sys" as well. Thus, I think the previous BAPI doesn't require a GUI when it's running....... Can I suppose it that way?

Besides, I am also the "ABAP guy" in my group actually. I get the function module by modifying an existing report.

Anyway, any further suggestions and comments are highly appreciated.

Regards,

Bing

Former Member
0 Kudos

Hi,

As the dump describes the BAPI / FM you tried to call by JCO use SAP GUI functionality by using class cl_gui_frontend_services. This won't work with JCO. Debug FM (external breakpoint and run your JCo prog) and you'll find out where the dump occurs.

If you need help please post the code of your FM.

Regargds,

Daniel

Former Member
0 Kudos

Hi Bing,

I think I then misunderstood what you meant about the form. But still, the fact that the class "CL_GUI_FRONTEND_SERVICES" is called, is a bummer. This class deals with GUI elements as the name suggests, and I have a strong feeling (could be wrong though) that this class being called is the problem.

In case it is not a custom BAPI, could you tell me the name of the BAPI you are trying to call? I will try and test it too. Maybe your custom BAPI calls a standard BAPI internally, could you make sure if this is being done? If yes, then do let me know the name of the BAPI being called internally too.

Bye,

T00th

Former Member
0 Kudos

Hi T00th and Daniel,

Thank you so much for the replies. The BAPI I mentioned is a custom BAPI, and I asked my advisor if I can post the code, he preferletting me try harder first, so I think you might not be able to test it. But thank you so much for trying to help me.

I got the BAPI by modifying a report which I got from the previous co-worker. The report has more than 7,000 lines, and I searched it, it doesn't contain "BAPI". But it called many function modules and subroutines, so I have no idea if it calls any BAPI internally.

Best,

Bing

ashish_shah
Contributor
0 Kudos

Generally this error occurs in following cases:

JCO tries to call a RFC which :

1) tries to use file upload function modules

2) tries to call some screen , typically a call transaction statement with a BDC and BDC mode as Asysnchronous.

3) SAP R/3 Throws some messages , information or error on the screen which are not captured by RFC

All these basically means failure to complete the RFC call.

Hope this helps.

Ashish