2006 May 25 2:00 PM
please tell me anybody that how to keep buttons on selection screen and how to get the other screen when we clicked on it.(just like sap userlogin page).
2006 May 25 2:04 PM
Hi chandu,
1. we can do like this.
2. just copy paste in new program.
3.
report abc.
*----
selection-screen : PUSHBUTTON 2(10) but1 USER-COMMAND cli1.
selection-screen : PUSHBUTTON 30(10) but2 USER-COMMAND cli2.
*----
at selection-screen.
if sy-ucomm = 'CLI1'.
call transaction 'SE37'.
endif.
if sy-ucomm = 'CLI2'.
call transaction 'SE11'.
endif.
regards,
amit m.
please tell me anybody that how to keep buttons on selection screen and how to get the other screen when we clicked on it.(just like sap userlogin page).
2006 May 25 2:02 PM
Hi,
in case of transactions wherein you'll have your own selection screen, you need to go the screen layout for keeping the push buttons, then double-click on those buttons and give them a function code. once you are finished with the layout just activate and go to the flow logic. There, you would have to go to the <b>PAI event</b> and code for the buttons in <b>user-command module</b> using statement :
case sy-ucomm(/ok-code).
when'<func code>.
*do the desired actions
endcase.
You can also add push buttons in the <b>application toolbar</b> of your selection-screen.
tables sscrfields. "Fields on selection screens
selection-screen function key 1. "button on the application toolbar
initialization.
* Populating button text
move 'my_button' to sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_my_buttonRegards,
Aswin
2006 May 25 2:03 PM
selection-screen pushbutton 40(20) gocfg user-command gocfg.
AT SELECTION-SCREEN.
if sy-ucomm = 'GOCFG'.
SET PARAMETER ID 'AUN' FIELD P_VBELN-LOW.
call transaction 'VA03'.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
write icon_configuration as icon to gocfg.
concatenate gocfg 'Go to VA03' into gocfg
separated by space.
2006 May 25 2:04 PM
Hi chandu,
1. we can do like this.
2. just copy paste in new program.
3.
report abc.
*----
selection-screen : PUSHBUTTON 2(10) but1 USER-COMMAND cli1.
selection-screen : PUSHBUTTON 30(10) but2 USER-COMMAND cli2.
*----
at selection-screen.
if sy-ucomm = 'CLI1'.
call transaction 'SE37'.
endif.
if sy-ucomm = 'CLI2'.
call transaction 'SE11'.
endif.
regards,
amit m.
2006 May 25 2:07 PM
Hi Chandu,
check the below link
http://www.sapdevelopment.co.uk/reporting/selscr/selscrhome.htm
Regards,
Naveen
2006 May 25 2:08 PM
Hi,
check these demo programs...
demo_sel_screen_pushbutton
demo_sel_screen_function_keyRegards
Vijay
2006 May 25 2:09 PM
Check this example for creating the pushbutton on the selection-screen and calling a different screen..
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'.
call screen <scr>.
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'.
2006 May 25 2:11 PM
hi
chk this out
TABLES SPFLI.
SELECT-OPTIONS SEL0 FOR SY-TABIX.
PARAMETERS PAR0(5).
SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE TEXT-456.
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1
NO INTERVALS.
SELECT-OPTIONS SEL1 FOR SY-SUBRC.
PARAMETERS PAR1 LIKE SPFLI-CARRID.
SELECTION-SCREEN INCLUDE PARAMETERS PAR0.
SELECTION-SCREEN COMMENT /10(20) TEXT-COM.
SELECTION-SCREEN COMMENT /10(20) COMM01.
SELECTION-SCREEN END OF BLOCK BL1.
SELECTION-SCREEN END OF SCREEN 123.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN INCLUDE: SELECT-OPTIONS SEL1,
COMMENT /5(15) COMM01.
SELECTION-SCREEN PUSHBUTTON 15(25) PUBU
USER-COMMAND US01.
SELECTION-SCREEN BEGIN OF SCREEN 99.
SELECTION-SCREEN INCLUDE PUSHBUTTON 20(20) PUBU
USER-COMMAND US02.
SELECT-OPTIONS SEL2 FOR SPFLI_WA-CONNID.
SELECTION-SCREEN INCLUDE BLOCKS BL1.
PARAMETERS PAR2 TYPE I.
SELECTION-SCREEN END OF SCREEN 99.
at selection-screen on pubu.
case sy-ucomm.
when 'us01'.
call screen 100.
when 'us02'.
call screen 200.
endcase.
2006 May 25 2:18 PM
hii
chk this code
************************************************************************
Selection-Screen *
************************************************************************
*Selection Screen 1
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
************************************************************************
At Selection-Screen Output *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
<b>CALL TRANSACTION 'MM01'.</b>
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
<b>CALL TRANSACTION 'MM02'.</b>
ENDLOOP.
ENDIF.
REGARDS
Naresh
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |