cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Component details in Webdynpro Component Usage Pop-up

Former Member
0 Kudos

Hi Experts,

We have a WD component, say ZWD1, which has been re-used(component usage) in many other WD components.

In all the usages the main window of ZWD1 is being called as a pop-up.

Now we have a requirement wherein i need to write certain logic in ZWD1 view method which should be executed only when

ZWD1 is called as a pop-up from 2 particular components out of all the components in which it has been reused.

Is there any way in which we can get the details of the Parent window (or) component from which ZWD1 has been called, in the methods of ZWD1? (Apart from calling an interface method of ZWD1 or setting the value of an interface node of ZWD1, from the parent component)

Thanks in advance.

Best Regards,

Sampath A.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Would it help if you could get the application name?

data lr_api type ref to if_wd_component.
  data lr_comp type ref to if_wd_component.
  data lr_appl type ref to if_Wd_application.
  data lr_appli type ref to if_wd_rr_application.
  lr_api =  wd_this->wd_get_api( ).
  lr_comp = lr_api->get_component( ).
  lr_appl = lr_comp->get_application( ).
  lr_appli = lr_appl->get_application_info( ).
  lr_appli->name.

Former Member
0 Kudos

Spot on Thomas !!! Thanks for the input..............

Best Regards,

Sampath A.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

U can use the assistant class for that. Just set the assistance class attribute from the parent component and then read its values

from the called component. based on the value of the attribute u can run the method.

For understanding assistant classes u can refer the standard component DEMO_COMMON_ASSISTANCE1.

Regards,

Pankaj Aggarwal.

Former Member
0 Kudos

Hi,

for your requirement you could use Assistance Classes in your Parent component and Used Component.

Use the Same Assistance class in all the components and set an Attribute in Assistance class while in Parent component.

Now in your Used Component , you can access that Attribute of Assistance class and check which Parent component it is calling.

To call the attribute/method use the instance wd_assist.

For more info on Assistance class and its usage Refer the SAP Online Help :

http://help.sap.com/saphelp_nw70/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm

I hope it helps.

Former Member
0 Kudos

Hi,

Thanks for your reply.

The problem here is that all the components i have mentioned in my question are standard ones

and i have to write the logic as a part of the Enhancement implementaion of the standard WD component.

Thanks & Best Regards,

Sampath A.

Edited by: Avasarala Sampath on Sep 30, 2009 2:29 PM

Former Member
0 Kudos

Hi,

As i think then u can use the export and import statement.

In the post exit of the Main component u can export the variable.

data lv_bukrs type string.
lv_bukrs = 'A'.
EXPORT l_bukrs FROM lv_bukrs TO MEMORY ID 'Z3AF_BUKRS'.

now in the pop up component u can import the value and can check who have called the component.

please remember to wash the memory after import.

Regards,

Pankaj Aggarwal