Application Development and Automation 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: 
Read only

Right click functionality in module pool

manish_malakar0316
Active Participant
0 Likes
1,239

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.

3 REPLIES 3
Read only

Former Member
0 Likes
1,191

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

Read only

0 Likes
1,191

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

Read only

manish_malakar0316
Active Participant
0 Likes
1,191

Hi all,

Can anyone please help me with this thread?

Regards.

Manish