Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read what field the user has right clicked in Module pool

Former Member
0 Kudos

Halo Experts,

I have a main screen say 0001 in Module pool .

I am calling subscreens based on some criteria

subscreen 2090 for criteria 1

2091 for criteria 2

I have fields in Subscreen which are from dictionary strucutres . These fiedls have parameter ids from data elements. These fields have context menus in the attribute also. for example for FIELD1 the context menu is CTX_MENU_ALL in 2090.But for 2091 the FIELD2 might be there which refers to the same parameter id and uses the same context menu CTX_MENU_ALL.

I have written the code inside the form to load the GUI Status.


Form on_ctmenu_CTX_MENU_ALL USING l_menu TYPE REF TO cl_ctmenu.

l_menu ->load_gui_status( ).

endform.

The above thing is working fine. Bue depending on the value of field1 or field 2 I need to disable the functions in CTX_MENU_ALL .But is there a way that I can get which screen field and its value the user has clicked inside this form and what is the value in it.I tried GET CURSOR statement . But it is not having any values.

GET CURSOR field l_field value l_value.

GET parameter id is also not working.

Is there any way I can get the fieldname,dynnr,fieldvalue the user has right clicked so that I can use l_menu->hide_functions to hide the menu options?

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

The <a class="jive-link-external" href="http://help.sap.com/abapdocu_70/en/ABAPGET_CURSOR_DYNPRO.htm" target="_newWindow">GET CURSOR only works in PAI</a>, the form ON_CTMENU_XXX is executed before the PAI, and if and <a class="jive-link-external" href="http://help.sap.com/saphelp_nw04/helpdata/en/94/c4a6377cc0c92ce10000009b38f8cf/frameset.htm" target="_newWindow">only if the user selects an option is a function code raised and the PAI triggered</a>.<br />

<br />

The usual F4 functions used to get dynpro values before PAI are triggered in POV and are should also not be availale.<br />

<br />

I'm pretty pessimistic when your chances of success,<br />

<br />

hoping I am wrong, <br />

<br />

Regards,<br />

Raymond

0 Kudos

Raymond,

It is strange that this requirement did not come up earlier .

and there is no way to handle that except declaring form on_ctmenu_xxx for each and every field and getting the value of the screen field inside that.

But do you have any idea why GET Parameter for the same is not working.?

Regards

Arshad

0 Kudos

The implicit SET PARAMETER is also executed in PAI, so not yet available. ([Parameters in the SAP Memory|http://help.sap.com/abapdocu_70/en/ABENMEMORY.htm])

Regards,

Raymond