Nco服务器端开发
昨日搞定了客户端的配置(C#连接SAP),后来想想我们的应用还有服务器端的(SAP连接C#),于是进行搜索,发现此文章非常有用。
http://www.cnblogs.com/byfhd/archive/2008/12/03/1244761.html
体会:
1,C#的应用程序需要设置参数,IP地址是SAP服务的地址,而不是C#服务器的地址。在SAP的SM59中,不用配置网关等内容。给人的感觉是C#的程序送到到SAP的指定接口中,供SAP使用一般。
2,想进行服务器端的开发,但是发现例程中有代理类生产,而我的SAP工具箱却是灰色的,还需要研究研究。
3,上述的文章引用的例程与SAP的FM不一致,网上有另外的一篇文章非常好使,贴在下面:
Example
*&---------------------------------------------------------------------
*& Report ZRFCSERVERCALL
**&--------------------------------------------------------------------
*& This program can be used with the RFCServerConsole sample
*& Source is available in %RFCServerConsoleABAPProgram
*&---------------------------------------------------------------------
REPORT ZRFCSERVERCALL .
DATA: TBLCUST like BRFCKNA1 occurs 0 with header line.
PARAMETERS: P_CUSTNO like KNA1-KUNNR, P_CUSTNA like KNA1-NAME1,
P_DEST(15) TYPE C.
CALL FUNCTION 'RFC_CUSTOMER_GET' DESTINATION P_DEST
EXPORTING
KUNNR = P_CUSTNO
NAME1 = P_CUSTNA
TABLES
CUSTOMER_T = TBLCUST
EXCEPTIONS
NOTHING_SPECIFIED = 1
NO_RECORD_FOUND = 2
OTHERS = 3.
CASE SY-SUBRC.
WHEN 0.
LOOP AT TBLCUST.
WRITE: / SY-TABIX, TBLCUST-KUNNR, TBLCUST-NAME1, TBLCUST-ORT01.
ENDLOOP.
WHEN 1.
WRITE: / 'You need to specify a value ', SY-MSGV1.
WHEN 2.
WRITE: / '.NET component didnt find anything ', SY-MSGV1.
WHEN 3.
WRITE: / 'Some other error occurred ', SY-MSGV1.
WHEN OTHERS.
WRITE: / 'Something is wrong if we get here'.
ENDCASE.
非常感谢搜索引擎,让我自学也能成功。