cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically Trigger onEnter event after selecting value from the FREE_HELP

Former Member
0 Kudos

Hi Everyone,

I am trying to trigger the onEnter event from a field after the user selected something on the F4 functionality.
This F4 functionality has been implemented using FREE_HELP.

The Sales Org. ID field has also an onEnter action wich has it's own existing logic. This is the logic I want to trigger also after user selects a sales id from the F4 screen.

This FREE_HELP functionality relates somehow with a new component.

I tried adding this syntax to the  WDDOINIT method, but I had no results.

wd_this->wd_get_api( )->register_on_enter_for_f4( register_on_enter = abap_true ).


Your help is much appreciated.

Best regards,
Elena

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Elena,

Please check the below document

Note: this helps you if your system is NW 7.4

Otherwise,

in modifyview method you can trigger the event onEnter and pass the event parameters

You need to collect the required event parameters like CONTEXT_ELEMENT, etc

Please refer the below link

Hope this helps you.

Regards,

Rama

Message was edited by: Ramakrishnappa Gangappa

Former Member
0 Kudos

Hi Ramakrishnappa,

Thank you for the reply.
My system is NW 7.4 and I already looked into the first document you provided.
I think it doesn't work for me cause that FREE_HELP thing refers to a different component.

In the example from the doc the only thing to do would be adding bellow syntax to the  WDDOINIT method.

wd_this->wd_get_api( )->register_on_enter_for_f4( register_on_enter = abap_true ).


I tried adding it to the WDDOINIT method of the first component and also the one triggered for the F4 help. Still no result.


I also found this link:


Looks useful but requires a new event, event handler and also a event listener. I also wanna be sure I'm using the proper coding procedure.


Any further advice is appreciated.


Best regards,

Elena

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you all for the answers.


I ended up not using this onEnter event after the F4 action as it might effect other functionality of the component.

But both answers helped me get to that conclusion.

What I did was creating a new static attribute LV_F4_SELECT  in the main component.

I set this attribute also in the F4 component (whenever a sales org is selected).

IF l_sales_area-sales_org IS NOT INITIAL.

      ZCL_COMP_NAME=>LV_F4_SELECT = ABAP_TRUE.

ENDIF.

Then in the WDDOMODIFYVIEW method I checked whether the attribute holds the set value and then I triggered my logic.

  IF ZCL_TDM_ASSIST_BP_CREATE=>LV_F4_SELECT = ABAP_TRUE.
     ZCL_TDM_ASSIST_BP_CREATE=>LV_F4_SELECT = ABAP_FALSE.
     wd_comp_controller->MY_LOGIC_METHOD(
       IM_VIEW_API wd_this->wd_get_api( )
     ).
   ENDIF.

Best regards,

Elena

Former Member
0 Kudos

Hi Elena,

Can't you use the event ON_VH_CLOSED of the interface controller like in sample Web Dynpro DEMO_VALUE_HELP?

Kind regards,

Julien

Former Member
0 Kudos

Hi Julien,

My component doesn't have this event ON_VH_CLOSED.
On what I have checked the only method  wich is getting called is WDDOMODIFYVIEW.

Best regards,
Elena

Former Member
0 Kudos

Hello,

Can you have a look at the ZNEWCOMPONENT Web Dynpro? There, you could define an event DATA_SELECTED and mark it as "interface event".

Then, it will be available in your main component.

Have a look at the sample Web Dynpro I mentioned for more info.

Kind regards,

Julien

Former Member
0 Kudos

Hi,

So the methods from the previous screenshot are from the ZNEWCOMPONENT.

I think the data is been selected here at the ONACTIONAPPLY .
Still if only the WDDOMODIFYVIEW is being triggered then I think there should be the place were I must right some syntax to relate it with the onEnter action.

Not sure though how the syntax should look like.

Best regards,

Elena