on 03-22-2012 12:19 PM
Hi All,
I want to read the Currently open windows URL ?? should i look into WDR_TASK class as we are using this for reading the URL parameter.
Thanks In Advance.
P$G
Hi,
To find URL first get the application name and then pass this to method CONSTRUCT_WD_URL
of class CL_WD_UTILITIES to get the URL.
To get Applicatioon name follow this:
In IF_WD_COMPONENT~GET_APPLICATION returns the application object of type IF_WD_APPLICATION. Use IF_WD_APPLICATION~GET_APPLICATION_INFO that returns object of type IF_WD_RR_APPLICATION and user IF_WD_RR_APPLICATION~GET_NAME method to get the application name.
To get URL from application name:
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = 'APPLICATION NAME'
in_protocol = 'HTTPS'
IMPORTING
out_absolute_url = url_string. "url_string has your URL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harshith,
thanks for your reply. but the method you have specified will give me only static URL for specified Application.
In my case-- I am opening external window B from A (Parent window). and the window B's URL is dynamically changes according to Parameters.
and i want read the URL of window B in that window itself.
is there any other method for this or any other way to achieve this ??
Thanks In Advance
P$G
Hi Harshit,
I have written below code. how can i create the instance of these ? it gives me dump as Null Reference . can you please edit and make it correct ???
DATA : LO_COM TYPE REF TO IF_WD_COMPONENT,
LO_APP TYPE REF TO IF_WD_APPLICATION,
LO_APP_INFO TYPE REF TO IF_WD_RR_APPLICATION,
LV_NAME TYPE STRING,
LV_URL TYPE STRING.
CALL METHOD LO_COM->GET_APPLICATION
RECEIVING
RESULT = LO_APP.
CALL METHOD LO_APP->GET_APPLICATION_INFO
RECEIVING
RESULT = LO_APP_INFO.
CALL METHOD LO_APP_INFO->GET_NAME
RECEIVING
RESULT = LV_NAME.
CALL METHOD CL_WD_UTILITIES=>CONSTRUCT_WD_URL
EXPORTING
APPLICATION_NAME = LV_NAME
IN_PROTOCOL = 'HTTPS'
IMPORTING
OUT_ABSOLUTE_URL = LV_URL.
Hi Pratham,
Below is the modified code, please check.
DATA : LO_COM TYPE REF TO IF_WD_COMPONENT,
LO_APP TYPE REF TO IF_WD_APPLICATION,
LO_APP_INFO TYPE REF TO IF_WD_RR_APPLICATION,
LV_NAME TYPE STRING,
LV_URL TYPE STRING.
***************
LO_COM = WD_COMP_CONTROLLER->WD_GET_API( ).
******************
CALL METHOD LO_COM->GET_APPLICATION
RECEIVING
RESULT = LO_APP.
CALL METHOD LO_APP->GET_APPLICATION_INFO
RECEIVING
RESULT = LO_APP_INFO.
CALL METHOD LO_APP_INFO->GET_NAME
RECEIVING
RESULT = LV_NAME.
CALL METHOD CL_WD_UTILITIES=>CONSTRUCT_WD_URL
EXPORTING
APPLICATION_NAME = LV_NAME
IN_PROTOCOL = 'HTTPS'
IMPORTING
OUT_ABSOLUTE_URL = LV_URL.
Hi Chengalarayulu,
The code provided by the Harshit is also working fine. but its not meet my requirement..
Explanation:- i think we don't need to write all this code because this gives the same application we create in SE80. so we can directly pass the same to the CONSTRUCT_WD_URL method.
Now, I have 2 components lets say A & B, from component A i am calling component B as external window (URL). using method CONSTRUCT_WD_URL i am constructing the URL and same time I am adding few parameter to the original URL.
e.g Original URL--- /sap/bc/webdynpro/z_appln
After Adding Parameter--- /sap/bc/webdynpro/z_appln?EKORG=AB01&BUKRS=1000
Now in Component B, i want to read the URL which is generated after adding the parameters i.e. Currently open window's B URL.
Thanks In Advance
P$G.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.