Meet URL – Pointing to SAP Help Portal topics from Blogs and Newsgroups
For those of you out there who contribute your knowledge and opinions about SAP HANA’s inner workings to newsgroups and blogs, you might want to get to know the URL structure for SAP Help Portal topics.
Help Portal has some URL behaviors and conventions that allow you to add meaningful links that will last over time.
Help Portal URL Structure
I mentioned in my post on Improving search engine results when searching for SAP HANA docs that the Help Portal URL structure contains some predictable and informative bits. If you already know about them, you can skip to the next section. If you don’t, here you go:
Here’s an example and a breakdown of the structure:
- https://help.sap.com/viewer – ‘viewer’ sets the framework around the topic. Help Portal does not allow you to view a topic as plain HTML for printing purposes like some help websites do. It does something better.. it gives you a Print button that does what you want.
- 4fe29514fd584807ac9f2a04f6754767 – the (unique) ID of the book you are looking at. No other book in the universe has this ID and it is not likely to ever change before the end of time. And in this case, it’s the “SAP HANA SQL and System View Reference Guide”.
- 2.0.02 – the version of the software. In this case, 2.0.02. means “SAP HANA 2.0 SPS 02”.
- en-US – the language/locale. Who knows.. one day you might be able to toggle the URL to another language like ja-JP to see the Japanese version of the topic….
- 20d5252d7519101493f5e662a6cda4d4 – This is the (unique) ID of the topic itself. No other topic in the universe has this ID. And in this case, the topic is the “CREATE STATISTICS statement”.
OK, now that you’ve met URL…
Linking to content within a topic
Yes, you CAN link to sections within a topic.. but only reliably to certain kinds of elements, and only if there is already an ID on the spot you want to point to. For example..
WORKS: Pointing to sections
For example, you can link to the Description section of the CREATE STATISTICS Statement. To do this, you add the bookmark for the section to the end of the URL, with a pound sign to separate it. Here’s an example:
DOESN’T ALWAYS WORK: Pointing to a bullet in a list (even tho there is an ID on the bullet)
When I tried to point to the <data_statistics_properties_group> bullet on the same page as above, it sometimes worked and sometimes didn’t (this is the ID for the bullet: loio20d5252d7519101493f5e662a6cda4d4__create_statistics_data_statistics_properties).
This is the URL – what does it do in your case?
This is likely a browser thing, though. I say this because once I landed on the page, if it didn’t scroll me automatically to the bookmark, a simple hit of the Refresh button scrolled me down. Odd.
How do I know if there is an ID to point to?
Look at the HTML source for the page in whatever source inspection feature your browser offers. Some tips provided at the bottom in the Comments scroll.
Content IDs look like this in the source – and note that everything between the quotes is what you’re going to put after after the pound sign:
or like this if URL encoding of special characters is in use:
Assuming there is an ID, how do I know which elements work well for pointing to?
*Shrug* But as you find out, post your findings as comments below and I will update this list (-:
Findings from users:…
Links to sections – Yes
Links to bullets – Meh
Linking to a specific version of the software documentation
So from getting to know URL, you probably guessed you can fiddle with the version number (e.g., 2.0.02) to set it to what you want. However, be sure you try the link afterwards. Occasionally a topic goes away entirely because we reorganized things.
What if my link points to a version that is no longer on the Help Portal?
Good news.. if your link points to a version that is no longer on Help Portal, Help Portal redirects User to the latest version of the topic instead. From there, User can use the Version drop-down if needed.
If the link is truly broken though (404 error), it’s because the combination of book ID and topic ID are no longer valid for the latest version of the documentation. This is likely because the content was reorganized somehow. Rare but possible.
If this happens, User will intuitively figure out how to find the product page for the product on Help Portal, then figure out which book they should look in, and then use the Help Portal search tool to search the book.
(OK realistically, they’ll hit up a search engine..)
Linking like you just don’t care which version
If you don’t want to link to a specific version, and you really don’t care about version at all, you can pull it from the URL entirely.
For example if you visit the following link (notice it has no version), you’ll arrive on the latest version of the topic, and the URL changes to indicate the version you are looking at (which coincidentally matches the value showing in the Version dropdown on the page):
You can also point the latest version by replacing the version number with the word ‘latest‘:
Can I add anchors to a topic somehow and then link to them from my post?
No is the short answer. (Noooooooooo is the long one.)
Now seems like a good time to say thanks to those who tirelessly blog and post about SAP products. Your thankless commitment is helping the larger user community–one post at a time.
Oh, I guess no longer thankless!
Our email discussions must be some of the most prolific ones I had in a while - spawning blog posts 🙂
I might have an idea on why the ID you listed doesn't work: the ID is not actually in the HTML... When I checked the example, I found (using 'show source') no occurrence of the ID in the served page.Could it be that you took that ID from another source?
Thanks for your ongoing support and your very enjoyable writing.
HI Lars, thanks for trying it out. The ID is there, but certainly obfuscated when using MS Explorer. Plus, but it looks like the MS methods for inspecting source has changed – there is no longer a right-click menu option for it (my bad). Sooo..
In Microsoft Exporer 11.0.45, don’t bother highlighting anything, it’s not going to take you directly to what you highlighted. Instead, when you are on the topic, click the cog shaped widget at the top right of the screen and pick F12 Developer tools. Once in the DOM Explorer pane (bottom), you need to expand the <head> tag. Then, use the Find field (DOM pane top right corner) to search for a string in the HTML area you want to inspect (e.g., data_statistics_properties_group).
In Microsoft Edge, you CAN highlight the area you want to ‘inspect’ for the ID, then you click the elipsis at the top right corner of the screen and pick F12 Developer Tools. This takes you directly to the area in the source that you highlighted so you don’t have to search for it. The URL (and thus the ID) is harder to spot because it is buried in an iFrame tag, and uses URL encoding characters instead of special characters. Here’s the URL with the ID introduced with %23 instead of a hash tag:
In Google Chrome, the right-click menu Inspect option method still applies (after you’ve highlighted what you want to inspect). The Elements pane pops open showing your selection. The ID is above it:
HTH.. I will tidy up wording in the post above.
thanks again for the effort with the screenshots and all. I (of course) also used the developer tools before and guess what: we were both right 🙂
In fact, there is no tag with the id "loio20d5252d7519101493f5e662a6cda4d4__sql_create_statistics_1sql_create_statistics_description".
Instead, the <a>-tag you mentioned has a name with this value.
This name, in turn, is not supported in HTML5 anymore and the id should be used instead (https://www.w3schools.com/tags/tag_a.asp). Since the content system specifies <!DOCTYPE html> we're on HTML5 and cannot rely on this anchor semantic to work.
In all my tests with "id" values used as link-targets I had no issues, but of course never succeeded when using "name" values.
If you can double check and confirm this, then we have another mystery solved.