cancel
Showing results for 
Search instead for 
Did you mean: 

com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Trying to access ro

Former Member
0 Kudos

Hi

i am Java Developer. I must develop existing project. This is a web project which based on Cocoon. Wenn i fill up the fields and click submit an error occured, but the datas are saved in SAP-System.

An error occurred

Exception in ServerPagesGenerator.generate()

details from

source org.apache.cocoon.ProcessingException description org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate():

com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Trying to access row values in a table which does not

have any rows yet extra info

Original exception : com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Trying to access row values in a

table which does not have any rows yet

at com.sap.mw.jco.JCO$Record.checkRowCapacity(JCO.java:11347)

at com.sap.mw.jco.JCO$Record.getString(JCO.java:11756)

at com.sap.mw.jco.JCO$Record.getString(JCO.java:13051)

at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:258)

at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250)

at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:395)

Can somebody help me to solve this problem. This is very urgent.

Thanks in advance,

Dami

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

check below link it may be useful to u to analysis this error:

https://media.sdn.sap.com/javadocs/NW04/SPS15/jc/com/sap/mw/jco/JCO.PoolManager.html

Former Member
0 Kudos

Looks like you don't give the values for the import parameters.

Your code

public JCO.Function executeSapFunction(JCO.Function func) {

boolean hasToConnect = client == null;

if (connectToSap()) {

client.execute(func);

if (hasToConnect) this.closeConnectToSap();

return func;

}

else {

return null;

}

}

Add the black line to set the import parameters (of course you need to pass the value via the arguments of the method) :

public JCO.Function executeSapFunction(JCO.Function func) {

boolean hasToConnect = client == null;

if (connectToSap()) {

<b>func.getImportParameterList().setValue(<import parameter value>, <import parameter name>);</b>

client.execute(func);

if (hasToConnect) this.closeConnectToSap();

return func;

}

else {

return null;

}

}

Former Member
0 Kudos

Also you may want to check the result to make sure it's not empty.

for instance,

Table result = function....getTable();

if ( result.getNumRows() > 0 )

{

// retrieve the data

}

Dennis

Former Member
0 Kudos

Gopi

Could paste your Code here for the view ??

Thanks

Jack

Former Member
0 Kudos

Hello Jack,

Which Code do you want? This is a big project. I dont know where this error cause. Do you want th JavaCode or XML? or XSP??

Thanks in advance,

Dami

Former Member
0 Kudos

JCO related code on JAVA !!!

Thanks

Former Member
0 Kudos

Hello Jack,

i think, this is the right code, which do you want. Is this code enough???

Thanks in advace,

Dami

public SapLeistungsabrechnung(String mandant, String userid,String password,String language,String hostname,String systemNo, String logPath) {

props = new java.util.Properties();

clearError();

if (mandant == null) {

errorId = 200;

}

else {

props.setProperty("jco.client.client",mandant);

}

if (hostname == null) {

errorId = 201;

}

else {

props.setProperty("jco.client.ashost",hostname);

}

if (userid == null) {

errorId = 203;

}

else {

props.setProperty("jco.client.user",userid);

}

if (password == null) {

errorId = 204;

}

else {

props.setProperty("jco.client.passwd",password);

}

if (language == null) {

language = "de";

}

props.setProperty("jco.client.lang",language);

if (systemNo == null) {

errorId = 202;

}

else {

props.setProperty("jco.client.sysnr",systemNo);

}

this.logPath = logPath;

}

public boolean connectToSap() {

boolean result = true;

if (client == null) {

try {

client = JCO.createClient(props);

client.connect();

repository = JCO.createRepository("TimeSystem", client);

System.out.println("Opened Connection to Sap " + " on host " + client.getASHost() + " system no. " + client.getSystemNumber() + " client " + client.getClient() );

}

catch (JCO.Exception jex) {

errorId = 206;

stack = jex.getClass().getName() + " " + jex.getMessage();

client = null;

result = false;

}

catch (Exception ex) {

errorId = 207;

stack = ex.getClass().getName() + " " + ex.getMessage();

client = null;

result = false;

}

}

else {

result = true;

}

return result;

}

public boolean closeConnectToSap() {

boolean result = true;

try {

// Client

if (client != null) {

client.disconnect();

client = null;

repository = null;

System.out.println("Closed Connection to Sap");

}

}

catch (JCO.Exception ex) {

errorId = 208;

stack = ex.getClass().getName() + " " + ex.getMessage();

result = false;

}

finally {

return result;

}

}

public JCO.Function getSapFunction(String functionName) {

boolean hasToConnect = client == null;

if (connectToSap()) {

// Get a function template from the repository

IFunctionTemplate ftemplate = repository.getFunctionTemplate(functionName);

System.out.println("got template " + functionName);

if (hasToConnect) this.closeConnectToSap();

// Create a function from the template

return new JCO.Function(ftemplate);

}

else {

return null;

}

}

public JCO.Function executeSapFunction(JCO.Function func) {

boolean hasToConnect = client == null;

if (connectToSap()) {

client.execute(func);

if (hasToConnect) this.closeConnectToSap();

return func;

}

else {

return null;

}

}

Former Member
0 Kudos

Hi,

nobody cant give me a hint, why is this error occur?

There isnt any clue.....

I couldnt also find any usefull message in Google.

I will be thankfull, if anyone can help me.

Thanks in advance.