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

Pushbuttons

Former Member
0 Likes
569

Hi,

How to create pushbuttons on application tool bar and on selection screen?

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
548

Hi,

TABLES sscrfields.

TYPE-POOLS icon.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE title,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2

VISIBLE LENGTH 10,

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE sscrfields.

WHEN 'CLI1'.

...

WHEN 'CLI2'.

...

ENDCASE.

START-OF-SELECTION.

title = 'Push button'.

but1 = 'Button 1'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_information

text = 'Button 2'

info = 'My Quickinfo'

IMPORTING

RESULT = but2

EXCEPTIONS

OTHERS = 0.

CALL SELECTION-SCREEN '0500' STARTING AT 10 10.

Regards,

Prashant

4 REPLIES 4
Read only

former_member188829
Active Contributor
Read only

former_member386202
Active Contributor
0 Likes
549

Hi,

TABLES sscrfields.

TYPE-POOLS icon.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE title,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2

VISIBLE LENGTH 10,

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE sscrfields.

WHEN 'CLI1'.

...

WHEN 'CLI2'.

...

ENDCASE.

START-OF-SELECTION.

title = 'Push button'.

but1 = 'Button 1'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_information

text = 'Button 2'

info = 'My Quickinfo'

IMPORTING

RESULT = but2

EXCEPTIONS

OTHERS = 0.

CALL SELECTION-SCREEN '0500' STARTING AT 10 10.

Regards,

Prashant

Read only

Former Member
0 Likes
548

add a single line set pf-status '100'.

100 is the title of the pf status

when you create pf-status by double cdlicking on it

a new window will open

in the application toolbar menu

add the name of the pushbutton you want

press enter

select static text

add function text the name you want to be displayed

add an icon by selecting F4

add an info text any of your choice which will be shown on cusrsor placed on the push button

activate the pf-status and your work is done

add the aboce set pf-status statement in the pbo module of the screen, if in a particular screen

reward if useful

Read only

0 Likes
548

in selection screen you can easily ad a pushbutton in the layout editor of that screen

do remember to add a function code to that button