How can SAP tRFC server tell client through JCo that function has been carried out?

StackOverflow https://stackoverflow.com/questions/2787647

  •  03-10-2019
  •  | 
  •  

문제

SAPs "Transactional RFC Technical Description" document (release 4.0, see http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ee6bca90-0201-0010-5792-d9693e2eac83?QuickLink=index&overridelayout=true ) says in section Transactional RFC on page 6: "Finally, the server tells the client, that the function has been carried out and the client acknowledges this.".

How can the server tell this to the client when the server communicates with the client through JCo (Java Connector)?

도움이 되었습니까?

해결책

Release 4.0 is quite old - be sure to always use the recent documentation.

From what I can see, there's no way to hand the result of the tRFC call back to the server. tRFC calls might be placed in a (local or remote) queue and executed later. See http://help.sap.com/saphelp_nw04/helpdata/en/f0/02a63b9bb3e035e10000000a114084/frameset.htm for information on how to monitor tRFC calls.

다른 팁

The answer is very simple: by not throwing an exception! Assuming that the JCo side is the server here, all you need to do is return successfully from the method that implements the function module. JCo will then automatically return the acknowledgement required by the tRFC protocoll to the client (= the R/3 system in this case).

The R/3 system, upon recieving the ACK from JCo, will then trigger the Confirm event, which JCo receives and passes into the appropriate event of your JCoServerTIDHandler. Here you can then clean up the TID from your status keeping DB.

If your function module method returns with an error, JCo will report that accordingly, and the backend will trigger the Rollback event.

The following article explains in more details, how tRFC between an external program and an SAP system should be implemented. It is based on the NetWeaver RFC library (C/C++), but you can easily translate it to JCo and Java: https://wiki.scn.sap.com/wiki/x/FD67Gg

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top