Thursday, July 28, 2011

BSP how to dynamically identified SAP environment for BSP URL

Recently we had a problem with to identify the environment of the BSP or WEBdynpro.


My colleague Sarah provided me with a superb solution that is using the

call method clwdutilities=>constructwdurl.(which i put in the * event handler for data retrieval for BSP)

But then comes another problem the method will attached the url with "webdynpro" into the URL.

Initially we were thinking of making a new method identical to it. But a recent googling we encountered the syntax "replace all occurrences of" so it works for us with out creating a method by just changing the last string : D!


Well if Sarah you are reading this a BIG thank you! : D

 
*
Get URL of Target Application

  call method clwdutilities=>constructwdurl
  exporting
    applicationname = 'ZBSPHPTSCR'
    importing
      out
absolute_url = str.

replace all occurrences of '/webdynpro/sap/zbsphptscr' in str with '/webdynpro/sap/zbsphptscr/index.htm' .

 

No comments:

Post a Comment