‎2014 Nov 25 9:14 AM
Hi all,
I have a little query in a small area in module pool. I was just going through an article in a website regarding double click functionality in a module pool. Now I tried it my way but it is not working and I would like to know the reason why. Below are the steps taken for the task:
1) I created a module pool program and drew the layout as shown. I also filled out the Context menu form attribute for both TEXT1 and TEXT2:
2) Inside MODULE USER_COMMAND_9000, I wrote the following code:
3) Then below this module I wrote the code inside the subroutines FORM ON_CTMENU_TEXT1 and FORM ON_CTMENU_TEXT2 .
Now, on executing, after I click the right mouse button:
I am getting the following run time error:
However, if I write both the subroutines FORM ON_CTMENU_TEXT1 and FORM ON_CTMENU_TEXT2 as per the article with the USING clause:
I am getting the output perfectly.
I want to know why the output is not coming without the USING clause.
Regards.
Manish.
‎2014 Nov 25 11:40 AM
Hi Manish,
The two 'L_MENU', the first one is you created, the second one is imported by system procedure, that`s why need 'Using' .
Each routine must have a single USING parameter, typed as a reference variable to class
CL_CTMENU. For each context menu assigned to an element on a screen, the runtime
environment automatically creates an object of the class. When the user requests the context
menu by clicking the right-hand mouse button, the system calls the corresponding subroutine and
passes a reference to the corresponding object to the formal parameter.
When the object is passed it is initial - the context menu contains no entries. In the subroutine,
you can work with the methods of the object (as listed above) to construct the context menu
dynamically.
regards,
Archer
‎2014 Nov 25 12:08 PM
Hi Archer,
So my question is what if I dont want to use the USING clause in my subroutine. I just want to put my code inside formal parameters. How do I go about it?
Regards.
Manish
‎2014 Dec 04 8:50 AM
Hi all,
Can anyone please help me with this thread?
Regards.
Manish