This Space has blogs on various topics in the field of SAP. These blogs point out solutions to various technical and functional issues that consultants face during implementation or support of SAP Projects. Readers/followers are welcome to contribute to this space by emailing your content at bohra.mohammadi@gmail.com. You will be rewarded according to the topic/number of words/complexity of the topic/issue which are you addressing in your blog.
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
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 programCREATE 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.
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 !!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
You are welcome to express your views here...