SMP 3.0: Custom development of SAP Work Manager 6.1 on Agentry Server
I have been spending a couple of days on setting up an environment for doing custom development on SAP Work Manager 6.1 on SMP 3.0.
I have been missing a guide to instruct me step by step how to do this. As I have been unable to find this I will now provide it to others.
This guide will NOT show you how to do development on the Agentry platform, but how to prepare and setup an environment to do this.
Due to the limitations of SMP 3.0 SP3, where you can only deploy one Agentry instance to the mobile platform, you will want to install a production Agentry server instance on your central SMP 3.0 Development server. This will be used for unit test by you and your end users. For development purposes you will install a local SMP 3.0 server on your personal PC, and install an Agentry development instance on this.
Documentation:
Various documentation exists on these topics, but to pinpoint exactly what you need is hard. Here is a few links to some relevant docs:
SMP 3.0
https://help.sap.com/smp303svr/
SAP Work Manager 6.1
https://service.sap.com/instguides
Go to: SAP Components -> SAP Work Manager -> SAP Work Manager 6.1
From here you may download a number of PDF documents.
Especially document “SAP Work Manager 6.1 Installation Guide” is of interest.
Prerequisites:
You will need to download a few files before starting the installation and setup process. You will need an S-user with proper authorizations for most of the downloads. I am using a 64-bit PC, and hence is downloading 64-bit installables.
P1. SMP 3.0 installer.
Go to https://service.sap.com/swdc
Go to: Installations and Upgrades -> A-Z Index -> M -> SAP MOBILE PLATFORM -> SAP MOBILE PLATFORM 3.0 -> Installation
Download the object 51048153 (for Windows).
It is a zip archive, which must be extracted.
The installer is: .SMP30SP03SVRsetupAMD64.exe
P2. JDK – version 1.7
You will need a JDK version 1.7 to build Java classes for the interaction between the Agentry Server and the SAP Backend.
Go to: https://www.oracle.com/technetwork/java/javase/downloads/index.html
Choose JDK download for latest release.
P3. Eclipse – Juno, version 4.2.2
From this link you can download Eclipse (classic) in the proper version:
P4. Agentry plugin for Eclipse
You need an Eclipse plugin for modifying Agentry definitions.
Go to https://service.sap.com/swdc
Go to: Installations and Upgrades -> A-Z Index -> M -> SAP MOBILE PLATFORM SDK -> SAP MOBILE PLATFORM 3.0 SDK -> Installation
Download the object 51047862 (for Windows).
It is a zip archive, which must be extracted.
The plugins are located in folder: .modulesAgentryEditors
The 64-bit plugin archive is named “Agentry_7.0.0.537_EditorPlugin_x86_64.zip”.
P5. SAP Work Manager 6.1 Application and Agentry utilities
The SAP Work Manager 6.1 Agentry application and the necessary dll’s, jar’s and config files are provided by an executable that needs to be run. Here you will provide details for the JavaBE.ini file (backend hostname, client, username, password etc). This will generate the needed files for you.
Go to https://service.sap.com/swdc
Go to: Installations and Upgrades -> A-Z Index -> W -> SAP WORK MANAGER -> SAP WORK MANAGER 6.1.0 -> Installation
Download the object 51048537_6 (SAP Work Manager 6.1.0 Deployment).
It is a zip archive, which must be extracted.
The executable is located in folder: .SAP_WORK_MANAGER_6.1.0_Work_Manager_Deployment
The executable is named “SAPWorkMgr610Deployment.exe”.
P6. Java Source code for SAP Work Manager 6.1
In the Java folder in you Agentry root directory a number of .jar files are located. They include the Java class files which do the interaction between the Agentry server and the SAP backend. If you need to make modifications to extend the data that is being passed, you will need to be able to change the source code. By default the source code is NOT available, when you download the Work Manager. You will need to sign a contract with SAP to get access to the source code. Once this is in place, you can find the source code in the SAP Software Download Center.
Go to https://service.sap.com/swdc
Go to: Installations and Upgrades -> -> A-Z Index -> M -> SAP Mobile Solutions -> SAP Mobile Source Code -> SAP WORK MANAGER SRC -> SAP WORK MANAGER SRC 6.1.0 -> WORK MGR JAVA SRC 6.1.0 -> # OS independent
Download the object WORKMGJAVASRC_01_0-80000157.ZIP
The object is a zip archive, which should NOT be extracted (it will be imported directly to Eclipse).
P7. ABAP Backend AddOn
For the SAP Work Manager 6.1 to work you need to install the following ABAP AddOn’s on the SAP Backend.
SMFND, 610_700, SP 0003 (Download object: SAPK-61003INSMFND)
SMERP, 610_700, SP 0003 (Download object: SAPK-61003INSMERP)
Go to https://service.sap.com/swdc
Go to: Support Packages and Patches -> Search for Support Packages and Patches.
From here type in the above download objects, and search for them.
These should be installed by a SAP Basis person.
After the installation of the AddOn’s there are some steps that needs to be carried out on the backend. Refer to the documentation of SAP Work Manager 6.1 for details.
Installation overview
Now all necessary files have been downloaded.
An overview of the installation process is described below.
Note: You need local admin rights on your PC to perform most of the following steps, so please make sure this is in place.
In the Installation overview I assume that the ABAP AddOns have been installed and the (standard) Mobile Application has been prepared properly on the SAP backend.
Step 1. Install JDK 1.7 on your PC
Run the JDK 1.7 installer. Installation will take a few minutes.
Step 2.a Install SMP 3.0on your PC
Run the installer setupAMD64.exe.
Install the SMP 3.0 as a Development Server using a local (Derby) DB.
The installation is very simple.
A few icons will be placed on your desktop, to start and stop the SMP server, as well as a shortcut to the Administration Cockpit. You will need local admin rights to start and stop the server.
Step 2.b Install server certificate to avoid warnings when accessing Management Cockpit
After installation of the SMP 3.0 Server, double-click the certificate SMP_HOMEServerconfigurationsmp_crt.cer. Install the certificate to your “Trusted Root Certification Authorities”. This way you will not get warnings that the server certificate is not trusted when you access the Management Cockpit.
(Check also comment by Stephen Kringas below).
Step 3. Setup Eclipse
Extract the downloaded .zip archive.
Copy the folder “eclipse” to a suitable location. No installation is required.
Start Eclipse from the Eclipse.exe executable.
Assign an empty folder as the workspace of the Eclipse installation.
Step 3.a. Install the Agentry Plugin to your Eclipse installation
From Eclipse go to Help->Install new software…
In the Install window click the Add button in the top right corner.
In the Add Repository Window click the Archive button.
Navigate to the downloaded Agentry Plugin described in prerequisite P4.
(Plugin archive: Agentry_7.0.0.537_EditorPlugin_x86_64.zip)
Mark the “Agentry 32-bit Editor” node and install the plugin via the wizard.
Step 4. Install (extract) SAP Work Manager 6.1 application to your PC
You will now run the executable “SAPWorkMgr610Deployment.exe” described in prerequisite P5.
While running the executable you should provide various connection details for connecting to your SAP backend. This is the stuff written to the JavaBE.ini file. The service user password is now encoded into the ini file, which is a nice change compared to previous versions of Agentry.
At the end of the process you must provide a target where the generated files are stored. This can be any directory on your PC, and does not have to be related to the SMP server.
The files extracted are placed in the folder:
configurationcom.sap.mobile.platform.server.agentry.application
Step 5. Import the extracted Agentry (SAP WorkMgr 6.1) application to Eclipse
In the above folder a .zip archive called “SAPWM-6.1.0.0.zip” is placed.
In here you will find the Agentry.ini file as well as an Application folder where a productive version of the Agentry application is stored.
Extract the .zip archive to a new destination (do not place it in the same folder as the zip archive).
Remove the zip archive from the folder.
From Eclipse choose File->Import…
Choose Agentry Project-> Agentry Server application into workspace (Agentry.ini)
In the Wizard, click on the Browse button for the field Agentry Server.
Navigate to the Agentry.ini file of the extracted archive described above.
The fields Application Version, Project Name and Application Name will be filled automatically.
For the Development Server, browse to the same Agentry.ini file.
Click Finish.
The Agentry application will now be imported as an Agentry project to the Eclipse installation.
Step 6. Export/publish the Agentry application as Development version to local folder
After the Agentry application has been imported to Eclipse, it can by published as a Development version application to your local folder.
In the Eclipse toolbar there will be an Agentry Publish button – click this.
You will be warned that there are warnings in the application – just accept this.
In the next popup you will keep the default settings, which is to publish as Development version, To Server should be pointing to your local folder with the Agentry.ini file and the Application folder.
Click Next.
The Wizard will now export the Agentry Application in a Development version to your local folder.
Important Note: Keep in mind that at this point we don’t even have an Agentry Server defined, so for steps 5 and 6, we are only interacting with the file system.
Step 7. Prepare the development version of the Agentry application for SMP
You will now go to the folder configurationcom.sap.mobile.platform.server.agentry.application
from step 4 (folder A).
Make sure the zip archive “SAPWM-6.1.0.0.zip” has been removed as described in step 4 (the folder where the zip archive was extracted to is called folder B)
Now copy the Agentry.ini file from the folder B to folder A.
Create a folder called “Application” in folder A.
Copy the entire folder “Development” of BApplication to AApplication.
Now Zip the contents of folder A. Make sure to NOT zip the folder itself but rather all its components.
Step 8. Define Agentry application on the SMP 3.0 and import the Development Version Application
Now logon to your newly installed SMP 3.0 system on your PC.
Go to Applications and choose New.
Create an application of type Agentry, and provide it with a security profile of type “No Authentication Challenge”. This is chosen as the user will be authenticated against the SAP backend system and not the SMP.
On the tab “App Specific Settings” Browse to the archive created in step 7, for the Publish Agentry App field.
Save your Application.
Restart the SMP.
Your Development version Application should now be ready for use.
Go to: https://:8081/SAPWM
You should be presented with a screen saying: “I am here!”
Step 9. Modify the Java Source code of SAP WM 6.1 to Eclipse (optional)
If you need to make extend the data structures being passed between the Agentry Server and the SAP Backend, or need to implement advanced functionality, then you will need to modify the Java source code supporting the Agentry application.
Step 9.a. Import the source code to Eclipse
In Eclipse choose File->Import…
Choose General->Existing projects into workspace
In the Import window click the Browse button of the “select archive field”.
Navigate to the zip archive “WORKMGJAVASRC_01_0-80000157.zip” described in prerequisite P6.
Make sure all projects are marked for import and the tick for “Copy projects into workspace” is set.
Click Finish.
The source code is now loaded into Eclipse.
There are some invalid references to some files in folder C:ProductDevsapjars.
The easiest fix is to create these folders, and copy the files in question from folder A in step 7.
Then all projects should be validated.
Step 9.b. Modify the Java source code
You can now do your changes to the Java Source code directly from Eclipse.
Step 9.c. Export the Java source code
When you have all your changes, you need to export the Java classes to a .jar file (Java Archive).
Select all the source code projects from the Project Explorer in Eclipse.
Choose File->Export…
Choose Java -> JAR file
In the JAR export wizard, tick the 2nd and 3rd option (“Export all output folders… ” and “Export Java Source…”).
Choose a destination for your .jar file.
Click Finish
Step 9.d. Import the new Java source code to SMP
You will now need to upload the .jar file to the Java folder of your Agentry server.
The easiest method, is to do a simple file move directly to the file system of the SMP server.
The Java folder of the SMP server is:
SMP_HOMEServerconfigurationcom.sap.mobile.platform.server.agentry.applicationJava
EDIT:
Simple file moves is not the proper way of performing changes to the Agentry Server.
You should put your .jar file in a folder called ‘Java’.
Next to the ‘Java’ folder you should create a folder called ‘Application’, in which you will
have a new version of your Agentry application.
Zip the two folders in one .zip archive and publish via the Management Cockpit.
Step 9.e. Configure the Agentry server on SMP 3.0 to use new .jar file
You now need the Agentry Server to use this new .jar file.
Go to the Administration Cockpit and administer the Agentry Application.
Go to the tab Backend in the JAVA-1 section.
The field Class Path needs to be changed to include your new .jar file.
By standard the Java Project “SAP-Common” has its own .jar file, and hence 2 .jar files are used.
But if you exported everything to a single .jar file, then the reference to the 2 SAP jars should be replaced with a reference to your new jar file.
The default value is: ./ini4j.jar;./sapjco3.jar;./Java/Agentry-v5.jar;./Java;./Java/SAPWM-6.1.0.0.jar;./Java;./Java/SAPCommon-133461.jar;
Your new value should be:
./ini4j.jar;./sapjco3.jar;./Java/Agentry-v5.jar;./Java;./Java/.jar;
Restart the SMP.
Check the startup.log file of the Agentry server, and ensure that you don’t have any errors on your server.
If this is the case, your are all set.
Step 9.f. Debug your Java Code.
Refer to this Wiki written by Jason Latko.
Debug SMP 3.0 Agentry Java in Eclipse – SAP Mobility – SCN Wiki
Step 10. Test the application.
Use the ATE or (as we did) install the Android SDK and test via your Android Emulator.
The connection process from the new 7.0 client are a little different from previous versions. You no longer provide a server name and port, but rather an https endpoint (URL).
The default URL endpoint for SAP Work Manager 6.1 is:
https://:8081/SAPWM
The application ID (“SAPWM”) can be found in the startup.log of the Agentry Server.
That’s it – I hope that this will be useful to others.
Søren Hansen
New NetWeaver Information at SAP.com
Very Helpfull