CD166 Exercise VHO V3 Final



Comments



Description

BUILD SAP HANA CLOUD APPLICATIONSWHICH INTEGRATE WITH ON-PREMISE SYSTEMS CD166 Timo Lakner, Nikolai Tankov, Markus Tolksdorf, Daniel Vladinov SAP AG Getting started with your session Login credentials and group numbers can be found in the ‘My Reservation’ tab on the SAP TechEd Virtual Hands-On Workshops website (https://saptechedhandson.sap.com/). Important: Some of the sessions use place holders for users (e.g. CD300_XX) or objects (e.g. ZCD400_Exercise_##). The place holders XX or ## must be replaced with your assigned group number, which you find in the ‘My Reservation’ tab on the above mentioned website. TABLE OF CONTENTS Before you start .......................................................................................................................................... 3 1 Creating developer account and deploying application .......................................................................... 5 1.1 Creating a free developer account ..................................................................................................... 6 1.2 Deploying Web Shop application to the cloud ................................................................................... 9 2 Configuring destinations of the cloud application ................................................................................... 13 2.1 Configuring destinations with the Destination Editor ......................................................................... 14 3 Using connectivity service API in the application ................................................................................... 16 3.1 Configuring destination as JNDI resource ......................................................................................... 17 3.2 Using destination API to call remote HTTP service ........................................................................... 19 3.3 Redeploying application changes ...................................................................................................... 21 4 Installing and configuring the SAP HANA Cloud Connector................................................................... 22 4.1 Installing the SAP HANA Cloud Connector ....................................................................................... 24 4.2 Connecting the SAP HANA Cloud Connector to an account ............................................................ 25 4.3 Configuring access control ................................................................................................................ 26 4.4 Configuring a system certificate ......................................................................................................... 28 4.5 Testing the application ....................................................................................................................... 29 5 Using Java Connector and RFC to access the ABAP system ................................................................ 32 5.1 Configuring an RFC destination ......................................................................................................... 33 5.2 Using JCo to call an ABAP function module ...................................................................................... 35 5.3 Configuring an ABAP function module in SAP HANA Cloud Connector ........................................... 36 5.4 Testing the application ....................................................................................................................... 39 6 Summary and Further information .......................................................................................................... 40 Copyright .................................................................................................................................................... 1 3 BEFORE YOU START SAP HANA Cloud Platform is the platform-as-a-service offering by SAP that enables SAP partners and customers to deploy and use Java EE and HANA XS applications in a cloud environment. In this hands-on session, you will learn how you can use the SAP HANA Cloud connectivity service to integrate a Java cloud application with an on-premise backend system. To take advantage from the cloud benefits like low TCO, high flexibility, fast development cycles, etc., companies are more and more interested in using the cloud. At the same time, they want to safeguard their investments in their existing heterogeneous on-premise IT landscape, and so they are looking for ways how to smoothly migrate and transform their businesses into the cloud. It is therefore a common scenario to develop an application in the cloud which extends a legacy system running on-premise. In this Hands-on session, you will learn how to develop an on-demand Java application which uses services via HTTP and RFC running in an on-premise network. This is done using the SAP HANA Cloud connectivity service and the SAP HANA Cloud connector. As scenario, a Web Shop application is used which allows end users to browse through a product catalog and to buy products. The Web Shop application retrieves its product catalog from an ABAP system running locally on the TechEd training laptops which simulate isolated on-premise networks. In this session, you will setup the SAP HANA Cloud connector on your TechEd laptop, configure it and configure the Web Shop application in the cloud appropriately so that the access of the ABAP system works end-to-end. The following image shows the overall landscape relevant for the scenario: The picture shows the SAP HANA Cloud Platform at the top, and the on-premise landscape – simulated by your TechEd laptop - at the bottom. Both landscapes are isolated networks, protected by firewalls and DMZs, i.e. not directly accessible from outside. On the cloud side, the Web Shop application is deployed and configured. It reads data from an ABAP 7.40 system in a RESTful way via the built-in SAP NetWeaver Gateway component. The technical connectivity between the on-premise system (i.e. laptop) and the cloud application is established by the SAP HANA Cloud connector, which is running on the laptop as on-premise agent and establishes a secure SSL VPN connection to your specific cloud account. The Hands-on session will guide you through 5 exercises. We strongly recommend going through the exercises in the given order to make sure that you will reach the final step – running the Web Shop application successfully - without issues. Exercise 1: Creating developer account and deploying application Register with the SAP ID service and create a free SAP HANA Cloud Platform developer account. Deploy the prepared Web Shop application into your account and run it in a browser. Exercise 2: Configuring destinations of the cloud application Configure the destinations needed by the Web Shop application to communicate with the ABAP on-premise backend, using the SAP HANA Cloud Platform Customer Cockpit. Exercise 3: Using connectivity service API in the application Complement the application code relevant for connectivity by adding prepared code snippets. Exercise 4: Installing and configuring the SAP HANA Cloud Connector Download the SAP HANA Cloud Connector (shortly, SCC) from the SAP HANA Cloud Update Site, install it on your TechEd laptop and configure it to connect to your cloud account. Configure the ABAP services which shall be accessible for the Web Shop application. Exercise 5: Using Java Connector and RFC protocol to access the ABAP system Extend the Web Shop application with data coming from the ABAP backend by calling a remote enabled ABAP function module directly using JCo. you will deploy the already prepared Web Shop application into the newly created developer account. you will register for a free developer account on the SAP HANA Cloud trial landscape.1 you will create a free developer account. As first step.2 you will deploy the prepared Web Shop application to your cloud account and run the application in its initial state in the cloud. this exercise will address following parts of the cloud landscape highlighted in red: What you will learn    how to register for a free developer account how to deploy and run applications in your account how to use the Cloud Cockpit to manage your account Exercise description   In Exercise 1. As second step. In the overall scenario picture. .5 1 CREATING DEVELOPER ACCOUNT AND DEPLOYING APPLICATION Estimated time: 15 min Objective Goal of this exercise is to prepare the environment needed for the further steps of the Hands-on session. In Exercise 1. SDN user exists) Explanation Open https://account.1. To create an account on HCP. configure and administrate applications. After successful logon. This brings up the login screen shown in the screenshot. The SAP ID Service is the identity provider used by SAP’s on-demand services and platforms.1 Creating a free developer account As first step.co m/cockpit in a browser. like a quota limit of one application that can be started at a time or missing service-level-agreements (SLAs). services. Enter your SAP ID Service user and password and click Log On. The account is the top-level entity on the SAP HANA Cloud Platform that is required to deploy. Screenshot . Select SAP HANA Database and click Continue. Depending on whether you already have a user registered in the SAP ID Service or not. select the database which you want to use for the newly created account. you need to have a user registered at the SAP ID Service. and is thus not meant for productive usage. HANA Cloud Platform and others. like SAP Developer Network.ondemand. On the next screen. Click the checkbox and then the Accept button. you need to go through one of the following two cases. account users.hanatrial. A free developer account has restrictions. you need to accept a Legal Disclaimer for the first time when accessing the HANA Cloud Platform. Case 1: You have a user registered in SAP ID Service (e.g. This step is only temporarily needed and will be removed in the future. Business ByDesign. you need to get a free developer account on the HANA Cloud trial landscape that will be used in the subsequent exercises. and alike. ondemand. like gmail.hana. Please contact your trainer to get the details of a prepared developer account and skip the rest of the steps below.g.7 Explanation Screenshot You get now to the Cloud Cockpit. Case 2: You don’t have a user registered at SAP ID Service To register a new SAP ID user. you require access to an email account (e. please continue with the screenshots in the table below. Explanation Open https://account.com in a browser and click the Register button.). Screenshot . we have prepared a set of developer accounts. If this is not the case. If this is the case. which you can use for the further exercise. gmx. of a public email provider of your choice. The Cloud Cockpit is the central administration UI for your account. etc. Explanation Screenshot Fill out the Registration form in the upcoming popup. On the next screen. which is used for the newly created account. The Cloud Cockpit is the central administration tool for your HCP account.ondemand. and user name is “p1940079614”. Click the link in the email to activate your user. which includes an activation link. After finishing the registration. and the user ID is visible in the header. In the screenshot.com/cockpit. In the future. . This step is only temporarily needed and will be removed in the future. You have now created a free developer account on SAP HANA Cloud Platform. the account name is “p1940079614trial”. Select SAP HANA Database and click Continue.hanatrial. The account name is displayed under Account in the upper left-side area of the user interface. Note down the account and user name somewhere as they will be needed in the next step again. an email is sent to your provided email account. You get now to the Cloud Cockpit. you can administrate your account using the Cloud Cockpit by URL https://account. you have to select the database. This starts Eclipse with workspace D:\Files\Session\CD166\workspace preselected. Click on espm-ui-shopping-web with the right mouse button.9 1.2 Deploying Web Shop application to the cloud As next step. Screenshot . you will deploy the already prepared Web Shop application into your newly created account. The two projects relevant for the Web Shop application are already available in the Eclipse workspace as shown in the screenshot. Explanation Open Eclipse via Start > Program Files > Eclipse > CD166. com is entered as Server's host name: It specifies that the HANA Cloud trial landscape should be used for the deployment. Click the Next button. Screenshot .Explanation Click the Run As > Run on Server menu item. Select the Manually define a new server radio button. select SAP > SAP HANA Cloud.ondemand. Verify that hanatrial. In the server type tree. Screenshot . This will start the deployment of the application which will take 1 to 2 minutes to complete. Application name: webshop Account name: <name-of-account> User name: <your-user-name> Password: <your-user-password> Click Next button to start the deployment.11 Explanation Fill out the fields as shown in the screenshot. using your developer account name and your SAP ID user ID. Click Finish. hanatrial. Summary After this exercise. Click on Applications in the navigation area on the left hand-side and verify that the webshop application is visible in the list of applications in state STARTED. As last step. This will be subject of the subsequent exercises. or the Cloud Cockpit have a look at following online resources: [1] Product Overview [2] Getting an Account [3] Signing up for a Developer Account [4] Account Types [5] Deploying Applications [6] Cloud Cockpit . its account types.ondemand. but displays the message An error occured during retrieval of data: HTTP request failed in the application message area. You have also gathered first hands-on experience with the Cloud Cockpit used to administrate your account and applications. you have created a developer account and deployed the Web Shop application into this account in the cloud. Reason for this is that the required backend connectivity for the application is not yet configured. Open the Cloud Cockpit via https://account. At this stage. the application does not show any product data. the application is started in the embedded Eclipse browser. use the Cloud Cockpit to verify that the application is deployed. the deployment of applications. If you want to learn more about the HANA Cloud Platform.co m/cockpit.Explanation Screenshot After successful deployment. authentication credentials for the backend and other related data. What you will learn   how to use the Destination Editor UI in the Cloud Cockpit how to configure an HTTP destination Exercise description  In Exercise 2. You have multiple options to configure a destination.e. You can do this via the neo command line tool (link). We will use the Cloud Cockpit in this exercise. or via the Destination Editor in the Cloud Cockpit (link). . the Web Shop application uses destinations for the remote communication with the backend services and the destination configuration is stored transparently for the user in a database.13 2 CONFIGURING DESTINATIONS OF THE CLOUD APPLICATION Estimated time: 10 min Objective Goal of this exercise is to configure the connection details needed by the Web Shop application in the cloud. via Eclipse (link). you will now work on the following cloud parts highlighted in red: As shown in the image. Looking at our overall landscape picture.1 you will use the Cloud Cockpit and its Destination Editor to configure an HTTP destination. Connections are configured on the HANA Cloud Platform using so-called destinations. i. in case of HTTP protocol it consists for instance of a URL. A destination represents the configuration of the targeted backend service. you will use the Cloud Cockpit and its Destination Editor to configure two destinations needed by the Web Shop application.ondemand.1 Configuring destinations with the Destination Editor In this exercise.2.hanatrial. This will drill down into the application view for the Web Shop application. In the upcoming file browser. The abapbackend destination is now being imported. From the list of applications select the webshop application. Select Applications in the navigation area on the left side. Screenshot . click the New Destination button and chose Import from File in the submenu. Select Destinations in the navigation area. Explanation Open Cloud Cockpit: https://account. This will open the Destination Editor for the webshop application. In the Destination Editor.c om/cockpit. select D:\Files\Session\CD166\resources\ destination\abapbackend. One reason for this is that the application coding related to connectivity is not yet complete.g. By this. If you refresh the Web Shop application in the browser. Let’s have a closer look into the destination configuration: it shows an example of an HTTP service configuration and consists of  an application-wide unique destination name. The second destination is located under D:\Files\Session\CD166\resources\destination\abapbackendimages. Summary In this exercise. using the Destination Editor. it takes up to 5 minutes until the changes become effective. This stores the imported destination transparently in a database. which identifies the destination at runtime. the URL points to a SAP NetWeaver Gateway service. in this case abapbackend. click the Save button. when we configure the backend service in the SAP HANA Cloud connector. specifying the protocol to be used. Note: Once an application has read a destination. When you change the destination configuration afterwards again e. In the next step.  authentication properties needed for the authentication against the backend.  a type. Note that espm:50000 is used as host and port. the Web Shop application "knows" the connection details of the targeted backend services.15 Explanation Screenshot Once the imported destination properties are displayed in the Destination Editor.  the URL to the targeted remote service. In this example. we will therefore complement the application code. Repeat the destination import steps with abapbackendimages. you have configured two destinations needed by the Web Shop application. it stores the destination in a runtime cache with an expiration time of 5 minutes. in this case HTTP is used as protocol. You will find this host and port again later on. you will notice that there is still no product data shown in the UI and the message An error occured during retrieval of data: HTTP request failed is still displayed. BasicAuthentication is used with service user EPM_TEST. If you want to learn more about destinations and its configuration have a look at following online resources: [1] Using Destinations [2] HTTP Destinations . In this example. After this step.2 you will add a coding snippet to the application that demonstrates the usage of the destination API. This includes the usage of the destination API and the destination declaration as a JNDI resource of the Web application. What you will learn    how to declare a destination as a JNDI resource in the Web application how to use the destination API in a Web application how to redeploy the changed application to the cloud Exercise description    In Exercise 3.1 you will configure the destination factory as a JNDI resource.3 USING CONNECTIVITY SERVICE API IN THE APPLICATION Estimated time: 10 min Objective Goal of this exercise is to complete the Web Shop application with coding snippets related to connectivity. In Exercise 3. . In Exercise 3. the application is fully prepared for final usage on the cloud side.3 you will redeploy the changed application to the cloud. 1 Configuring destination as JNDI resource In Java EE applications. Screenshot . resources that are used in a Web application are deployed externally to the Web application. you resolve the JNDI resource name that the application uses with the global JNDI resource name using the web.xml file to open it in the editor. This is done in the following steps. Explanation In the Eclipse Project Explorer.17 3. which need to be declared in the web. navigate into espm-ui-shopping-web > src > main > webapp > WEB-INF folder and double-click the web.xml of a Web application in order to access them from the global JDNI resources.xml deployment descriptor. To use external resources in the Web application. HTTP destinations are such kind of external resources. xml editor.core.DestinationF actory from the global JNDI tree.sap.api.core.api. so that the following declaration becomes active: <resource-ref> <res-ref-name> connectivity/DestinationFactory </res-ref-name> <res-type> com. DestinationFactory </res-type> </resource-ref> It declares that the Web application needs the resource connectivity/DestinationFactory of type com.connectivity.xml file by clicking the Disk icon.connectivity.Explanation In the we.sap. Screenshot . navigate to the Source tab and search for the string "CD166". Save the changes made in the web. This brings you to a commented code block. Remove the comments <!-.and -->. Explanation In the Eclipse Project Explorer. you will complement the coding of the Web Shop application that demonstrates how to use the destination API.19 3. Screenshot .java class. This opens the class in the Java editor. navigate to espm-ui-shopping-web > src > main > java > com > sap > cloudlabs > connectivity > proxy and double-click the ProxyServlet.2 Using destination API to call remote HTTP service As next step. Context to select it. Comment out the return null. statement and remove the comments in the code block below. Double click on the entry javax. Screenshot . search for string "CD166" which brings you to the method getDestination(String) which contains a commented code block. Open the context menu and click Source > Organize Imports.Explanation In the Java Editor. Afterwards. Note: The code block shows how the DestinationFactory class is looked up in the JNDI registry and how it is used to retrieve a named destination. save the changes in the coding by clicking the Disk icon.naming. Summary You have now added the missing coding to the Web Shop application which takes care of the remote calls from the application to the backend. when you refresh the application in the browser. Click the Republish button to redeploy the application. it still does not show any data in the UI. have a look at following resources: [1] Exchanging Data via HTTP Protocol [2] Connectivity Service API . This will again take 1 or 2 minutes to complete. We will fix this in the next exercise by establishing the connection to the backend using the SAP HANA Cloud connector. From cloud perspective.21 3. However. Explanation Screenshot Go to the Eclipse Servers view and select the server adapter of the webshop application. you need to redeploy the application to your developer account. If you want to learn more about how to use the destination API. the application is now fully set up and ready for final usage. The reason for this is that it has no physical connection yet to the ABAP system. You also deployed the changed application again to the cloud.3 Redeploying application changes After you have changed the application coding. 4 INSTALLING AND CONFIGURING THE SAP HANA CLOUD CONNECTOR Estimated time: 25 min Objective Goal of this exercise is to install the SAP HANA Cloud connector (shortly. Of course. SCC) as on-premise agent on your TechEd laptop. It provides services to read a product catalog and to drill down into product details. it provides images for each of the products. Besides this. isolated on-premise network. Looking at the overall landscape picture. which is used as backend for the Web Shop application. The TechEd laptop hosts a local ABAP system. For the purpose of this training the laptop thus simulates a complete. the backend systems and the SCC will usually run on different machines. we are now addressing following parts high-lighted in red: What you will learn     how to install the SCC how to connect the SCC against your developer account how to configure the SCC so that it allows access to the required backend services how to configure the SCC so that it authenticates itself via a X.509 client certificate against the ABAP backend . The SCC is used to establish a secure SSL VPN connection to your developer account in the cloud and is the recommended approach for point-to-point connections between SAP HANA Cloud Platform applications and on-premise systems. In Exercise 4.3 you will configure the backend services in the SCC. In Exercise 4. .2 you will connect the SCC against your developer account.5 you will test the Web Shop application in its final stage. In Exercise 4. In Exercise 4.4 you will upload the system certificate to the SCC.1 you will install the SCC on your TechEd laptop image.23 Exercise description      In Exercise 4. During installation you get asked for  the installation directory.4.msi file available on the Cloud Tools page Note: In case the Internet connection in the TechEd laptop image is slow.  the port used by the SCC Administration UI. After installation. Choose D:\Files\Session\CD166\scc as directory. Download the SCC Windows installer from https://tools. you can also download the latest version of the SCC by choosing Student (share) on the desktop and navigating to CD166\scc.com/#cloud. Change the suggested default port to 9443.1 Installing the SAP HANA Cloud Connector You will now install the SAP HANA Cloud connector (SCC) on your TechEd laptop image. as port 8443 is already used by the local ABAP system on the TechEd laptops.ondemand.1. Choose the latest version of the sapcc-2.x-windows-x64. .hana. open the SCC Administration UI with URL https://localhost:9443 in a browser which will bring up the SCC logon screen. first to change the inital password. the SCC UI guides you through two mandatory steps.25 4. enter: Host: proxy Port: 8080 Click Apply. and second to connect your SCC to your SAP HANA Cloud Platform account. Click the Save button. changing the initial password. Screenshot .com Account Name: <name-of-account> User Name: <your-user-name> Password: <your-password> As HTTPS Proxy settings. This means an SSL VPN tunnel to your cloud account has been established and you are now able to make calls from applications running in your account through this tunnel.2 Connecting the SAP HANA Cloud Connector to an account The next step is to go through the initial configuration steps of the freshly installed SCC. and connecting the SCC to a cloud account. In the Set Up Initial Configuration view. next to some other information. and the Connector State should be connected.ondemand. enter: Landscape Host: hanatrial. you can see your account name. Under the Overview group. Change initial password to abcd1234 or another password you can easily remember for the duration of this Hands-on session. After the first logon. Explanation Logon to the SCC Administration UI with user Administrator and initial password manage. This consists of the first logon. You should now be directed to the Home tab of the SCC Administration UI. Explanation To configure accessible resources. as the default behavior of the SCC is to block all requests to any services which are not defined as accessible resources. This brings up a details view in which you can define the resources (a.4. Remember that this was the host and port used in the destination URLs which we had configured before. which shall be used on the related system. Screenshot . services in case of HTTP). click the Add button on the menu bar of the Mapping Virtual To Internal System group. Click Save. Each resource that shall be accessible for applications in your account must be explicitly configured in a whitelist. Enter following values in the Add System Mapping popup: Virtual Host: espm Virtual Port: 50000 Internal Host: localhost Internal Port: 8443 Protocol: HTTPS Backend Type: SAP NetWeaver Gateway Note: This configuration defines that the localhost on port 8443 can be accessed by the cloud account under the virtual host and port espm:50000. navigate to the Access Control tab in the SCC Administration UI.3 Configuring access control Now that the SCC is connected to your account. define the system which hosts the service you like to make accessible: On the Resources tab.a. As first step. Click Add in the Resources Accessible On localhost:8443 view.k. the next step is to configure the resources/services which shall be made accessible to the applications in your account. Select the table row with the newly created system mapping. You have now configured the services which are needed by the Web Shop application. This should be the case. You can now optionally click the Check button to test whether the specified system can be accessed by the SCC.27 Explanation Enter the following values in the Add Resource popup window: URL Path: /sap/opu/odata/sap/Z_TUT_ESPM_DEVEL OPER_SCENARIO_SRV Access Policy: Path and all subpaths Click Save. the State field of the specified system should turn into a green light. i.e. Note: The resource paths are case sensitive! Add another resource with the following values: URL Path: /SAP/PUBLIC/BC/NWDEMO_MODEL/IMAG ES Access Policy: Path and all subpaths Click Save. i. the usage of a proxy between SCC and a configured system is currently not supported. Screenshot .e. The Access Control view should now look as shown in the screenshot. Note that the SCC must be able to directly access the specified systems. you will now upload the so-called System Certificate to the SCC. Select the file D:\Files\Session\CD166\resources\backen d_cfg\scc_teched2013. In the Password field type in abcd as encryption password for the PKCS#12 file.4 Configuring a system certificate As final step of the SCC configuration. Screenshot . Once it expires it will show a warning sign. the Administrator password. The backend systems need to be prepared accordingly to trust the used client certificate. On the Home tab of the SCC Administration UI.509 client certificate used for the authentication of the SCC towards the backend systems. The Settings popup window comes up in which you can define general settings of the SCC. and others. This is a PKCS#12 file containing the key pair used as System Certificate. Click Apply. you should now see in the Overview group the information that a System Certificate has been configured. Explanation In the SCC Administration UI. like the connection configuration.4. In the Settings dialog. Note that the UI also checks if the certificate is still valid. This should upload the specified certificate as system certificate to the SCC.p12 in the file browser. Go into the System Certificate tab and click Browse. configuration of a local LDAP for authenticating named users. Afterwards. open the Settings dialog in the top-level menu bar. This trust relationship has already been configured in the local ABAP system. click Close to close the Settings popup. you can also upload the System Certificate. The System Certificate is a X. 29 4. it is now time to test the application. Select one of the products. like Tablets. This should drill into the product catalog of the selected product category.5 Testing the application After you established a secure SSL connection from your laptop to the cloud. select one product and click Details to drill into the product details. Screenshot . configured the backend services which are needed by the Web Shop application and the system certificate for authentication. Explanation Refresh the application in a browser. In the product list. It should now come up with product data displayed as shown in the screenshot. Explanation Screenshot The Details view should come up and show a product image. You can now also play around with your SCC: E. Summary Congratulations! You have now successfully installed and configured the SAP HANA Cloud connector and used two backend services in your Web Shop application to read a product catalog and product details. All pieces of the overall landscape picture are now set up and working: Let’s recapture the steps of an administrator who has to deploy and configure an application which requires on-premise backend connectivity: 1. and more product details.g. You deploy the application into your account. 2. . If you reconnect the SCC by clicking the Connect button on the Home tab. the data appears again after a browser refresh of the application. loaded from the backend. disconnect the SCC from your account using the Disconnect button on the Home tab. You configure the destinations of the application using the Cloud Cockpit. If you then refresh the webshop application again in your browser. the data is again not visible. This might comprise the configuration of trust relationships using X. as well as on how to configure trust in the ABAP system with a client can be found here: [2] SAP NetWeaver Gateway 2. have a look at following online resource: [1] Using the Cloud Connector More details on SAP NetWeaver Gateway.31 3. and establishing trust to this certificate in the backend. If you want to learn more about the SAP HANA Cloud Connector.0 [3] Configuring the AS ABAP to Use X. You test the application and its data access.e. 4. configuration of a system certificate in the Cloud Connector.509 Client Certificates .509 certificates. You install the SAP HANA Cloud connector and connect it to your cloud account as a one-time task. i. 5. You configure the backend services in the SAP HANA Cloud connector which are needed by the application. e.0 how to configure a function module in the SAP HANA Cloud connector Exercise description     In Exercise 5. In Exercise 5. In Exercise 5. From the SCC to the backend. In Exercise 5. The Connectivity Service tunnels the RFC call from the application to the SAP HANA Cloud connector via the SSL tunnel. . the access via JCo and RFC works for any ABAP system release in a uniform manner.4 you will test the extended application. Now we will use RFC as protocol and Java Connector (JCo) as Java API in the Web Shop application in order to call some BAPIs from the ABAP system directly.2 you will use the JCo API in the Web Shop application to make a call to an ABAP function module. What you will learn    how to configure an RFC destination for a cloud application how to use the JCo API in the cloud application and that this is the well-known approach as for JCo standalone 3. i. Until now. and the SAP NetWeaver Gateway component was used on the ABAP 7. Besides this. via an encrypted channel. HTTP has been used as protocol for the communication between the Web Shop application and the backend.40 system to provide RESTful services on top of the ABAP functions.5 USING JAVA CONNECTOR AND RFC TO ACCESS THE ABAP SYSTEM Estimated time: 15 min Objective Goal of this exercise is to show an alternative approach how an on-premise ABAP system can be accessed from your cloud application.1 you will configure an RFC destination needed by the Web Shop application using the Connectivity Editor. Calling the ABAP system directly makes sense when no application proxies like SAP NetWeaver Gateway or Enterprise Services are available or shall be used due to performance reasons.3 you will configure the needed function module in the SCC. the user has the option to use RFC or RFC with SNC (Secure Network Communication) being turned on. Click New Destination > Import from File.ondemand.hanatrial.33 5.com/cock pit Drill down into the webshop application. Explanation Open again the Cloud Cockpit via https://account. Select the RFC destination from D:\Files\Session\CD166\resources\destinat ions\abapjcoDestination. Screenshot .1 Configuring an RFC destination In this exercise. you will use the Cloud Cockpit and its Destination Editor to configure an RFC destination needed by the Web Shop application. Click Destinations to open the Destination Editor. Click Open. Screenshot . Click Save to store the destination.Explanation The imported RFC destination is now displayed in the Destination Editor. After the change. This code block makes use of the JCo API. This will open the class in the Java Editor. the method should look as shown in the screenshot. Using it does not feel different.java. the JCo API in the cloud is the same as the well-known JCo 7. Remove the comments from the code block below. which will bring you to the coding shown in the screenshot.x API from NetWeaver AS Java or from JCo 3.2 Using JCo to call an ABAP function module In this step. Redeploy the webshop application to the cloud: Go again into the Eclipse Servers view and click the republish button. you will add coding in the Web Shop application that demonstrates how to use the JCo API. Screenshot .0 standalone. In the Java Editor. Comment out the throw new JCoException…. search for string “CD166”. statement.35 5. navigate into espm-ui-shopping-web > src > main > java > com > sap > teched > connectivity > jco and double-click JCoServlet. Save the code changes by clicking the Disk icon. Explanation In the Eclipse Project Explorer. In general. we do this for the function module needed by the Web Shop application.k. Remember that these were the jco. Screenshot . Click Save.client. This brings up a details view in which you can define the resources (a. In this exercise. navigate to the Access Control tab in the SCC Administration UI. Explanation To configure accessible resources. As first step.sysnr properties used in the RFC destination. Select the table row with the newly created system mapping. which shall be used on the related system. each ABAP function module that should be made accessible to your cloud account must be configured in the SCC.5.3 Configuring an ABAP function module in SAP HANA Cloud Connector As for HTTP services. Enter following values in the Add System Mapping popup: Virtual Host: espm_appserver Virtual Port: sapgw23 Internal Host: localhost Internal Port: sapgw00 Protocol: RFC Backend Type: ABAP System Note: This configuration defines that the ABAP application server on localhost with service sapgw00 can be accessed by the cloud account under the virtual host and port espm_appserver with service sapgw23. function module in case of RFC). which we had configured before (sapgw23 maps to system number 23). define the system which hosts the function module you like to make accessible: On the Resources tab. Function modules not listed in the resources for a system cannot be invoked.client. click the Add button on the menu bar of the Mapping Virtual To Internal System group.a.ashost and jco. Enter the following values in the Add Resource popup window: Function Name: ZSEPM_TOPSELLER_GET Naming Policy: Exact Name Click Save. Screenshot .37 Explanation Click Add in the Resources Accessible On localhost:8443 view. Explanation The Access Control view should now look as shown in the screenshot. Screenshot . You have now configured the services which are needed by the Web Shop application. If you want to learn more about usage of JCo and RFC in the SAP HANA Cloud Platform. Go into your browser and refresh the application. Navigate to the Top 5 Selling Products tab. Summary You have now learned how to use an on-premise ABAP function module directly from a cloud application. The underlying data is retrieved from the used ABAP function module. have a look at following online resources: [1] Invoking ABAP function modules via RFC protocol [2] SAP Java Connector (Standalone Version) .39 5. Next step is to test the Web Shop application again. It should show a table with the 5 top selling products.4 Testing the application The application is now set up to use the ABAP function module. Thank you for participating in this SAP TechEd Virtual Hands-On Workshop! Please.com/cgi-bin/qwebcorporate.sapsurvey.com/wiki/display/EmTech/Developers+Scenarios+using+SAP+HANA+Cloud [2] http://scn.sap. Find a shortcut to the survey on the desktop of your virtual laptop image or visit https://www.sap.sdn.dll?idx=FSQCZ7 . This is a typical scenario which shows how companies can use the cloud to build extensions on top of their existing heterogeneous on-premise IT landscape and integrate them via point-to-point connections.com/docs/DOC-41491 You can also try it out at home. take a few minutes to answer a couple of feedback questions concerning your session. The used Web Shop application is documented as a SAP HANA Cloud Platform reference application in SDN: [1] http://wiki.6 SUMMARY AND FURTHER INFORMATION In this Hands-on session you have practiced the usage of the SAP HANA Cloud connectivity service to integrate an ondemand Web Shop application with an on-premise ABAP system. Please see http://www. All rights reserved. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.com/corporate-en/legal/copyright/index. National product specifications may vary.epx#trademark for additional trademark information and notices. Nothing herein should be construed as constituting an additional warranty. . These materials are provided by SAP AG and its affiliated companies (“SAP Group”) for informational purposes only.sap.COPYRIGHT © 2013 by SAP AG or an SAP affiliate company. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services. without representation or warranty of any kind. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. if any.
Copyright © 2024 DOKUMEN.SITE Inc.