on 2011 Dec 29 4:20 AM
I have 2 components as below.
component A : in component A have used component B and also embed view of component B in view containner in component A
component B : have only layout for display data
I'd like to know if i want to get the name of component A at the runtime in method of component B, How i can get it ?
Hi,
Pass the calling component name to the called component at the time of calling. Use the sample code below.
DATA:w_url TYPE string,
w_value TYPE string.
*-- Get the URL of the called application
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = "called_application_name"
IMPORTING
out_absolute_url = w_url.
**-- make the Value type compatible that has to be passed with the URL
w_value = "Calling_component_name"
Attach the parameters and its value with the URL that
have to be passed to the 2nd application
CALL METHOD cl_http_server=>append_field_url
EXPORTING
name = 'VARIABLE_NAME'
value = w_value
CHANGING
url = w_url.nerate a popup window for the 2nd application with the above URL
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_external_window(
url = w_url ).
lo_window->open( ).
And in the called application window handledefault you can retrieve the calling component name.
In the window handedefault of called component make the VARIABLE_NAME as importing paramater, so that you will the varibale_name value in the handledefault code.
Revert for any queries.
Regards,
Simi A M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
The method name that you use to find out the component name at runtime is called:
CL_WDY_WB_NAMING_SERVICE=>GET_COMPONENT_BY_CLASSNAME
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.