cancel
Showing results for 
Search instead for 
Did you mean: 

get the node_name from different components

Former Member
0 Kudos

Hi All,

I have written a logic into a component that has to work only for certain other components.

So I need to somehow get the node_name of the components before my logic gets triggered.

Any idea on how can I do that?

Any help is much appreciated.

Best regards,

Elena

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Elena,

Could you elaborate your requirement a little more ?

Regards,

Rama

Former Member
0 Kudos

Hi Ramakrishnappa,

So I have one component which is used for the F4 functionality.

In this one I have writen a logic that I want only to be pursued for certain other components. Not all of the components that are using it.

So I found out that the node_name is the one that I can use to identify a component.

I want now to write a condition which will check the node_name before my logic gets called.

Hope this clarifies more my inquiry.

Best regards,

Elena

ramakrishnappa
Active Contributor
0 Kudos

Hi Elena,

Thanks for details.But still I could not get the exact picture of the same.

here goes, my understanding on your issue:

Let us say, you have a component ZWD_F4 which is used as search help and it is used in other components like ZWD_1, ZWD_2, ZWD_3, ZWD_4.

Now, you need to give the access to only the components which are authorized to use the help component ZWD_F4.

You are trying to identify the component by node name in its context. i.e. you need to identify the node name of components ZWD_1, ZWD_2, ZWD_3, .... so on by using a node name.

am I in right direction of your requirement?

Regards,

Rama

Former Member
0 Kudos

Yes, this is the idea.

ZWD_F4 is already used by ZWD_1, ZWD_2, ZWD_3, ZWD_4 .

No inside the view : F4_view of the ZWD_F4 component at the select action there is a method in which I have written a logic.

Now this logic should work only for ZWD_1 and ZWD_2. The other two should pass this logic.

logic I have added:

IF a_area IS NOT INITIAL.
       ZCL_ZWD__ASSIST_1 =>LV_F4_SELECT = ABAP_TRUE.
      a_area-a_field = 'X'.
ENDIF.

Before this I should write the syntax were the node_name of the components should be checked.

Best regards,

Elena

ramakrishnappa
Active Contributor
0 Kudos

Hi Elena,

I don't think its good idea of skipping the logic based on node name of component.

For your question:

You can get the name of context node of called component.

Hope you have global attribute GO_VALUE_HELP_LISTENER of type ref to  IF_WD_VALUE_HELP_LISTENER in ZWD_F4 component controller.

then write the below logic in your view


data lv_node_name type string.

lv_node_name = wd_comp_controller->GO_VALUE_HELP_LISTENER->F4_ATTRIBUTE_INFO-NODE_INFO->get_name( ).

The above code, gives you the node name from the F4 attributes of component.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Thank you Ramakrishnappa,

I appreciate all your help.

I actually didn't implemented the change. I made also a relationship between the second component and the F4 one.

Best regards,

Elena

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

you can pass a global variable which will differentiate which logic needs to be read while search help.

Example: mention a global variable in Assitance class or interfface node level , and pass flag value as  X for logic 1 and null for logic 2.

this value should be passed from your main component which is calling the search help component.

Hope this helps.

Regards,

Kanthikumar Palle

Former Member
0 Kudos

Hi Kranthi,

Thank you. Is a good idea, but still I have to get the node_name. This is how I differentiate the action of my code.

Best regards,

Elena

Former Member
0 Kudos

Hi.

To use the written logic in component 1 in other components you need to use component usage , while you ding this you can use interface nodes/assistance class /shared memory to send the information of Node name from other components to component 1 where your actual logic resides.

Thanks,

Former Member
0 Kudos

Hi Kranthi,

Thank you for your reply. I am new in webdynpro area so it would be very helpful if you could provide  me also the syntax for this.

Best regards,

Elena