Systems, Tools, Services:
- Guest OS (VM Back-End)
- NetWeaver 7.50 (S/4HANA)
- Host OS
- Eclipse IDE with ABAP tools (ABAP in Eclipse), Web browser (Google Chrome)
- HANA Cloud Platform (HCP)
- Cloud Cockpit
Downloads / Developer Access Key
|Z_ACME_S4EXT_SET_SO_STATUS.txt||Source code for function module Z_ACME_S4EXT_SET_SO_STATUS||Step 2: Create and Activate new Function Module|
|35408798513176413512||Developer Access Key for NPL system||Step 2: Create and Activate new Function Module|
Step 1: Preparation Steps
1.1 Start the SAP NetWeaver AS ABAP system
Start your NetWeaver AS ABAP system and verify that it is running properly, as described in the preparation step Week 4 - Unit 3 - Step 1.2. The backend system should be based on the snapshot state Week 4 - Unit 3 - Step 8.
Step 2: Create and Activate new Function Module
To set the status of the Sales Order in the SAP S/4HANA backend system, you need to create a new ABAP Remote Function Module (RFC) which has functions to set the sales order status.
2.1 Create new Function Group
- Open Eclipse IDE and switch to the ABAP Perspective.
Double-click on your ABAP Project to connect to the ABAP system. If you do not have an ABAP project, follow the steps to create an ABAP project.
- It opens a dialog window Logon to Project <your ABAP Project name>
- Enter user Developer
- Enter password Appl1ance if you didn’t change the password.
Right-click on the ABAP project you created and click on New , ABAP Function Group.
- In the open dialog, enter the following:
- In the Package field, enter $TMP.
- Enter Z_ACME for the Name field and a short description.
- Click Next.
- You are asked to enter a Developer Access Key for your ABAP system. This is asked for the first time when you create objects if you use the developer edition of a SAP NetWeaver 7.50 ABAP Application Server.
- For the field Access Key, Enter 35408798513176413512.
Click Finish in the next screen to create a Function Module.
In the Project Explorer window, click the icon looking like double-arrow, Link with Editor to select the newly created Z_ACME in project explorer.
2.2 Create new Function Module
- Right-click on the ABAP Function Group Z_ACME and click New.
Click on ABAP Function Module.
- It opens a new ABAP Funtion Module dialog. Fill the fields :
- Project is the ABAP Project which you created in Step 1.
- Name : Enter Z_ACME_S4EXT_SET_SO_STATUS
- Description : Enter Z_ACME_S4EXT_SET_SO_STATUS
- Function Group: Z_ACME should be selected.
Click Finish in the next screen.
- Copy the contents of the file Z_ACME_S4EXT_SET_SO_STATUS.txt into the clipboard.
- Replace the contents of the newly created function module Z_ACME_S4EXT_SET_SO_STATUS with your clipboard contents.
- Click Save to save the changes.
Click on the button Activate to activate the function module.
2.3 Remote enable the Function Module
If the function module has to be called from another SAP system or from the cloud, the function module has to be remote-enabled. (Sometimes this is also called RFC-enabled.)
- Select the Function Module Z_ACME_S4EXT_SET_SO_STATUS in the Project Explorer window.
- In the Properties tab in the Eclipse window, click on Specific.
- Change the Processing Type to RFC to enable the ABAP Function Module to be Remote Function Call.
Click Save to save the changes.
Check the button Activate inactive ABAP development objects to activate the changes.
Step 3: Test the ABAP Function module
- Right-click on the ABAP Function Module Z_ACME_S4EXT_SET_SO_STATUS, which you created in the previous step.
Click on Run As and click on ABAP Application.
- This opens the Test Function Module: Initial Screen.
- To get a value of Sales Order IV_NODE_KEY, let us browse the table containing Sales Orders in the Java Hub application.
- Login to your SAP HANA Cloud Platform account https://account.hanatrial.ondemand.com/cockpit/ using your trial user and password.
In the navigation area on the left side, choose Java Applications under Applications.
Select the Java application hub and click on the URL in the Application URLs section to open the hub applicaton.
- The Java application hub opens in a new browser tab.
Enter your HCP user ID and password.
Click on the link GET odata.svc/SalesOrders and search for a Sales Order with LifecycleStatus: N.
Copy the Node key of this Sales Order.
- Paste the value in the field IV_NODE_KEY in the Eclipse view for testing your Function Module.
- Enter X for the field IV_SET_SO_IN_PROCESS to set the sales order to status: In Process
Click on Execute (or press the F8 key).
It switches to the Test Function Module: Result Screen and the RFC Function should not return any errors.
|< Previous Unit 1||Up ^ Week 6||Next > Unit 3|