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

push button

Former Member
0 Likes
475

how to create push button in selection screen?

3 REPLIES 3
Read only

Former Member
0 Likes
450

Hi,

Check this example..

TABLES SSCRFIELDS.

SELECTION-SCREEN PUSHBUTTON /10(20) PUSH1 USER-COMMAND ABCD.

INITIALIZATION.

MOVE 'My Button' TO PUSH1.

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'ABCD'.

            • Add your code here when the button is pressed.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
450

Here it is.

REPORT zgt_maintain_config_tables.

INCLUDE <list>.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) garment

USER-COMMAND garment.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) locker

USER-COMMAND locker.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) route

USER-COMMAND route.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) stop

USER-COMMAND stop.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) dupgar

USER-COMMAND dupgar.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 01(35) message

USER-COMMAND message.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s01

CHANGING garment.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s02

CHANGING locker.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s03

CHANGING route.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s04

CHANGING stop.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s05

CHANGING dupgar.

PERFORM f_setup_pushbutton_text USING icon_execute_object text-s06

CHANGING message.

START-OF-SELECTION.

END-OF-SELECTION.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'GARMENT'.

CALL TRANSACTION 'ZJAMGT_GARMENT_SEND'.

WHEN 'LOCKER'.

CALL TRANSACTION 'ZJAMGT_LOCKER_SEND'.

WHEN 'ROUTE'.

CALL TRANSACTION 'ZJAMGT_ROUTE_SEND'.

WHEN 'STOP'.

CALL TRANSACTION 'ZJAMGT_STOP_SEND'.

WHEN 'DUPGAR'.

CALL TRANSACTION 'ZJAMGT_DUP_GAR_SEND'.

WHEN 'MESSAGE'.

CALL TRANSACTION 'ZJAMGT_MESSAGE_SEND'.

ENDCASE.

&----


*& Form F_SETUP_PUSHBUTTON_TEXT

&----


  • This form will set up text for the pushbutton

----


FORM f_setup_pushbutton_text USING p_icon

p_text

CHANGING p_result.

DATA: l_result(50).

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = p_icon

text = p_text

add_stdinf = space

IMPORTING

RESULT = l_result

EXCEPTIONS

EXCEPTIONS

icon_not_found = 1

outputfield_too_short = 2

OTHERS = 3.

IF sy-subrc EQ 0. ENDIF.

p_result = l_result.

ENDFORM. " F_SETUP_PUSHBUTTON_TEXT

Read only

Former Member
0 Likes
450

You can go to the screen 1000 for that particular program and add it.