‎2007 May 23 4:58 PM
Hi experts,
How can i display one after other selection options by clicking function code?
If i click function code first time
1. first select option shoud display
If i click again
1. first selection option
2. second selection option
If i click again shoud display
1. first selection option
2. second selection option
3. third selection option
and so on....
It should display upto 15 select-options.
How can i do that?
It would be great help if any one could give the sample code.
Reward guaranteed,
thanks,
kaki
‎2007 May 23 9:19 PM
‎2007 May 23 5:21 PM
Hi
I'not sure what you really need to do, but u can try this code perhaps it can help you:
TABLES: SSCRFIELDS.
DATA: NAME(10) TYPE C.
DATA: GROUP1(3) TYPE N.
DEFINE: M_BUILD_SCREEN.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (30) C_&1 FOR FIELD S_&1 MODIF ID &1.
SELECT-OPTIONS S_&1 FOR NAME MODIF ID &1.
SELECTION-SCREEN END OF LINE.
END-OF-DEFINITION.
M_BUILD_SCREEN 001.
M_BUILD_SCREEN 002.
M_BUILD_SCREEN 003.
M_BUILD_SCREEN 004.
M_BUILD_SCREEN 005.
M_BUILD_SCREEN 006.
M_BUILD_SCREEN 007.
M_BUILD_SCREEN 008.
M_BUILD_SCREEN 009.
M_BUILD_SCREEN 010.
M_BUILD_SCREEN 011.
M_BUILD_SCREEN 012.
M_BUILD_SCREEN 013.
M_BUILD_SCREEN 014.
M_BUILD_SCREEN 015.
SELECTION-SCREEN: FUNCTION KEY 1.
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
WHEN 'FC01'.
GROUP1 = GROUP1 + 1.
IF GROUP1 > '015'. GROUP1 = '001'. ENDIF.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
CHECK NOT GROUP1 IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 <> GROUP1 AND
NOT SCREEN-GROUP1 IS INITIAL.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.Max
‎2007 May 23 5:24 PM
Hi,
you can control at the selection-screen output event..
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SY-UCOMM = 'FC01'.
* Open the fields for input only if the button is pressed.
screen-active = 1.
ELSE.
* Don't show.
Screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Thanks,
Naren
‎2007 May 23 8:51 PM
Hi Naren,
Could you pls give me the sample code with FCODE.
thanks
kaki
‎2007 May 23 5:40 PM
************************************************************************
***********Start of Selection Screen**********************************
************************************************************************
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
PARAMETERS : p_head RADIOBUTTON GROUP gp1 DEFAULT 'X'
USER-COMMAND chk,
p_deta RADIOBUTTON GROUP gp1,
p_procc RADIOBUTTON GROUP gp1.
SELECTION-SCREEN : END OF BLOCK blk.
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE v_text.
SELECTION-SCREEN : SKIP 1.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN : COMMENT 1(12) text_001.
PARAMETERS : p_pact LIKE zorheader-zzphyact MODIF ID g1
MATCHCODE OBJECT zmm_masschange.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN : COMMENT 1(9) text_003.
PARAMETERS : p_matnr LIKE mara-matnr MODIF ID g2." OBLIGATORY.
SELECTION-SCREEN : COMMENT 33(13) text_004.
PARAMETERS : p_matnr1 LIKE mara-matnr MODIF ID g2." OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
PARAMETERS : m_or11 RADIOBUTTON GROUP gp22 MODIF ID g2 DEFAULT 'X'
USER-COMMAND chk1.
PARAMETERS : m_eor11 RADIOBUTTON GROUP gp22 MODIF ID g2.
PARAMETERS : m_both RADIOBUTTON GROUP gp22 MODIF ID g2.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN : COMMENT 1(9) text_005.
PARAMETERS : p_roc LIKE ztest-fld1 MODIF ID g3
MATCHCODE OBJECT z1.
SELECTION-SCREEN : COMMENT 25(14) text_006.
PARAMETERS : p_roc1 LIKE ztest-fld1 MODIF ID g3
MATCHCODE OBJECT z11.
SELECTION-SCREEN : END OF LINE.
PARAMETERS : p_or RADIOBUTTON GROUP gp2 MODIF ID g3 DEFAULT 'X'
USER-COMMAND chk1.
PARAMETERS : p_or1 RADIOBUTTON GROUP gp2 MODIF ID g3.
SELECTION-SCREEN : SKIP 1.
SELECTION-SCREEN : END OF BLOCK blk1.
************************************************************************
*********************End of Selection Screen**************************
************************************************************************
************************************************************************
***********Start of Modifications to Selection Screen O/P*************
************************************************************************
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_head = 'X' AND ( screen-group1 = 'G2' OR screen-group1 = 'G3' ).
CLEAR : text_003 ,text_004,text_005,text_006.
v_text = 'Test'.
text_001 = 'Test1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF p_deta = 'X' AND ( screen-group1 = 'G1' OR screen-group1 = 'G3' ).
CLEAR : text_001,text_005,text_006." text_002 ,text_001.
v_text = 'TEST3'.
text_003 = 'Material'.
text_004 = 'With Material'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF p_procc = 'X' AND ( screen-group1 = 'G2' OR screen-group1 = 'G1' ).
CLEAR : text_001, text_004 ,text_003.
v_text = 'test4'.
text_005 = 'test5'.
text_006 = 'With '.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Award points if helpful
Thanks
venki
‎2007 May 23 9:19 PM
‎2007 May 23 9:26 PM
‎2007 May 23 9:26 PM
‎2007 May 23 9:30 PM
Try this.
TABLES: sscrfields.
DATA: button1_pressed VALUE '0',
button2_pressed VALUE '0',
button3_pressed VALUE '0'.
SELECTION-SCREEN PUSHBUTTON /1(10): push1 USER-COMMAND push1,
push2 USER-COMMAND push2,
push3 USER-COMMAND push3.
SELECT-OPTIONS: s_push1 FOR sy-datum MODIF ID p1,
s_push2 FOR sy-uname MODIF ID p2,
s_push3 FOR sy-zonlo MODIF ID p3.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'PUSH1'.
MOVE '1' TO button1_pressed.
WHEN 'PUSH2'.
MOVE '2' TO button2_pressed.
WHEN 'PUSH3'.
MOVE '3' TO button3_pressed.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'P1'.
IF button1_pressed = '0'.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ELSEIF screen-group1 = 'P2'.
IF button2_pressed = '0'.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ELSEIF screen-group1 = 'P3'.
IF button3_pressed = '0'.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2007 May 23 9:30 PM
Here is a very simply solution using a pushbutton.
report zrich_0001.
data: c type char20.
data: counter(3) type n.
selection-screen pushbutton 1(20) pb1 user-command push.
select-options: s_so1 for c modif id 001.
select-options: s_so2 for c modif id 002.
select-options: s_so3 for c modif id 003.
select-options: s_so4 for c modif id 004.
select-options: s_so5 for c modif id 005.
select-options: s_so6 for c modif id 006.
select-options: s_so7 for c modif id 007.
select-options: s_so8 for c modif id 008.
select-options: s_so9 for c modif id 009.
select-options: s_so10 for c modif id 010.
select-options: s_so11 for c modif id 011.
select-options: s_so12 for c modif id 012.
select-options: s_so13 for c modif id 013.
select-options: s_so14 for c modif id 014.
select-options: s_so15 for c modif id 015.
at selection-screen output.
loop at screen.
if screen-group1 > counter.
screen-active = '0'.
modify screen.
endif.
endloop.
at selection-screen.
case sy-ucomm.
when 'PUSH'.
counter = counter + 1.
endcase.
Regards.
Rich Heilman
‎2007 May 23 9:32 PM
or much simpler
TABLES: sscrfields.
DATA: button1_pressed VALUE '0',
button2_pressed VALUE '0',
button3_pressed VALUE '0'.
SELECTION-SCREEN PUSHBUTTON /1(10): push1 USER-COMMAND push1,
push2 USER-COMMAND push2,
push3 USER-COMMAND push3.
SELECT-OPTIONS: s_push1 FOR sy-datum MODIF ID p1,
s_push2 FOR sy-uname MODIF ID p2,
s_push3 FOR sy-zonlo MODIF ID p3.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'PUSH1'.
MOVE '1' TO button1_pressed.
WHEN 'PUSH2'.
MOVE '2' TO button2_pressed.
WHEN 'PUSH3'.
MOVE '3' TO button3_pressed.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'P1'.
screen-active = button1_pressed.
ELSEIF screen-group1 = 'P2'.
screen-active = button2_pressed.
ELSEIF screen-group1 = 'P3'.
screen-active = button3_pressed.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2007 May 23 9:45 PM
Hi Rich,
Many thanks for your code.
It is very suitable to my requirement.
Points alloted to you & Mr. Srinivas
Thanks,
Kaki
‎2007 May 23 10:02 PM
As per Rich's code, you have only one pushbutton, and the user has to press the button multiple times to see the select-options user wants to use.
But I thought your requirement is to present the user with multiple pushbuttons and depending on which push buttons user presses, you will enable only those select-options.