Reset password for SAP Web Dispatcher user

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

It happened. You do not remember anymore the password created by SAP Web Dispatcher (WD) during bootstrap operation. While this is not bad (who can remember a password like aR$#¨%_09fms!” anyway?) and normally your browser safes it for you (hm, maybe not so good) or your password safe (better). But the password is gone, you cannot log on anymore to WD admin interface. No worries, if you have access to the computer where WD is running, you can either

  1. Get the icmauth.txt file and try to hack the password or
  2. Create a new password for your user.

I prefer option b.

The documentation at SAP Help for this gives you some options, like recreate the configuration (bootstrap) and you’ll get a new password for the icmadm user.

  • Creating Administration Users SAP Help

The online documentation for this section only mentions icmon, but for Web Dispatcher you have to use wdispmon. The authors explain this at the parent page of the topic and justify it that this makes things easier. I am not sure to whom, but definitely not for the person reading the guide, as you have to read the parent page to find out why icmon is not available for WD. Note: the page is for WD and still the documentation is using commands for ICM for NetWeaver ABAP #yay.

Content of the icmauth.txt file looks like:

# Authentication file for ICM and SAP Web Dispatcher authentication

icmadm:{SHA384}z3Lq992UB3lmK3F5dND266RBGU1S2xflxQOtSJn4irawcIce+Xo:admin

Field 1 Field 2 Field 3
icmadm is the user {SHA384}z3… is the encrypted password of the user admin is the group of the user.

To change the password of the user icmadm you have to use the wdispmon command with the –a flag. Also provide the path to the WD profile file.

Command: wsdispmon –a pf=sapwebdisp.pfl

Enter c to change the password of an existing user.

Inform the new password. As of now, the new password will not be available to WD, as it is not saved to icmauth.txt. To persist the new password you have to save it. To do so, select s from the menu.

Do not worry, a copy of the old file will be created (in case your co-worker still has the old password). With this done, you can exit the program. Select q from the menu.

(Not sure if you have to restart WD, but I did.) Now you can log on using the new password to WD. Access your WD admin page and log on using icmadm and the new password.

https://localhost:4300/sap/wdisp/admin/public/default.html

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Fish with OData

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Rui Nogueira published a while back a blog series on SCN on how to implement an IoT scenario using a Raspberry Pi and HCP. I think the example shows very well how what the main use case of IoT is. When the blog was published, there was no SAP HCP IoT service available; if you want to implement the same example in a more correct way, you should use HCP IoT. Nevertheless, Rui`s example is easy to implement and shows how the different parts play together: client, server, user.

When I first came across Rui`s blog I noticed that he uses REST and goes through some effort to persist the data. I thought that it would be nice to adopt this to make use of OData. Took me some while to publish this blog J In the end, I did not adjusted his code, it merely served as an orientation. I wrote my own IoT server and client app. The result is a simple, clean and easy to read JEE app that uses JPA and Olingo for exposing the JPA entities and a Java client that does not need to be run on an IoT device. My user dashboard is very simple, implemented in D3.js, and only shows one sensor`s measurement data.

The client is a Java app that reads current weather data from openweathermap.org. To make this work, you`ll need an API key (free). In case you do not want this, I added a jMeter test that creates random temperature data (as seen in above picture). JMeter test file is located here: fish-with-odata\iotserver\test\jmeter\LoadData.jmx. The test is pre-configured to use localhost and port 7080. The test will run for 3 minutes as the 100 measurements are not created at once, but with a fixed time interval of 3 seconds.

The app

The source code can be found on GitHub: https://github.com/tobiashofmann/fish-with-odata

You will find two folders:

  • iotclient, containing the client app
  • iotserver, containing the server and user dashboard

Both are maven projects. It should not be a problem to transform them into Eclipse projects via mvn eclipse:eclipse, but while I developed both in Eclipse, I did not test transforming to an Eclipse project from maven. Sensor and Measurements are implemented using JPA. The relationship between both is that one sensor can have many measurement assigned, but a measurement can only be assigned to one sensor. In the Snesor class, this is done via @OneToMany

Sensor class

@Entity(name = "Sensor")
public
 class Sensor implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
     @Column(name = "ID")
     private long id;
     private String device;
     private String type;
     private String description;
     @OneToMany(mappedBy = "sensor", cascade = CascadeType.ALL)
     private List<Measurement> employees = new ArrayList<Measurement>();

Measurement class

@Entity(name = "Measurement")
public
 class Measurement implements Serializable {
     @Id
     @GeneratedValue(strategy = GenerationType.TABLE)
     @Column(name = "ID")
     private Long id;
     private String unit;
     @Temporal(TemporalType.TIMESTAMP)
     @Column(insertable = true, updatable = false)
     private Date createdAt;
     @Temporal(TemporalType.TIMESTAMP)
     @Column(insertable = false, updatable = true)
     private Date updatedAt;
     private Double value;
     @ManyToOne
     @JoinColumn(name = "SID", referencedColumnName = "ID")
     private Sensor sensor;

I am lazy so I let JPA decide when a measurement is created or updated. This may not be acceptable in most scenarios, especially when you depend on the exact time when the data was captured by the device and not when it was persisted in the DB. I implemented it that way to not have to take care of capturing the date in my client app and to keep the payload low.

Run server

To run the server:

mvn clean pre-integration-test

This will download the HCP SDK, install the server, run it on port 7080 and deploy the WAR file. After some while, the IoT server is ready.

A benefit of OData can be seen when comparing how Rui is consulting the latest added measurement for a sensor: he adds the latest measurement as an object to the sensor.

private Measurement lastMeasurement;

With OData, the latest added measurement for a sensor can be retrieved by simply adding some parameters to the URL:

$top parameter controls how many data points are returned. Beware that with OData, there is a page size defined that limits the max number of requests returned. This parameter is configurable in the class de.tobias.service.ODataSampleJPAServiceFactory

private static final int PAGE_SIZE = 50;
Assign any value to PAGE_SIZE you consider useful.

Run client

To run the client, you first must add your API key. This is done in the class de.itsfullofstars.iot. WeatherData. Add your API to APPID.

private static final String APPID = “YOUR API KEY”;

To run the client, create the jar:

mvn package
java –jar target\fishodataclient-1.0.0.jar

As an alternative, a jMeter test is included in the server: fish-with-odata\iotserver\test\jmeter\ LoadData.jmx

The final chart can be seen by accessing: http://localhost:7080/iotserver/. Depending on what data source you use, the chart will look like a flat line or like a heart attack.

Real data (Rio de Janeiro)

Fake data

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Olingo – Requested entity could not be found

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Lately I was playing around with HCP and Olingo and wanted to expose a JPA model as OData. I created some data using EJB and then tried to read this data via OData. Accessing the collection gave me a list of created entities:

To access one entity, it is just using its ID as key and call it in the browser: http://localhost:8080/service.svc/Events(8L) What I got as a response was an error message: Requested entity could not be found.

<error xmlns=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata”>

<code/>

<message xml:lang=”en-US”>Requested entity could not be found.</message>

</error>

Thing is: the entity was there. I know it (I have DB access), I just could not access it. Turned out that the version of org.eclipse.persistence.jpa I was using does not like when the @ID key is of type long (8L). Using version >= 2.5.2 solved the issue for me. Changing my pom.xml:

<dependency>

    <groupId>org.eclipse.persistence</groupId>

    <artifactId>org.eclipse.persistence.jpa</artifactId>

    <version>2.5.2</version>

</dependency>

Now I can access the entity using the ID as key in the URL:

Note

You`ll have to declare org.eclipse.persistence.jpa in your pom.xml when you are using a non-JTA data source (RESOURCE_LOCAL) and when you create your entity manager like this:

ds = (javax.sql.DataSource) ctx.lookup(“java:comp/env/jdbc/DefaultDB”);

Map properties = new HashMap();

properties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, ds);

emf = Persistence.createEntityManagerFactory(“JPATest”, properties);

If you just use

emf = Persistence.createEntityManagerFactory(“JPATest”);

You won`t have to declare it in pom.xml. Either way, if you do not declare it, or use the wrong version, you`ll end up getting the same error: Requested entity could not be found. The version of the library delivered with HCP is 2.75.8.4 org.eclipse.persistence.jpa_2.4.1.v20121003-ad44345 and looking the Google results, this version is also not working 100% when the @ID is long. Best solution should be to declare the dependency in pom.xml and use as version at least 2.5.2.

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 62 – Create outbound destination for content publisher

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help.

  1. Maintaining Inbound bgRFC Queue on the Hub System SAP Help
  2. Create outbound destination for content publisher SAP Help

This document explains how to execute step 2.

When a mobile user subscripes for push notification, he/she basically informs SAP Gateway to receive updates on a collection. As Gateway handles subscriptions in a pretty abstract way, the user needs to inform some information during the subscription process. One of these informations is the communication channel. This channel corresponds to a HTTP destination created at the HUB system.
SAP Help

A user subscribing will pass the following channel information to Gateway: urn:sap-com:channel:<CHANNEL_NAME>/<unique_ID_of_device

The first part (urn:sap-com:channel) is used by OData as a keyword to filter and extract the name of the channel. The channel name is a HTTP destination created in SM59. I’ll use SMP_PUSH. This implies that you can have several push destinations for a single SAP Gateway system.

No SPRO activity

All activities are done on the SAP Gateway HUB (FND) system.

  1. Create HTTP Destination
  2. Transaction SM59


  3. New Destination


  • RFC Destination: SMP_PUSH
  • Connection Type: G


  1. Go to tab “Technical Settings”
  • Target host: Host of SMP 3 (smp3.tobias.de)
  • Service No: HTTP Port of SMP 3 (8080, depends on your configuration)
  • Path Prefix: Prefix used by SMP 3 for push notifications (/Notification/)


  1. Go to tab “Logon & Security


  • User: SMP Push user (smppush)
  • Password: password of SMP Push user
  1. Save
  2. Test destination

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 61 – Maintaining Inbound bgRFC Queue on the Hub System

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help.

  1. Maintaining Inbound bgRFC Queue on the Hub System SAP Help
  2. Create outbound destination for content publisher SAP Help

This document explains how to execute step 1.

“SAP NetWeaver Gateway uses inbound queues to reliably send information to a consumer (Such queues are used by various services. For example, the Notification Content Publisher). These inbound queues use bgRFC (Background Remote Function Call) technology.”
SAP Help

No SPRO activity

All activities are done on the SAP Gateway HUB (FND) system.

  1. Creating RFC Destination for Inbound Queue
    1. Transaction SM59


    2. Create new connection


  • RFC Destination: IWFND_ODATA_PUSH.
  • Connection Type: 3


  1. Go to tab “Special Options
  • Transfer Protocol: Classic with bgRFC.


  1. Save
  2. Test RFC destination


    Result


     

  1. Registering RFC Destinations for Inbound Queue
    1. Transaction: SBGRFCCONF


    2. Go to tab “Define Inbound Dest.
    3. Create


  • Inb. Dest. Name: IWFND_ODATA_PUSH


  1. Save.


     

  2. Go to tab: “Scheduler: Destination
  3. Create


  • Type: Inbound


  • Destination: IWFND_ODATA_PUSH


  1. Save

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 5 – Activate SAP NetWeaver Gateway

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help. The steps are for the OData Channel Service for backend system.

  1. Basic configuration activities: SAP Help
    • Set profile parameters to support SSO2 SAP Help
    • Activate ICF Services Blog / SAP Help
  2. User & Authorization SAP Help
  3. SAP Gateway to Consumer (FND to SMP3) SAP Help
    1. Creating a bgRFC destination for outbound queues Blog SAP Help
    2. Registering bgRFC destination for the oubound queue Blog SAP Help
    3. Creating bgRFC supervisor destination Blog SAP Help
  4. SAP Gateway to SAP Backend (FND to BEP) SAP Help
    1. Create RFC on SAP Gateway (FND) to SAP backend (BEP) Blog SAP Help
    2. Define trust between SAP Gateway and SAP backend (FND <-> BEP) Blog SAP Help
    3. Configure SAP backend system (BEP) to accept assertion ticket from SAP Gateway Blog SAP Help
    4. Configure SAP Gateway (FND) to accept assertion ticket from SAP backend (BEP) BlogSAP Help
    5. Configure SAP system alias for applications BlogSAP Help
  5. Activate SAP NetWeaver Gateway SAP Help

This document explains how to execute step 5.

The final step is to activate the SAP Gateway functionality. SAP Help

SPRO: SAP Reference IMG and navigate to:  SAP NetWeaver Gateway OData Channel Configuration Activate or Deactivate SAP NetWeaver Gateway


  1. Execute the activity. Confirm the dialog to activate SAP Gateway
  2. Result:

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 45 – Configure SAP system alias for applications

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help. The steps are for the OData Channel Service for backend system.

  1. Basic configuration activities: SAP Help
    • Set profile parameters to support SSO2 SAP Help
    • Activate ICF Services SAP Help
  2. User & Authorization SAP Help
  3. SAP Gateway to Consumer (FND to SMP3) SAP Help
    1. Creating a bgRFC destination for outbound queues SAP Help
    2. Registering bgRFC destination for the oubound queue SAP Help
    3. Creating bgRFC supervisor destination SAP Help
  4. SAP Gateway to SAP Backend (FND to BEP) SAP Help
    1. Create RFC on SAP Gateway (FND) to SAP backend (BEP) SAP Help
    2. Define trust between SAP Gateway and SAP backend (FND <-> BEP) SAP Help
    3. Configure SAP backend system (BEP) to accept assertion ticket from SAP Gateway SAP Help
    4. Configure SAP Gateway (FND) to accept assertion ticket from SAP backend (BEP) SAP Help
    5. Configure SAP system alias for applications SAP Help
  5. Activate SAP NetWeaver Gateway SAP Help

This document explains how to execute step 4.5.

Incoming OData request can be handled locally by the Gateway system or redirected to an SAP Backend. In a HUB installation, the OData service backend is a diferente SAP system (BEP), therefore an alias is needed to define to which backend a OData service should be redirected to.
SAP Help

The alias defined here will be used in the maintain odata services transaction to assign a backend to a service.

SPRO: SAP Reference IMG and navigate to:  SAP NetWeaver Gateway OData Channel Configuration Connection Settings SAP NetWeaver Gateway to SAP System Manage SAP System Aliases


The program to manage SAP system alises opens.


  1. Create a new entry

  1. Enter the corresponding data for the SAP backend
  • SAP System Alias: ECC
  • Description: BEP backend
  • Local GW: No
  • For Local App: No
  • RFC Destination: ECCCLNT001
  • Software Version: DEFAULT
  • System ID: ECC
  • Client: 001
  • WS Provider system: empty

  1. Save
Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 44 – Configure SAP Gateway (FND) to accept assertion ticket from SAP backend (BEP)

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Yes, this item should be under BEP and not HUB, but I am following SAP Help here, so sorry for the confusion!

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help. The steps are for the OData Channel Service for backend system.

  1. Basic configuration activities: SAP Help
    • Set profile parameters to support SSO2 SAP Help
    • Activate ICF Services SAP Help
  2. User & Authorization SAP Help
  3. SAP Gateway to Consumer (FND to SMP3) SAP Help
    1. Creating a bgRFC destination for outbound queues SAP Help
    2. Registering bgRFC destination for the oubound queue SAP Help
    3. Creating bgRFC supervisor destination SAP Help
  4. SAP Gateway to SAP Backend (FND to BEP) SAP Help
    1. Create RFC on SAP Gateway (FND) to SAP backend (BEP) SAP Help
    2. Define trust between SAP Gateway and SAP backend (FND <-> BEP) SAP Help
    3. Configure SAP backend system (BEP) to accept assertion ticket from SAP Gateway SAP Help
    4. Configure SAP Gateway (FND) to accept assertion ticket from SAP backend (BEP) SAP Help
    5. Configure SAP system alias for applications SAP Help
  5. Activate SAP NetWeaver Gateway SAP Help

This document explains how to execute step 4.4.

Allow SAP backend (BEP) to logon via SSO to SAP Gateway HUB (FND).
SAP Help

No SPRO activity.

System: BEP

Transaction SSO2

To configure SSO by installing the system certificates, go to transaction SSO2

  • Destination: Give RFC destination: ECCCLNT001

  • Host name: DNS name of backend (BEP): nwecc.tobias.de
  • Instance Number: Instance number of backend (BEP): 01

Run the program. In case the tool finds some problems, it allows you to let it solve them for you.

Result when everything is OK:

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

FND – 43 – Configure SAP backend system (BEP) to accept assertion ticket from SAP Gateway

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn

Yes, this item should be under BEP and not HUB, but I am following SAP Help here, so sorry for the confusion!

The configuration steps to be executed on the HUB system (FND) are detailed at SAP Help. The steps are for the OData Channel Service for backend system.

  1. Basic configuration activities: SAP Help
    • Set profile parameters to support SSO2 SAP Help
    • Activate ICF Services SAP Help
  2. User & Authorization SAP Help
  3. SAP Gateway to Consumer (FND to SMP3) SAP Help
    1. Creating a bgRFC destination for outbound queues SAP Help
    2. Registering bgRFC destination for the oubound queue SAP Help
    3. Creating bgRFC supervisor destination SAP Help
  4. SAP Gateway to SAP Backend (FND to BEP) SAP Help
    1. Create RFC on SAP Gateway (FND) to SAP backend (BEP) SAP Help
    2. Define trust between SAP Gateway and SAP backend (FND <-> BEP) SAP Help
    3. Configure SAP backend system (BEP) to accept assertion ticket from SAP Gateway SAP Help
    4. Configure SAP Gateway (FND) to accept assertion ticket from SAP backend (BEP) SAP Help
    5. Configure SAP system alias for applications SAP Help
  5. Activate SAP NetWeaver Gateway SAP Help

This document explains how to execute step 4.3.

Allow SAP Gateway HUB (IWNFD) to logon via SSO to SAP backend (BEP).
SAP Help

No SPRO activity.

System: BEP

Transaction SSO2

  1. To configure SSO by installing the system certificates, go to transaction SSO2

  • Destination: Give RFC destination: GWDCLNT001 (IMPORTANT: must have been created earlier on the BEP system)

  • Host name: DNS name of SAP Gateway HUB: nwgw74.tobias.de
  • Instance Number: Instance number of SAP Gateway HUB: 01

Run the program. In case the tool finds some problems, it allows you to let it solve them for you.

Result when everything is OK:

Let the world know ...Tweet about this on TwitterShare on Google+Share on FacebookEmail this to someoneShare on LinkedIn