SAP Java Connector (SAP JCo) is a middleware component that enables the development of SAP-compatible components and applications in Java. SAP JCo supports communication with the SAP Server in both directions: inbound calls (Java calls ABAP) and outbound calls (ABAP calls Java).
<u>Using Jco connection in Web dynpro</u></p><p>There are 3 ways to logon to Jco destination</p><ul><li>Start NWDS and open web dynpro perspective</li></ul><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco1.JPG|height=114|alt=image|width=509|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco1.JPG|border=0! </p><ul><li>Logon http://<host>:<port> -> Web Dynpro -> content administrator</li><li>Logon http://<host>:<port>/irj/portal ->Content Administration->Web Dynpro</li></ul><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco2.JPG|height=192|alt=image|width=321|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco2.JPG|border=0!</p><p>Normally you can create logical system in the Web Dynpro Java(WDJ) first, but I would like to create the Jco destination before it is used as logical system, like that I can test and ping the connection of SLD and ABAP backend system, after the Jco destination runs successfully, then I use it in the WDJ, there is another reason I did it first is when calling adaptive RFC in WDJ, it’s possible to create the ABAP backend system in preference of WDJ directly as long as I installed the SAP Gui logon on my PC, I can still use the Adaptive RFC, but when another user who doesn’t install SAP Gui for this system, then he wouldn’t run this Web Dynpro correctly.</p><p>In the Jco Destination ->create JCo Destination</p><p>Step 1</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco3.JPG|height=218|alt=image|width=446|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco3.JPG|border=0!</p><p>When you define Jco Destination name, never use the system name and DEV, The same Jco Destination should have 2 names: one for application data and one for destination data, when WDJ wants to access the data of ABAP backend system, it needs the metadata for example structure also.</p><p>Maximum Pool Size: The parameter Maximum is used to specify how many connections should be left open for the current user, even if they are not being used actively. A pooled RFC connection is allocated much faster than a new connection, therefore, increasing the pool size will optimize the time needed to get a new connection. On the other hand, if a connection is pooled, it is not available for other users.</p><p>Maximum Connections: Maximum amount of connections per user. This needs to be determined for each Application Data destination (also called logical system).</p><p>Connection Timeout: Defines how long the pool waits (in seconds) before a destination, which is in the range between 1 and the maximum pool size, is closed by the pool. This allows closing pooled connections after a certain amount of time, if the user is no longer active. A typical value here is 10 – 30 seconds.</p><p>Maximum Wait Time: Defines how long you can wait (in seconds) before you get an exception after trying to get an destination although the maximum destinations are open. In a high user load scenario, it makes sense to increase this number appropriately (20-60), in low user load scenarios, this number can typically be reduced to a very low number (1-5 seconds).</p><p>Step 2:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco4.JPG|height=136|alt=image|width=464|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco4.JPG|border=0!</p><p>Select which J2EE cluster I wish the Jco destination to be assigned.</p><p>Step 3:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco5.JPG|height=177|alt=image|width=390|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco5.JPG|border=0!</p><p>Select the connection type – Application Data or Dictionary Meta Data. The connection type should match the name of step 1 I had just created. </p><p>When Application Data is selected, I can choose between direct connection to a distinct application server of the technical system or using load balancing.</p><p>When Dictionary Meta Data is selected, load balancing is pre-selected and can not be changed.</p><p>Step 4:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco6.JPG|height=227|alt=image|width=372|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco6.JPG|border=0!</p><p>I may only select Servers and / or Logon Groups from the drop down list that have first been defined as technical Systems in the SLD.</p><p>Step 5:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco7.JPG|height=252|alt=image|width=400|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco7.JPG|border=0!</p><p>Application Data: If I select a connection type of Application Data, then when I get to the Security screen, I will have a choice of 4 different user authentication techniques: User/Password, Client Certificate (X.509), Ticket (SSO2 Cookie), User Mapping (Requires the use of the User Mapping Engine in the J2EE engine)</p><p>For development and testing scenarios, it is acceptable to use the User/Password authentication method. However, for productive use, you should always choose a method that allows user specific authorizations to be employed within SAP. This will help provide an application level audit trail of user activity.</p><p>If you select User/Password for you productive system, then all users using this JCo connection will appear to be the same user within SAP. Thus, you will loose any audit trail capability.</p><p>Dictionary Meta Data: If I select a connection type of Dictionary Metadata, then when I get to the Security screen, I will only be able to use a named user id and password for connection to the SAP system. This is because no audit trail is required for the transfer of metadata. Therefore, the same user id (SAP user is of type SYSTEM) can be used irrespective of the identity of the end user.</p><p>Step 6:</p><p>Check my configuration data on the Summary screen.->finish</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco8.JPG|height=210|alt=image|width=432|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco8.JPG|border=0!</p><p>The icon next to the JCo destination now turns green.</p><p>Finally, press the Test button to ensure that my JCO connection works. I scroll to the bottom of the browser window to see the success/failure message.</p><p>Important: I repeat this process for the second JCo destination!</p><p>Once both JCo destinations have been successfully created, I am ready to use it in my Web Dynpro application.</p><p>Start NWDS, open the web dynpro perspective, open the web dynpro I want to use, create model</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco9.JPG|height=212|alt=image|width=433|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco9.JPG|border=0!</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco10.JPG|height=230|alt=image|width=391|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco10.JPG|border=0! !https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco11.JPG|height=303|alt=image|width=242|src=https://weblogs.sdn.sap.com/weblogs/images/251978614/Jco11.JPG|border=0!</body>