cancel
Showing results for 
Search instead for 
Did you mean: 

[graydom]error:CM_NO_DATA_RECEIVED

Former Member
0 Kudos
221

hi

I am a JCO freshman and come from China.

Now, I can use JCO to connect to the SAP/R3 server,

and I can print some infomation about the server,for example:

//CODE

JCO.Attributes attributes = client.getAttributes();

System.out.println("Connection attributes:\n" +

"----


\n" + attributes);

//CODE END

then a use a BAPI to write some data into the R3 server,

I can get the function , and setValue to the function.

but when I execute the function, I catch a exception:

//EXCEPTION

RFC_ERROR_SYSTEM_FAILURE

com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: connection closed without message (CM_NO_DATA_RECEIVED)

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

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

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

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

at com.landray.sap.SAPReader.executeBAPI(SAPReader.java:362)

at net.test.TestSAP.<init>(TestSAP.java:51)

at net.test.TestSAP.main(TestSAP.java:88)

//EXCEPTION END

when I use the SAP client to test the BAPI, I need to input some data , then press excute,then it will pop-up

a window to ask me to input another value's range.but in the bapi , it donot need to input the range. Is it the point of the problem that bring on the exception? if not,how can I solve the problem ? I have read some post about it , but I can not fine the answer .

thanks for you help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi wang,

First mark your post as a question, and then visit <a href="http://help.sap.com/saphelp_erp2004/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm">this</a> link.

It may help you.

Regards,

Narinder Hartala

Former Member
0 Kudos

Thank you for your reply.

I have visit the link you gave me.

And I can switch on tracing.

Below is a part of the tracing where throw exception:

//tracing

[JNI-LAYER] RFC.nativeExecute() before RfcCallReceive(1,"ZBAPI_GDZCDD4",1994FA88,19198AE0,00000000,0006F82C)

[JNI-LAYER] RFC.nativeExecute() after RfcCallReceive(1,"ZBAPI_GDZCDD4",1994FA88,19198AE0,00000000,0006F82C) = RFC_SYS_EXCEPTION

[JAV-LAYER] JCO.Client.execute (ZBAPI_GDZCDD4) threw a NON-ABAP exception: com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: connection closed without message (CM_NO_DATA_RECEIVED)

[JNI-LAYER] RFC.nativeDisconnect()

//tracing end

I can not get more message through the tracing,but can you give me some advise?

If a BAPI can be run in the SAP client , then , Is it also can be run in the java application with JCO?sure?

Regards,

graydom

Former Member
0 Kudos

Hi Wang,

BAPI's are remote enabled, surely we can call them from java program. Could you plz post complete coding of your application? Is BAPI executing successfully within ABAP?

Regards,

Narinder Hartala

Former Member
0 Kudos

Thank you for your reply again , Narinder

Below is my java coding:

//coding

import com.sap.mw.jco.*;

public class GuDingZiChan extends Object {

JCO.Client mConnection;

JCO.Repository mRepository;

public GuDingZiChan() {

try {

// Change the logon information to your own system/user

mConnection =

JCO.createClient("060", // SAP client

"LANDRAY", // userid

"*******", // password

"ZH", // language

"192.168.11.12", // application server host name

"01"); // system number

mConnection.connect();

mRepository = new JCO.Repository("ARAsoft", mConnection);

}

catch (Exception ex) {

ex.printStackTrace();

System.exit(1);

}

JCO.Function function = null;

JCO.Table codes = null;

try {

function = this.createFunction("ZBAPI_GDZCDD4");

if (function == null) {

System.out.println("ZBAPI_GDZCDD4" +

" not found in SAP.");

System.exit(1);

}

function.getImportParameterList().setValue("000044018020","ZANLN1");

function.getImportParameterList().setValue("0000200048","ZSUPERFIELD");

function.getImportParameterList().setValue("1000","ZEKORG");

function.getImportParameterList().setValue("001","ZEKGRP");

function.getImportParameterList().setValue("1000","ZBUKRS");

function.getImportParameterList().setValue("A01","ZWGBEZ");

function.getImportParameterList().setValue("1000","ZNAME1");

function.getImportParameterList().setValue("2005.04.25","ZEEIND");

function.getImportParameterList().setValue("‘ä","ZMEINS");

function.getImportParameterList().setValue("A","ZKNTTP");

function.getImportParameterList().setValue("567","ZNETPR");

function.getImportParameterList().setValue("5","ZMENGE");

function.getImportParameterList().setValue("20050323","ZBEDATT");

function.getImportParameterList().setValue("TEST","ZTXZ01");

mConnection.execute(function);

JCO.Structure returnStructure =

function.getExportParameterList().getStructure("RETURN");

if (! (returnStructure.getString("TYPE").equals("") ||

returnStructure.getString("TYPE").equals("S")) ) {

System.out.println(returnStructure.getString("MESSAGE"));

System.exit(1);

}

}

catch (Exception ex) {

ex.printStackTrace();

System.exit(1);

}

mConnection.disconnect();

}

public JCO.Function createFunction(String name) throws Exception {

try {

IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());

if (ft == null)

return null;

return ft.getFunction();

}

catch (Exception ex) {

throw new Exception("Problem retrieving JCO.Function object.");

}

}

public static void main (String args[]) {

GuDingZiChan app = new GuDingZiChan();

}

}

//END Coding

I don't think it has any mistake,when I run it , it cought a exception:

//Exception

com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: connection closed

without message (CM_NO_DATA_RECEIVED)

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

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

17)

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

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

at GuDingZiChan.(GuDingZiChan.java:50)

at GuDingZiChan.main(GuDingZiChan.java:77)

//End Exception

when I run the BAPI in the SAP Client,it can be run,and return:

//sap client run RETURN

T | CODE | MESSAGE

O S 450000831

//END sap client run RETURN

I don't know whether is the JCO problem or the BAPI problem,I feel trouble about that.....

and thank you again to read my post.

Regards,

Graydom

Former Member
0 Kudos

Is JCO client installed on the machine where you are trying to run this code ?

If not, install it (you can download it from Connectors on SAP downloads web site)

Former Member
0 Kudos

JCo Client?

you mean the JCO package? of course I have installed it.

Answers (2)

Answers (2)

Former Member
0 Kudos

Well, I am not ABABper, but when Iegt this error, the ABAP programmer solve for me, in the SAP enviroment, changing some kind of configuration.

I hope this help to route you in the direction of the solution.

Former Member
0 Kudos

I guess your BAPI (Z....) pops up some dialog when run from R3....

This is not acceptable for the RFC call. You need to supply the parameter up front in the RFC parms.

When called from Java you cannot have any screen interaction. P.S. There may be a parm "run dark" or something like that. It would need to be checked for RFC...

Tell your ABAP programmer to modify the BAPI...

Enjoy

Former Member
0 Kudos

can anybody help me?

pls help me.

I confuse about it for a long long time....