on 08-10-2012 9:34 AM
Hi all,
I use jco 3.0.9 to invoke SAP ECC6 RFC BBP_RFC_READ_TABLE.
SAP RFC return data successful but the chinese characters cannot be displayed and have some messages:
rscpNoShortCutConversion (6200->4103): ctrl: t=try, own: i=ignore, meth: l_tab, drop: m=like_miss in [rscpc.c:22944]
rscpNoShortCutConversion (4103->6200): ctrl: t=try, own: i=ignore, meth: l_nu16le_get_tab, drop: m=like_miss in [rscpc.c:23011]
My Client O.S. is the Windows XP SP3 (Chinese Traditional) and remote SAP information are as below:
LANGUAGE: E
ISO_LANGUAGE: EN
OWN_CODEPAGE: 6200
OWN_CHARSET: SAP6200
OWN_ENCODING: SAP-6200
OWN_BYTES_PER_CHAR: 1
PARTNER_CODEPAGE: 6200
PARTNER_CHARSET: SAP6200
PARTNER_ENCODING: SAP-6200
PARNER_BYTES_PER_CHAR: 1
OWN_REL: 720
PARTNER_REL: 700
PARTNER_TYPE: 3
KERNEL_REL: 700
Does anyone have ideas about this? Thanks a lot in advance.
can you post your java code first?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun,
This is my code & destination setting:
Code
package sapClient20120731;
import java.io.File;
import java.lang.String;
import java.io.FileOutputStream;
import java.util.Properties;
import com.sap.conn.jco.AbapException;
import com.sap.conn.jco.JCoContext;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoDestinationManager;
import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.JCoField;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoFunctionTemplate;
import com.sap.conn.jco.JCoStructure;
import com.sap.conn.jco.JCoTable;
import com.sap.conn.jco.ext.DestinationDataProvider;
public class client20120731 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
JCoDestination destination = JCoDestinationManager.getDestination("TW1");
System.out.println("Attributes:");
System.out.println(destination.getAttributes());
System.out.println();
JCoFunction function = destination.getRepository().getFunction("BBP_RFC_READ_TABLE");
if(function == null) throw new RuntimeException("BBP_RFC_READ_TABLE not found in SAP.");
function.getImportParameterList().setValue("QUERY_TABLE", "LFA1");
JCoTable t_OPTIONS = function.getTableParameterList().getTable("OPTIONS");
t_OPTIONS.appendRow();
t_OPTIONS.setValue("TEXT", "LIFNR <> ''");
JCoTable t_FIELDS = function.getTableParameterList().getTable("FIELDS");
t_FIELDS.appendRow();
t_FIELDS.setValue("FIELDNAME", "LIFNR");
t_FIELDS.appendRow();
t_FIELDS.setValue("FIELDNAME", "LAND1");
t_FIELDS.appendRow();
t_FIELDS.setValue("FIELDNAME", "NAME1");
try
{
function.execute(destination);
}
catch(AbapException e)
{
System.out.println(e.toString());
return;
}
JCoTable t_DATA = function.getTableParameterList().getTable("DATA");
System.out.println("BBP_RFC_READ_TABLE finished:" + t_DATA.getNumRows());
for (int i=0; i <= 20; i++){
t_DATA.setRow(i);
try {
System.out.println("A:" + t_DATA.getValue("WA").toString());
}catch(Exception ee2){
System.out.println("ee2="+ee2.toString());
}
}
System.out.println();
} catch( JCoException jex) {
System.out.println("jex="+jex.toString());
}
System.out.println("ok");
}
}
TW1.jcoDestination
jco.client.lang=en
jco.destination.peak_limit=10
jco.client.client=100
jco.client.passwd=password
jco.client.user=user01
jco.client.sysnr=02
jco.destination.pool_capacity=3
jco.client.ashost=192.168.10.1
maybe it is just display issue.
can you follow this http://bytecounts.com/blog/?p=28 ?
Hi Jun,
It is still not working...
By the way, I do the getBytes("ISO-8859-1") in JCO 2.0, and chinese characters can display right.
System.out.println("Old: " + t_DATA.getString("WA"));
String Get_FieldString=new String(t_DATA.getString("WA").getBytes("ISO-8859-1"));
System.out.println("New: " + Get_FieldString);
But same codes in JCO 3.0 is failed:
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.