cancel
Showing results for 
Search instead for 
Did you mean: 

How to get portal URL dynamically via coding?

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

Please help to get portal URL dynamically on each of the portal environment for: Dev/Test/Production portals?

Thanks

Praveen

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

I'd echo Thomas's comment that if you are doing any navigation in the WDA app you should be using the object navigation API - not direct URL navigation - therefore there is no need for a portal URL.

However, I've often seen the need to generate a URL for embedding into an email, PDF, etc. (it should be noted that this isn't really a WDA question)

There is no direct link to the "portal" stored in SAP - this is especially the case where your portal is a standalone Java stack and not directly related to the ABAP stack. In these cases I have found that it is useful to store the base URL of the portal in the Home Page Framework configuration of server resources (in the IMG, cross app, home page framework, resources ) as the detail is also useful in configuring access to documents stored in the KM module of the portal when configuring the HPF.

Generally I find that every implementation of SAP finds their own method of storing this link - mainly driven by the need to embed links to the portal in WF emails, so I'd check with your WF team if they have not come up with a generic solution already. I recommend the approach of using the HPF resource as this means you don't have to create your own table/view - but has the downside that you'll have to fiddle to get a reference to the QAS portal in QAS, dev portal in dev and prod portal in prod.

Hope this helps,

Chris

praveenkumar_kadi
Active Contributor
0 Kudos

Bala's answer above helped temperaorily. we have portal connected to backend, so based on the backend ID, I am just constructing portal URL and further navigation.

However I would go with Thomos/Chris's explaination for a permanent and valid solution.I think Portal navigation/Object navigation API's from WDA can help me incase if there is future landscape changes within my workplace.

Thomos/Chris,

Could you please point me some links related to WDA Portal navigation? I am aware of WD Java Portal navigation API's but not in WDABAP side.

Thanks in advance

Praveen

Former Member
0 Kudos

This message was moderated.

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Why do you need the portal URL? if you are doing navigation within the Portal (from WDA) you should always use the Portal Navigation APIs and not build the complete URL.

Former Member
0 Kudos

Hi,

have you tried CONSTRUCT_WD_URL method from CL_WD_UTILITIES class ?

praveenkumar_kadi
Active Contributor
0 Kudos

Thanks, But before that I need to fetch Portal URL name: For ex: How to get in the code URL like: https://xxx.yyy.com:<port>/irj/portal/xxxAPP

Above URL will be changing on each of the environment except 'xxx' and port.

Get PORTAL NAME (How to get this portal name?)

Here I will be checking

IF PORTAL NAME EQ 'XXX'

Get port.

Construct URL (https://XXX.yyy.com:<port>/irj/portal/xxxAPP)

display URL

endif

Thanks in advance

Praveen.

Former Member
0 Kudos

Praveen,

I am not sure how you get portal url but there is a workaround.each portal will have corresponding backend systems,so based on system variable SYSID you can get the backend system and frame the corresponding portal url

Thanks

Bala Duvvuri