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

regarding selection-screen.....

Former Member
0 Likes
798

Hi all,

Can anyone tell me, how buttons can we put in the selection screen and where the Function codes of those are stored.

Regards,

satish

8 REPLIES 8
Read only

Former Member
0 Likes
768

Hi,

use this syntax

SELECTION-SCREEN PUSHBUTTON [/][pos](len) button_text

USER-COMMAND fcode

[VISIBLE LENGTH vlen]

[MODIF ID modid]

[ldb_additions].

Read only

Former Member
0 Likes
768

hi,

Pushbuttons on the Selection Screen

To create a pushbutton on the selection screen (similar to pushbuttons on screens), you use:

SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>

USER-COMMAND <ucom> MODIF ID <key>.

The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.

<push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.

For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event.

REPORT DEMO.

TABLES SSCRFIELDS.

DATA FLAG.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE TIT,

BEGIN OF LINE,

PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1,

PUSHBUTTON 12(10) TEXT-020 USER-COMMAND CLI2,

END OF LINE,

BEGIN OF LINE,

PUSHBUTTON 2(10) BUT3 USER-COMMAND CLI3,

PUSHBUTTON 12(10) TEXT-040 USER-COMMAND CLI4,

END OF LINE,

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE SSCRFIELDS.

WHEN 'CLI1'.

FLAG = '1'.

WHEN 'CLI2'.

FLAG = '2'.

WHEN 'CLI3'.

FLAG = '3'.

WHEN 'CLI4'.

FLAG = '4'.

ENDCASE.

START-OF-SELECTION.

TIT = 'Four Buttons'.

BUT1 = 'Button 1'.

BUT3 = 'Button 3'.

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

CASE FLAG.

WHEN '1'.

WRITE / 'Button 1 was clicked'.

WHEN '2'.

WRITE / 'Button 2 was clicked'.

WHEN '3'.

WRITE / 'Button 3 was clicked'.

WHEN '4'.

WRITE / 'Button 4 was clicked'.

WHEN OTHERS.

WRITE / 'No Button was clicked'.

ENDCASE.

This example defines four pushbuttons on a selection screen that is displayed as a dialog box. The selection screen is defined in a statement chain for keyword SELECTION-SCREEN.

If the text symbols TEXT-020 and TEXT-040 are defined as 'Button 2' and 'Button 4', the four pushbuttons appear as follows on the selection screen displayed as a dialog box.

CLI1, CLI2, CLI3 and CLI4 are used for <ucom>. When the user clicks one of the pushbuttons, the AT SELECTION-SCREEN event is triggered, and the FLAG field is set. The FLAG field can be further processed during subsequent program flow after the user has chosen Execute.

Regards

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
768

Hi,

Check this program "demo_sel_screen_pushbutton".

Regards,

Sesh

Read only

Former Member
0 Likes
768

REPORT demo_sel_screen_pushbutton.

TABLES sscrfields.

DATA flag(1) TYPE c.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE tit,

BEGIN OF LINE,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,

END OF LINE,

BEGIN OF LINE,

PUSHBUTTON 2(10) but3 USER-COMMAND cli3,

PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,

END OF LINE,

END OF SCREEN 500.

AT SELECTION-SCREEN.

MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm.

CASE sscrfields-ucomm.

WHEN 'CLI1'.

flag = '1'.

WHEN 'CLI2'.

flag = '2'.

WHEN 'CLI3'.

flag = '3'.

WHEN 'CLI4'.

flag = '4'.

ENDCASE.

START-OF-SELECTION.

tit = 'Four Buttons'.

but1 = 'Button 1'.

but3 = 'Button 3'.

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

CASE flag.

WHEN '1'.

WRITE / 'Button 1 was clicked'.

WHEN '2'.

WRITE / 'Button 2 was clicked'.

WHEN '3'.

WRITE / 'Button 3 was clicked'.

WHEN '4'.

WRITE / 'Button 4 was clicked'.

WHEN OTHERS.

WRITE / 'No Button was clicked'.

ENDCASE.

madhavi

Read only

Former Member
0 Likes
768

hi,

try like this

TYPE-POOLS: icon.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(20) text_001.

PARAMETERS: p_werks TYPE marc-werks.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(20) text_002.

PARAMETERS: p_whouse(10).

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(20) text_003.

PARAMETERS: p_auart LIKE vbak-auart.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

WRITE icon_search AS ICON TO text_001.

CONCATENATE text_001 text-001 INTO text_001 SEPARATED BY space.

WRITE icon_warehouse AS ICON TO text_002.

CONCATENATE text_002 text-002 INTO text_002 SEPARATED BY space.

WRITE icon_order AS ICON TO text_003.

CONCATENATE text_003 text-003 INTO text_003 SEPARATED BY space.

reward if usefull...

Read only

Former Member
0 Likes
768

Frnds ,

Actually i want to know how many buttons we can create in a selection-screen.

And i wanted to know where the function-code respect to those buttons will be stored.

So plzzz let me know regarding this.

regards

satish

Read only

Former Member
0 Likes
768

Hi,

Try to create a screen from SE51 and Call it inspite of ur selection screen.

awrd points if useful

Bhupal

Read only

Former Member
0 Likes
768

hi,

... USER-COMMAND fcode

Effect

If you specify the USER-COMMAND addition, the pushbutton must be assigned a function code fcode. The function code fcode must be specified directly and can only contain a maximum of 20 characters.

Before you can work with the pushbutton, you must specify a TABLES statement to declare an interface work area for the structure SSCRFIELDS from the ABAP Dictionary.

If the user selects the pushbutton on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and the function code fcode is transferred to the ucomm component in the interface work area sscrfields.

Note

If the function code of a pushbutton corresponds to a function code used in the GUI status of the selection screen, the selection screen processing is influenced accordingly.