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

Getting a button in selection screen

Former Member
0 Likes
881

How to get apush buttons in the selection screen level that before displaying a report

7 REPLIES 7
Read only

Former Member
0 Likes
839

Hi,

You can use:

<b>selection-screen PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1.</b>

INITIALIZATION.

MOVE 'PUSH' to BUT1.

Reward if helpful.

Regards,

Sandhya

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
839

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.

Cheers,

Simha.

Reward all the helpful answers..

Read only

Former Member
0 Likes
839

Hi,

Check this link to learn how to add a pushbutton on the selection screen, there is an example as well...

http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm

Read only

Former Member
0 Likes
839

HI,

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

kishore.

Read only

Former Member
0 Likes
839

Hi...

Where do u want to have the push button??

Is it on the Selection Screen or Application toolbar ??

Read only

Former Member
0 Likes
839

Hi....

Go through this program....it will help you....

You can place a maximum of 5 user defined Push Buttons on the Application Toolbar......

Report Ztest.

TABLES SSCRFIELDS.

PARAMETERS: p_carrid TYPE s_carr_id,

p_cityfr TYPE s_from_cit.

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2.

INITIALIZATION.

sscrfields-functxt_01 = 'LH'.

sscrfields-functxt_02 = 'UA'.

AT SELECTION-SCREEN.

CASE sscrfields-ucomm.

WHEN'FC01'.

p_carrid = 'LH'.

p_cityfr = 'Frankfurt'.

WHEN 'FC02'.

p_carrid = 'UA'.

p_cityfr = 'Chicago'.

ENDCASE.

START-OF-SELECTION.

WRITE / 'START-OF-SELECTION'.

Reward if it helps u.....

Kimi

Read only

Former Member
0 Likes
839

hi

good

use the menu painter to to get a push button in the selection screen.

Thanks

mrutyun^