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: 

menu in ABAP

Former Member
0 Kudos

how to create menu in ABAP?

4 REPLIES 4

Former Member
0 Kudos

Hi,

u can create the menu in menu painter.the tcode is SE41.

refer to this link for more info

http://help.sap.com/saphelp_nw70/helpdata/en/d1/801ce8454211d189710000e8322d00/frameset.htm

rgds,

bharat.

Sm1tje
Active Contributor
0 Kudos

Use transaction SE43.

Former Member
0 Kudos

hi

use ta se41

or when you user se80

generate a GUI status and add it in PBO

by using

SET PF-STATUS 'YOURSTATUS'.

bye

Former Member
0 Kudos

Hi,

Menu painter is the ABAP/4 workbench tool for creating and maintaining user interface.

Starting Menu Painter

ABAP/4 development workbench  menu painter

Or

Transaction SE41 in the command field.

Or

Through program SET PF-STATUS <var>

If you double click on the variable, the system takes you to the menu painter screen.

Creating Menu bar

Steps involved are as follows:

• Enter the name in the first field. It is just a name given to the menu and is not displayed anywhere in the output.

• Enter the name of each menu item. You can create up to six menus (total eight menu items are available, out of which system and help are mandatory).

• Enter name of the menu items and function code. You can have fifteen menu items under one menu.

If you leave function blank, the system assumes that this particular menu item will have submenu. You can create the sub menu items under this menu item. User can go up to three levels.

In Application tool bar you can include icon assigned for function keys.

Procedure:

• Select function key.

• From the menu, more utilities - &#61614; change text type. The system displays a dialog box, click on icon and presses ENTER.

• Select icon from list of icons displayed

Creating GUI title

From your program, you can set title for your list and SET TITLEBAR is used.

Syntax:

SET TITLEBAR <var>.

Here var can be any three-character name. When developer double clicks on the var, system displays the dialog box in which you enter the title number, the description, and the actual text for title.

Similar to dictionary objects, the GUI status must be generated to be accessible by program.

AT USER-COMMAND

When the user selects the menu item or presses any function key, the event that is triggered is AT USER-COMMAND, and can be handled in the program by writing code for the same. The system variable SY-UCOMM stores the function code for the clicked menu item or for the function key and the same can be checked in the program. Sample code would look like

AT USER-COMMAND.

Case sy-ucomm.

When ‘DISP’.

Select * from sflight.

Write sflight-carrid, sflight-connid.

Endselect.

When ‘EXIT’.

LEAVE.

If GUI status, suppose you have set menu bar for two items and the function code is ‘DISP’ and ‘EXIT’ respectively. If the user clicks the menu item ‘DISPLAY’, then function code ‘DISP’ is stored in the sy-ucomm and whatever is written under the when ‘DISP’, gets executed. This is applicable for EXIT as well.

Sy-lsind for the screen increases when the user clicks the menu item.

Usually you have combination of all the three navigations in your user interface, i.e., you have to create menu bar, assign function code for the function keys and write code to handle all this in addition to handling double clicking.

Things to remember while using all the combinations:

• Sy-lsind increases even if you select menu-item.

• When the user double clicks on particular line, value of sy-ucomm is ‘PICK.

• If you set sy-lsind = 2 for your 4th secondary list, when control is transferred to the 2nd secondary list, all the other lists after 2nd are lost or memory allocated to them is lost.

• Sy-lisel also gives you the value of clicked line but in this case you cannot differentiate between field. To retrieve the exact field, you have to know the field length of each field.

• If you use statement SY-LSIND = 1.

The system reacts to a manipulation of SY-LSIND only at the end of an event, directly before displaying the secondary list. So, if within the processing block, you use statements whose INDEX options access the list with the index SY-LSIND, make sure that you manipulate the SY-LSIND field only after processing these statements. The best way is to have it always at the `as the last statement’ of the processing block.

Regards,

Bhaskar