Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with a Table of a RFC-Function

Hi,

I wrote a function where I get a picture (in a byte-Array). But I get a defekt Stream from the JCO.

Several time the JCO give not the result but a ?.

Here the ASCII-Code of the orig File:

ÿØÿà JFIF ` ` ÿþ Created by AccuSoft Corp. ÿÀ ° C ! ÿÛ „

ÿÄ

ÿÄ µ } !1A Qa "q 2‘¡ #B±Á RÑð$3br‚

%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦[/code]

And here the result of the JCO:

ÿØÿà JFIF ` ` ÿþ Created by AccuSoft Corp. ÿÀ ° C ! ÿÛ ?

ÿÄ

ÿÄ µ } !1A Qa "q 2??¡ #B±Á RÑð$3br?

%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?????????????????¢£¤¥¦[/code]

Here the code.

public byte[] getUserPicture(String arg0) throws ResourceException, IOException{

ByteArrayOutputStream out = new ByteArrayOutputStream();

if(getConnectionStatus()){

JCO.Function function = i.getFunction("HR_ESS_WHO_PROG_GET_PICTURE");

JCO.ParameterList importPara = function.getImportParameterList();

importPara.setValue(arg0, "PER_NR");

i.execute(function);

JCO.ParameterList epl = function.getTableParameterList();

JCO.Table exportData1 = epl.getTable("IMAGE_TAB");

for(int i = 0; i < exportData1.getNumRows(); i++){

exportData1.setRow(i);

byte[] bArray = exportData1.getByteArray(0);

if(bArray.length == 1023){

out.write(bArray);

byte[] temp = new byte[1];

temp[0] = 100;

out.write(temp);

}else{

out.write(bArray);

}

}

return out.toByteArray();

}

return null;

}[/code]

Not what you were looking for? View more on this topic or Ask a question