cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate portal request in abap webdynpro component

Former Member
0 Kudos

Hi All,

Appreciate your help on the below requirement.

We have standard SAP webdynpro ABAP application (SAP EM application) which is running in SAP back-end system.

Now webdynpro application can be executed as standalone with in SAP back-end system or can be accessed from EP thru an iView.(webdynpro iView).

How to validate in Webdynpo component code whether the request for executing the webdynpro application is from with in SAP back-end itself (standalone) or the request from EP to access the webdynpro application (thru webdynpro iView).

a) Actually the requirement is if it is standalone execution then we should control in the code to call  below URL on click of hyperlink in the UI. This URL is SAP back end system URL.

backend URL on click of hyperlink :https://sapbackend.test.com:8444/sap/bc/webdynpro/saptrx/em_fpm_ehdetail?EH_GUID=KTVnsIEIHF3X08014Qh...

b) Suppose the webdynpro application is executed from EP ( thru iView) then we should control in the code to call below URL on click of hyperlink in UI. This URL is  web dispatcher URL in EP for SAP back-end. here we used OBN (object based portal navigation) code in webdynpro ABAP to open the screen on click of hyperlink. which is working fine after we tested.

this is zeenar.test.com:8029 is webdispatcher URL from EP. in the above and below two URLs only difference is host name and port number. remaining all the parameters are same. (like GUID and UP_ID).

EP URL on click of hyperlink : http://zeenar.test.com:8029/sap/bc/webdynpro/saptrx/em_fpm_ehdetail?EH_GUID=KTVnsIEIHF3X08014QhMh0&U...

But here the challenge is ,this hyperlink should work in both cases whether webdynpro abap is executed standalone (SAP back-end itself)  and from EP (thru iView). The URLs are different in both cases for hyperlink as mentioned above.

Please let me know how to validate to check in the code on click of hyperlink whether the request is from  standalone execution (with in SAP Backend) or it is called from EP  thru iFrame, then we will be able to mention different URLs to call  based on validation on click of hyperlink to open the page.

Thanks & Regards

Sudhan.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Sudhan,

The IF_WD_APPLICATION interface provides a mechanism to determine an application's client environment...

data lo_api_component type ref to if_wd_component.

lo_api_component ?= wd_this->wd_get_api( ).

case lo_api_component->get_application( )->get_client_environment( ).

    when if_wd_application=>co_client_environment-standalone.

         ...

    when if_wd_application=>co_client_environment-portal.

         ...

    when if_wd_application=>co_client_environment-sapgui.

         ...

    when if_wd_application=>co_client_environment-nwbc.           

         ...

    when if_wd_application=>co_client_environment-unknown.

         ...

endcase.

Cheers,

Amy

Answers (0)