cancel
Showing results for 
Search instead for 
Did you mean: 

how to get portal domain in a webdynpro application.

Former Member
0 Kudos

hi all,

I want to get the portal domain in my webdynpro application, for example, my webdynpro application should be able to get the domain u201Cdepl01u201D if the portal URL is https://depl01.xxxx.xxx.xx:50001/irj/portal.

could anyone help me?

Thanks!!!

Huai Zhi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI huaizhi lee

For getting the domain name you can use the below class .

data: lv_domain type string . 
  CALL METHOD CL_IC_DOMAIN_SERVICE=>GET_RELAXED_DOMAIN
    RECEIVING
      RV_RESULT =  lv_domain  .  " domain name

hope this is help full .

Regards

chinnaiya P

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for all your reply!!!!

finally I use the CL_IC_DOMAIN_SERVICE to get the domain string and split it with '.'

thanks again!

ChrisPaine
Active Contributor
0 Kudos

Hello Huai Zhi,

so you want the lowest level domain name - eg if the address were forums.sdn.sap.com - you want "forums"?

There is not a good way of doing this.

I would suggest however, that it would be reasonably easy to have this as a parameter that you submit to the application on startup with different value depending on the portal the app is launched from - you could then use that to decide which portal had called the application.

If, however, the reason that you want to get the portal domain is because you are using it to form a URL for subsequent navigation in the same portal - then I would suggest that instead you look at the portal navigation API and navigate to a page within a role in the portal - whichever portal you are then in will produce the absolute URL for your application - you do not need to.

Hope this helps.

Chris