‎2007 Oct 05 10:56 AM
hi,
could u plz explain how to keep push buttons on selection screen .
explain with example
regards.
rajesh.
‎2007 Oct 05 12:50 PM
Hi,
Check the below code.
TABLES sscrfields.
DATA flag(1) TYPE c.
SELECTION-SCREEN:BEGIN OF LINE.
SELECTION-SCREEN:PUSHBUTTON 2(10) text-111 USER-COMMAND cli1.
SELECTION-SCREEN:END OF LINE.
SELECTION-SCREEN:SKIP.
SELECTION-SCREEN:BEGIN OF LINE.
SELECTION-SCREEN:PUSHBUTTON 2(10) text-112 USER-COMMAND cli2.
SELECTION-SCREEN:END OF LINE.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'CLI1'.
flag = '1'.
WHEN 'CLI2'.
flag = '2'.
ENDCASE.
START-OF-SELECTION.
CASE flag.
WHEN '1'.
WRITE / 'Button 1 was clicked'.
WHEN '2'.
WRITE / 'Button 2 was clicked'.
WHEN OTHERS.
WRITE / 'No Button was clicked'.
ENDCASE.
‎2007 Oct 05 11:01 AM
hi Rajesh,
try this out.
im sending Sample program change it according to ur req..
TABLES sscrfields.
DATA flag(1) TYPE c.
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.
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.
<b><i>Reward points if useful</i></b>
Chandra
Message was edited by:
Chandrasekhar V
‎2007 Oct 05 11:09 AM
Hi ..
To generate pushbuttons on selection Screen (App tolbar) .. Chech this code...
REPORT zselfile1 .
TABLES:sscrfields.
**Create the Additional Selection screen to input filename
SELECTION-SCREEN: BEGIN OF SCREEN 10.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN: END OF SCREEN 10.
**Create Application Toolbar Button on the Standard selection Screen
SELECTION-SCREEN FUNCTION KEY 1. "Its fcode will be FC01
PARAMETERS : p_werks TYPE marc-werks.
INITIALIZATION.
sscrfields-functxt_01 = 'Enter File'. "Assign the Text to the Button
AT SELECTION-SCREEN.
CASE sscrfields-ucomm. "Check the Fcode
WHEN 'FC01'.
CALL SELECTION-SCREEN 10 STARTING AT 5 8 ENDING AT 85 20.
ENDCASE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME' "Local file browser
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
START-OF-SELECTION.
reward if Helpful
‎2007 Oct 05 12:39 PM
Hi,
Sample code,
<b>selection-screen begin of block b2 with frame title text-001.
parameters p_device type tsp03-padest.
selection-screen: pushbutton 79(10) text-047 user-command cli1.
selection-screen end of block b2.</b>
Reward if useful.
‎2007 Oct 05 12:45 PM
Hi Rejeshreddy,
Use this code :
selection-screen begin of block a1 with frame title a1title.
selection-screen skip.
selection-screen comment /1(45) a1line1.
selection-screen pushbutton 50(10) txt1 user-command com1.
selection-screen skip.
selection-screen comment /1(45) b1line1.
selection-screen pushbutton 50(10) txt2 user-command com2.
selection-screen skip.
selection-screen comment /1(45) c1line1.
selection-screen pushbutton 50(10) txt3 user-command com3.
selection-screen skip.
selection-screen comment /1(45) d1line1.
selection-screen pushbutton 50(10) txt4 user-command com4.
selection-screen skip.
selection-screen comment /1(45) e1line1.
selection-screen pushbutton 50(10) txt5 user-command com5.
selection-screen skip.
selection-screen comment /1(45) f1line1.
selection-screen pushbutton 50(10) txt6 user-command com6.
selection-screen skip.
selection-screen comment /1(45) g1line1.
selection-screen pushbutton 50(10) txt7 user-command com7.
selection-screen skip.
selection-screen comment /1(45) h1line1.
selection-screen pushbutton 50(10) txt8 user-command com8.
selection-screen skip.
selection-screen comment /1(45) i1line1.
selection-screen pushbutton 50(10) txt9 user-command com9.
selection-screen skip.
selection-screen comment /1(45) j1line1.
selection-screen pushbutton 50(10) txt10 user-command com10.
selection-screen end of block a1.
Reward points if helpful.
Regards,
Hemant
‎2007 Oct 05 12:50 PM
Hi,
Check the below code.
TABLES sscrfields.
DATA flag(1) TYPE c.
SELECTION-SCREEN:BEGIN OF LINE.
SELECTION-SCREEN:PUSHBUTTON 2(10) text-111 USER-COMMAND cli1.
SELECTION-SCREEN:END OF LINE.
SELECTION-SCREEN:SKIP.
SELECTION-SCREEN:BEGIN OF LINE.
SELECTION-SCREEN:PUSHBUTTON 2(10) text-112 USER-COMMAND cli2.
SELECTION-SCREEN:END OF LINE.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'CLI1'.
flag = '1'.
WHEN 'CLI2'.
flag = '2'.
ENDCASE.
START-OF-SELECTION.
CASE flag.
WHEN '1'.
WRITE / 'Button 1 was clicked'.
WHEN '2'.
WRITE / 'Button 2 was clicked'.
WHEN OTHERS.
WRITE / 'No Button was clicked'.
ENDCASE.
‎2007 Oct 05 1:16 PM
hi rajeshreddy,
just i am sending one small example to u how to place pushbuttons on selection screen, so go through it and if any more doubts reply me.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: a1 TYPE i,
b1 TYPE i,
c1 TYPE i.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON /10(10) lb4 USER-COMMAND pb1.
SELECTION-SCREEN PUSHBUTTON 40(10) lb5 USER-COMMAND pb2.
INITIALIZATION.
lb4 = 'ADD'.
lb5 = 'EXIT'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'PB1'.
c1 = a1 + b1.
WHEN 'PB2'.
LEAVE PROGRAM.
ENDCASE.
<b>reward points if helpfull.</b>
with regards,
radhika kolluru