‎2007 Jun 20 2:21 PM
hi all,
How to create a selection screen with 2 parameters and respective radio buttons. The exact issue is when i click one radiobutton the respective parameter should be there and the other should disappear. and vice versa.
Also how to create a select option as parameter in appearance but internally it operates as select option. eg. the ranges button shudn't be there. only one input box needs to be there.but i should be able to give multiple single entries.
‎2007 Jun 20 2:23 PM
HI,
see the system define program
demo_dynpro_check_radio
rgds,
bharat.
‎2007 Jun 20 2:24 PM
Hello,
SELECT-OPTIONS
se_test for mara-matnr no intervals.
Regards,
John.
‎2007 Jun 20 2:25 PM
HI..,
Just execute this program once...
DATA W_FLG TYPE I.
parameters:
r_1 radiobutton group rad user-command ULL,
p_1 type i modif id GRP,
r_2 radiobutton group rad,
p_2 type i modif id GRR.
at selection-screen output.
IF W_FLG EQ 0.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'GRP' OR SCREEN-GROUP1 EQ 'GRR'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF W_FLG EQ 1.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'GRR' .
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF W_FLG EQ 2.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'GRP' .
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
at selection-screen ON RADIOBUTTON GROUP RAD.
if r_1 eq 'X'.
w_flg = 1.
else.
w_flg = 2.
endif.
<b>For the second question :</b>
select-options s_date for sy-datum no intervals.
regards,
sai ramesh
Plz do remember to close the thread when ur problem is solved !!
Reward all helpful answers !!
‎2007 Jun 20 2:26 PM
hi
<b>copy the code. here is ur answer</b>
&----
*& Include Z_INITIALIZATION
&----
TABLES: eban,
SSCRFIELDS.
SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',
rad2 RADIOBUTTON GROUP rad .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,
p_matnr TYPE eban-matnr MODIF ID g1,
sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,
str_loc TYPE eban-lgort MODIF ID g4.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.
SELECTION-SCREEN END OF SCREEN 100.
name = 'FETCH'.
title = 'Test Report'.
CALL SELECTION-SCREEN '100'.
TYPE-POOLS slis.
declaration of internal tables and work areas to be used
DATA: BEGIN OF it_pr OCCURS 0,
banfn TYPE eban-banfn,
bnfpo TYPE eban-bnfpo,
loekz TYPE eban-loekz,
statu TYPE eban-statu,
ekgrp TYPE eban-ekgrp,
matnr TYPE eban-matnr,
werks TYPE eban-werks,
lgort TYPE eban-lgort,
preis TYPE eban-preis,
peinh TYPE eban-peinh,
END OF it_pr.
DATA: BEGIN OF it_mat OCCURS 0,
matnr TYPE eban-matnr,
END OF it_mat.
*DATA:BEGIN OF ITAB1 OCCURS 0,
DATA: l_answer.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
it_event TYPE slis_t_event,
wa_event TYPE slis_alv_event.
declaration of variables to be used
DATA: r_ucomm TYPE sy-ucomm,
mat_no TYPE eban-matnr,
len TYPE i VALUE 1,
count TYPE i VALUE IS INITIAL,
iflag TYPE i VALUE IS INITIAL,
iflag1 TYPE i VALUE 0.
DATA :pr_id TYPE sy-repid,
rt_extab TYPE slis_t_extab.
INITIALIZATION.
pr_id = sy-repid.
AT SELECTION-SCREEN OUTPUT.
IF rad1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G1' OR screen-group1 = 'G4'.
screen-active = '1'.
screen-input = 0.
ELSEIF screen-group1 = 'G2'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF rad2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G1' OR screen-group1 = 'G4' OR screen-group1 = 'G3' OR screen-group1 = 'G5'.
screen-active = '0'.
ELSEIF screen-group1 = 'G2'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF mtr = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
screen-input = 1 .
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF sloc = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G4'.
screen-input = 1 .
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
clear sy-ucomm.
regards
ravish
<b>plz dont forget to reward points if helpful</b>
‎2007 Jun 20 2:32 PM
hi,
try like this,
parameters: c1 type check box,
c2 type check box,
r1 type radiobutton group g1 default 'x',
r2 type radiobuttonn group g1.
select-option: s_matnr for mara-matnr no interval. [ then it wont allow u to have any interval values, but allows u to have no. of single entries ]
in pai event.
at line selection.
if r1 = ' x'.
loop at screen.
if screen-name = 'c1'.
screen-input = 1.
modify screen.
endif.
if screen-name = 'c2'.
screen-input = 0.
modify screen.
endif.
endloop.
else.
if r2 = 'X'.
loop at screen.
if screen-name = 'c1'.
screen-input = 0.
modify screen.
endif.
if screen-name = 'c2'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
if helpful reward some points.
with regards,
suresh.
‎2007 Jun 20 3:21 PM
hi,
we can create SELECTION-SCREEN by using abap statements like
PARAMETERS.
SELECT-OPTIONS.
SELECTION-SCREEN.
by using PARAMETERS.and SELECT-OPTIONS.statement we can create standard selection-screen, having screen number '1000'.
by using SELECTION-SCREEN <number> statement we can create user defined selection-screen.
<b>logic</b>
PARAMETERS: rad1 type radiobutton group g1 ,
rad2 type radiobutton group g1.
*for changing screen fields dynamically, we write logic under
**AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rad1 = 'X'.
SCREEN-NAME = rad2.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ELSEIF rad2 = 'X'.
SCREEN-NAME = rad1.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
in the above logic SCREEN is the table it holds the attributes of all screen fields.
MODIFY SCREEN statement used to modify the screen fields dynamically.
<b>select option as parameter</b>
To allow the user to process only single fields on the selection screen, you use the following syntax:
<b>SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS .....</b>
As a result, the second input field does not appear on the selection screen. The user can only enter a single field comparison for the first row of the selection table. However, the user can call the Multiple Selection screen and enter range selections there.
regards,
Ashokreddy.
‎2007 Jun 21 7:11 AM
Hi,
For your second qn, try this
tables mara.
select-options s_matnr for mara-matnr no-extension no intervals.