Thursday, July 19

Context menu in a dialog program page4...

go to page3 of this post...
Double click on each and paste below code respectively.
FORM on_ctmenu_TEXT1 USING l_menu TYPE REF TO cl_ctmenu.   
  
CREATE OBJECT right_clk.
  
CALL METHOD: right_clk->add_function
                      
EXPORTING fcode = 'REPLACE'
                                
text  = 'REPLACE',
               right_clk
->add_function
                       
EXPORTING fcode = 'CLEAR'
                                 
text  = 'CLEAR',
               right_clk
->add_function
                       
EXPORTING fcode = 'ZOOM'
                                 
text  = 'ZOOM',
              right_clk
->add_function
                       
EXPORTING fcode = 'CALM DOWN'
                                 
text  = 'CALM DOWN',
               l_menu
->add_submenu
                       
EXPORTING menu = right_clk
                                 
text = 'OPTIONS'.
  
ENDFORM."RIGHT CLICK on text 2 input/ouput field
FORM on_ctmenu_TEXT2 USING l_menu TYPE REF TO cl_ctmenu.   
  
CREATE OBJECT right_clk.
  
CALL METHOD: right_clk->add_function
                      
EXPORTING fcode = 'REPLACE'
                                
text  = 'REPLACE',
               right_clk
->add_function
                       
EXPORTING fcode = 'CLEAR'
                                 
text  = 'CLEAR',
               right_clk
->add_function
                       
EXPORTING fcode = 'ZOOM'
                                 
text  = 'ZOOM',
              right_clk
->add_function
                       
EXPORTING fcode = 'CALM DOWN'
                                 
text  = 'CALM DOWN',
               l_menu
->add_submenu
                       
EXPORTING menu = right_clk
                                 
text = 'OPTIONS'.
ENDFORM.
Save and activate the entire program


Create a transaction, execute it to see below output.
Place the cursor on an input field, Click on Shift+F10 to see the context menu.
Choose options from the context menu to see and play with the output for yourself. Enjoy !!!

No comments:

Post a Comment

You are welcome to express your views here...