⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example5.java.html

📁 SAP ERP的二次开发
💻 HTML
📖 第 1 页 / 共 3 页
字号:
    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCINT1"</FONT><FONT color=#000000>,   </FONT><FONT color=#000080><b>JCO.TYPE_INT1</b></FONT><FONT color=#000000>,   1, 12, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCICHAR4"</FONT><FONT color=#000000>, </FONT><FONT color=#000080><b>JCO.TYPE_CHAR</b></FONT><FONT color=#000000>,   4, 13, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCINT4"</FONT><FONT color=#000000>,   </FONT><FONT color=#000080><b>JCO.TYPE_INT</b></FONT><FONT color=#000000>,    4, 20, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCHEX3"</FONT><FONT color=#000000>,   </FONT><FONT color=#000080><b>JCO.TYPE_BYTE</b></FONT><FONT color=#000000>,   3, 24, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCCHAR2"</FONT><FONT color=#000000>,  </FONT><FONT color=#000080><b>JCO.TYPE_CHAR</b></FONT><FONT color=#000000>,   2, 27, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCTIME"</FONT><FONT color=#000000>,   </FONT><FONT color=#000080><b>JCO.TYPE_TIME</b></FONT><FONT color=#000000>,   6, 29, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFRDATE"</FONT><FONT color=#000000>,   </FONT><FONT color=#000080><b>JCO.TYPE_DATE</b></FONT><FONT color=#000000>,   8, 35, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCDATA1"</FONT><FONT color=#000000>,  </FONT><FONT color=#000080><b>JCO.TYPE_CHAR</b></FONT><FONT color=#000000>,   50,43, 0);    smeta</FONT><FONT color=#000080><b>.addInfo</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"RFCDATA2"</FONT><FONT color=#000000>,  </FONT><FONT color=#000080><b>JCO.TYPE_CHAR</b></FONT><FONT color=#000000>,   50,93, 0);    repository</FONT><FONT color=#000080><b>.addStructureDefinitionToCache</b></FONT><FONT color=#000000>(smeta);  }  </FONT><FONT color=#008000>/**<em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Implementation</em><em> </em><em>of</em><em> </em><em>my</em><em> </em><em>own</em><em> </em><em>server</em><em> </em><em> </em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>  </FONT><FONT color=#0000FF><b>static</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>public</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>class</b></FONT><FONT color=#000000> Server </FONT><FONT color=#0000FF><b>extends</b></FONT><FONT color=#000000> </FONT><FONT color=#000080><b>JCO.Server</b></FONT><FONT color=#000000> {    </FONT><FONT color=#008000>/**<em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Create</em><em> </em><em>an</em><em> </em><em>instance</em><em> </em><em>of</em><em> </em><em>my</em><em> </em><em>own</em><em> </em><em>server</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>@param</em><em> </em><em>gwhost</em><em> </em><em>the</em><em> </em><em>gateway</em><em> </em><em>host</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>@param</em><em> </em><em>gwserv</em><em> </em><em>the</em><em> </em><em>gateway</em><em> </em><em>service</em><em> </em><em>number</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>@param</em><em> </em><em>progid</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>id</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>@param</em><em> </em><em>repository</em><em> </em><em>the</em><em> </em><em>repository</em><em> </em><em>used</em><em> </em><em>by</em><em> </em><em>the</em><em> </em><em>server</em><em> </em><em>to</em><em> </em><em>lookup</em><em> </em><em>the</em><em> </em><em>definitions</em><em> </em><em>of</em><em> </em><em>an</em><em> </em><em>inc</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>    </FONT><FONT color=#0000FF><b>public</b></FONT><FONT color=#000000> Server(String gwhost, String gwserv, String progid, </FONT><FONT color=#000080><b>IRepository</b></FONT><FONT color=#000000> repository)    {      </FONT><FONT color=#0000FF><b>super</b></FONT><FONT color=#000000>(gwhost,gwserv,progid,repository);    }    </FONT><FONT color=#008000>/**<em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Not</em><em> </em><em>really</em><em> </em><em>necessary</em><em> </em><em>to</em><em> </em><em>override</em><em> </em><em>this</em><em> </em><em>function</em><em> </em><em>but</em><em> </em><em>for</em><em> </em><em>demonstration</em><em> </em><em>purposes...</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>    </FONT><FONT color=#0000FF><b>protected</b></FONT><FONT color=#000000> </FONT><FONT color=#000080><b>JCO.Function</b></FONT><FONT color=#000000> getFunction(String function_name)    {      </FONT><FONT color=#000080><b>JCO.Function</b></FONT><FONT color=#000000> function = super</FONT><FONT color=#000080><b>.getFunction</b></FONT><FONT color=#000000>(function_name);      </FONT><FONT color=#0000FF><b>return</b></FONT><FONT color=#000000> function;    }    </FONT><FONT color=#008000>/**<em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Not</em><em> </em><em>really</em><em> </em><em>necessary</em><em> </em><em>to</em><em> </em><em>override</em><em> </em><em>this</em><em> </em><em>method</em><em> </em><em>but</em><em> </em><em>for</em><em> </em><em>demonstration</em><em> </em><em>purposes...</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>    </FONT><FONT color=#0000FF><b>protected</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>boolean</b></FONT><FONT color=#000000> checkAuthorization(String function_name, </FONT><FONT color=#0000FF><b>int</b></FONT><FONT color=#000000> authorization_mode,        String authorization_partner, </FONT><FONT color=#0000FF><b>byte</b></FONT><FONT color=#000000>[] authorization_key)    {      </FONT><FONT color=#008000>/*<em>Simply</em><em> </em><em>allow</em><em> </em><em>everyone</em><em> </em><em>to</em><em> </em><em>invoke</em><em> </em><em>the</em><em> </em><em>services</em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>      </FONT><FONT color=#0000FF><b>return</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>true</b></FONT><FONT color=#000000>;    }    </FONT><FONT color=#008000>/**<em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Overrides</em><em> </em><em>the</em><em> </em><em>default</em><em> </em><em>method.</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em> </em><em> </em><em>Can</em><em> </em><em>handle</em><em> </em><em>only</em><em> </em><em>the</em><em> </em><em>two</em><em> </em><em>functions</em><em> </em><em>STFC_CONNECTION</em><em> </em><em>and</em><em> </em><em>STFC_STRUCTURE</em><em> </em><em> </em><em> </em><em> </em><em> </em><em>*</em><em>/</em></FONT><FONT color=#000000>    </FONT><FONT color=#0000FF><b>protected</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>void</b></FONT><FONT color=#000000> handleRequest(</FONT><FONT color=#000080><b>JCO.Function</b></FONT><FONT color=#000000> function)    {      </FONT><FONT color=#000080><b>JCO.ParameterList</b></FONT><FONT color=#000000> input  = function</FONT><FONT color=#000080><b>.getImportParameterList</b></FONT><FONT color=#000000>();      </FONT><FONT color=#000080><b>JCO.ParameterList</b></FONT><FONT color=#000000> output = function</FONT><FONT color=#000080><b>.getExportParameterList</b></FONT><FONT color=#000000>();      </FONT><FONT color=#000080><b>JCO.ParameterList</b></FONT><FONT color=#000000> tables = function</FONT><FONT color=#000080><b>.getTableParameterList</b></FONT><FONT color=#000000>();      System.out.println(</FONT><FONT color=#FF00FF>"handleRequest("</FONT><FONT color=#000000> + function</FONT><FONT color=#000080><b>.getName</b></FONT><FONT color=#000000>() + </FONT><FONT color=#FF00FF>")"</FONT><FONT color=#000000>);      </FONT><FONT color=#0000FF><b>if</b></FONT><FONT color=#000000> (function</FONT><FONT color=#000080><b>.getName</b></FONT><FONT color=#000000>().equals(</FONT><FONT color=#FF00FF>"STFC_CONNECTION"</FONT><FONT color=#000000>)) {        output</FONT><FONT color=#000080><b>.setValue</b></FONT><FONT color=#000000>(input</FONT><FONT color=#000080><b>.getString</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"REQUTEXT"</FONT><FONT color=#000000>),</FONT><FONT color=#FF00FF>"ECHOTEXT"</FONT><FONT color=#000000>);        output</FONT><FONT color=#000080><b>.setValue</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"This is a response from Example5.java"</FONT><FONT color=#000000>,</FONT><FONT color=#FF00FF>"RESPTEXT"</FONT><FONT color=#000000>);      }      </FONT><FONT color=#0000FF><b>else</b></FONT><FONT color=#000000> </FONT><FONT color=#0000FF><b>if</b></FONT><FONT color=#000000> (function</FONT><FONT color=#000080><b>.getName</b></FONT><FONT color=#000000>().equals(</FONT><FONT color=#FF00FF>"STFC_STRUCTURE"</FONT><FONT color=#000000>)) {        </FONT><FONT color=#000080><b>JCO.Structure</b></FONT><FONT color=#000000> sin  = input</FONT><FONT color=#000080><b>.getStructure</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"IMPORTSTRUCT"</FONT><FONT color=#000000>);        </FONT><FONT color=#000080><b>JCO.Structure</b></FONT><FONT color=#000000> sout = (</FONT><FONT color=#000080><b>JCO.Structure</b></FONT><FONT color=#000000>)sin.clone();        </FONT><FONT color=#0000FF><b>try</b></FONT><FONT color=#000000> {          System.out.println(sin);        }        </FONT><FONT color=#0000FF><b>catch</b></FONT><FONT color=#000000> (Exception ex) {          System.out.println(ex);        }        output</FONT><FONT color=#000080><b>.setValue</b></FONT><FONT color=#000000>(sout,</FONT><FONT color=#FF00FF>"ECHOSTRUCT"</FONT><FONT color=#000000>);        output</FONT><FONT color=#000080><b>.setValue</b></FONT><FONT color=#000000>(</FONT><FONT color=#FF00FF>"This is a response from Example5.java"</FONT><FONT color=#000000>,</FONT><FONT color=#FF00FF>"RESPTEXT"</FONT><FONT color=#000000>);      }</FONT><FONT color=#008000>//<em>if</em></FONT><FONT color=#000000>    }  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -