cancel
Showing results for 
Search instead for 
Did you mean: 

Get Parent View Component name "Webdynpro"

mojamal
Explorer
0 Kudos

Hi Gurus,

My current component is called from multiple component and I have to do validation based on the calling component.But how to read the calling component(Not application)

Below is my finding

lo_cmp_apix TYPE REF TO if_wd_component,

lo_window_managerx TYPE REF TO if_wd_window_manager,

lo_cmp_apix = wd_comp_controller->wd_get_api( ).

lo_window_managerx = lo_cmp_apix->get_window_manager( ).

In the object Lo_window_manger there is a parent details but how to read it???

Kindly help me to rectify this issue.

Thanks in advance.

Jamal

Former Member
0 Kudos

CL_WD_ALV_TOOL

->

GET_PARENT_COMPONENT

Accepted Solutions (1)

Accepted Solutions (1)

pokrakam
Active Contributor

There is not really a concept as "called from" in the same way as with ABAP, there is no call hierarchy.

A safer alternative would be to pass in a 'mode' parameter or send any needed data across. This means you're not creating as many dependencies.

mojamal
Explorer
0 Kudos

Hi Mike,

Thanks for your response.Basically it is Used component. if you check inside lo_window_managerx->parent you will get component_name.

But not able to read this 😞

pokrakam
Active Contributor
0 Kudos

OK, it's important to make this clear. "Call" can be a plug-navigation, FPM GAF, Usage, iView, or other setup.

Navigating via visual elements (View -> Window -> ?) is not the WDA way, for components usages you should use interfaces. These are in part created automatically for you, you just need to expose any additional elements (methods etc.) that other controllers can use.

From the info you have given, a few option are available:

- Create a standalone component that is common to both using and used components
- Pass a reference to the using controller in during instantiation of the used controller
- Create a reverse component usage and expose the using controller's methods

The third option is the most robust, ideally via a standalone interface controller to ensure that all using controllers implement the same interface.

Answers (0)