Show TOC

Example documentationServer Connection to a Unicode Backend System Locate this document in the navigation structure

 

If you want to make outbound RFC calls from a Unicode SAP system to a JCo server instance, the server must be set up using the additional server Propertyjco.server.unicode=1.

You also need to set the unicode option for your RFC destination in transaction SM59 in transaction SM59 (tab page MDMP_Unicode).

Then add an extra constructor to class MyFirstServer

Syntax Syntax

  1.  public MyFirstServer(String gwhost, String gwserv, String progid, boolean isUnicode
  2.                          IRepository repository) {
  3.                super(gwhost,gwserv,progid,repository);
  4.                this.setProperty("jco.server.unicode", isUnicode?"1":"0");
  5.     }
End of the code.

and modify the method startServers:

Syntax Syntax

  1.   public static void startServers()  {
  2.       JCO.addClientPool("POOL",  3, "000", "user" ,"password" , "EN", 
  3.                                      "abap_system" ,"00");
  4.          
  5.       IRepository repository = JCO.createRepository("REP", "POOL");
  6.       for(int i = 0; I < serverConnections.length; i++) {
  7.            // Server listens for incoming requests from system 1
  8.            // (Change gateway host, service, and program ID according to your
  9.               needs)
  10.            serverConnections [i] = new MyFirstServer 
  11.                              ("gwhost",  //gateway host, often the same as ashost
  12.                               "sapgw00", //gateway service, generally sapgw+<SYSNR>
  13.                               "JCOSERVER01", // corresponds to the program ID defined in SM59
  14.                               true, // or false for non unicode listener
  15.                               repository);
  16.            serverConnections [i].start();
  17.     }
End of the code.