cancel
Showing results for 
Search instead for 
Did you mean: 

button

Former Member
0 Kudos

hi, someone knows how include a button in a selection-screen?

thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Observe the code bellow.

PARAMETERS: A TYPE I,

B TYPE I,

C TYPE I.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN PUSHBUTTON /10(10) LB1 USER-COMMAND PB1.

SELECTION-SCREEN PUSHBUTTON 30(10) LB2 USER-COMMAND PB2.

INITIALIZATION.

LB1 = ‘ADD’.

LB2 = ‘EXIT’.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN ‘PB1’.

C = A + B.

WHEN ‘PB2’.

LEAVE PROGRAM.

ENDCASE.

Don't forget to reward,

Thanks & Regards,

Kalyan.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

To create a pushbutton on the selection screen, 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.

Ex.

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.

Regards,

Bhaskar

Former Member
0 Kudos

HI ,

look at this

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.

Kindly Reward Points If You Found The Reply Helpful,

Cheers,

Chaitanya.

Former Member
0 Kudos


tables : bsik,sscrfields.
data itable like bsik occurs 0.

selection-screen: pushbutton /1(6) text-010 user-command cli1.
selection-screen: pushbutton /1(6) text-020 user-command cli2.

at selection-screen.
case sscrfields-ucomm.
when 'cli1'.
select lifnr from bsik.

when 'cli2'.
select burks from bsik.

endcase.