‎2006 Feb 23 4:01 AM
hello all...
in a perticular report i have three selection criteria based on date ..
1)order date
2)delivery date
3) invoice date
and therequirment is if one date range is given by the user, the other two date range should be disabled...
‎2006 Feb 23 4:06 AM
Disabled or ignored? If you are following a certain sequence, meaning, if user enters values in range1 and range2, that you need to ignore the latter, then you can do something like this.
report zrich_0001.
select-options: s_datum1 for sy-datum.
select-options: s_datum2 for sy-datum.
select-options: s_datum3 for sy-datum.
start-of-selection.
if not s_datum1 is initial.
clear s_datum2. refresh s_datum2.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum2 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum3 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum2. refresh s_datum2.
endif.
write:/ 'Datum1', s_datum1.
write:/ 'Datum2', s_datum2.
write:/ 'Datum3', s_datum3.
REgards,
Rich Heilman
‎2006 Feb 23 4:03 AM
HI
you have to do this with MODIF ID for the select-options
for ex.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: s_opt for <field> modif id bk1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: s_opt1 for <field> modif id bk2.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.
PARAMETERS: s_opt2 for <field> modif id bk3.
SELECTION-SCREEN END OF BLOCK b3.
At Selection-screen on s_opt.
if s_opt is not initial.
loop at screen.
if screen-group1 = 'bk2' or screen-group1 = 'bk3'.
screen-input = '0'.
endif.
endloop.
modify screen.
endif.
At Selection-screen on s_opt1.
if s_opt1 is not initial.
loop at screen.
if screen-group1 = 'bk1' or screen-group1 = 'bk3'.
screen-input = '0'.
endif.
endloop.
modify screen.
endif.
At Selection-screen on s_opt2.
if s_opt2 is not initial.
loop at screen.
if screen-group1 = 'bk2' or screen-group1 = 'bk1'.
screen-input = '0'.
endif.
endloop.
modify screen.
endif.
regards
kishore
Message was edited by: Harikishore Sreenivasulu
‎2006 Feb 23 4:05 AM
hi Kishan,
You can use..
select-options : s_dat1 for... MODIF ID B1,
s_dat2 for... MODIF ID B2,
s_dat3 for .... MODIF ID B3.
At Selection-screen on S_dat1.
if s_dat1 is not initial.
loop at screen.
if screen-group1 = 'B2' or screen-group1 = 'B3'.
screen-input = '0'.
endif.
endloop.
modify screen.
endif.where B2 and B3 are MODIF ID of select-options for second and third dates..
change this according to your requirement..
regards
satesh
‎2006 Feb 23 4:05 AM
hi kishan,
Then declare the date variable with parameter data type. Hope this serves your purpose
Regards,
Santosh P
‎2006 Feb 23 4:06 AM
Disabled or ignored? If you are following a certain sequence, meaning, if user enters values in range1 and range2, that you need to ignore the latter, then you can do something like this.
report zrich_0001.
select-options: s_datum1 for sy-datum.
select-options: s_datum2 for sy-datum.
select-options: s_datum3 for sy-datum.
start-of-selection.
if not s_datum1 is initial.
clear s_datum2. refresh s_datum2.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum2 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum3 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum2. refresh s_datum2.
endif.
write:/ 'Datum1', s_datum1.
write:/ 'Datum2', s_datum2.
write:/ 'Datum3', s_datum3.
REgards,
Rich Heilman
‎2006 Feb 23 4:12 AM
If you wish to disable the fields on the screen. Then you can do something like this.
report zrich_0001.
select-options: s_datum1 for sy-datum modif id sd1.
select-options: s_datum2 for sy-datum modif id sd2.
select-options: s_datum3 for sy-datum modif id sd3.
at selection-screen output.
loop at screen.
if not s_datum1 is initial
and ( screen-group1 = 'SD2'
or screen-group1 = 'SD3' ).
screen-input = '0'.
modify screen.
endif.
if not s_datum2 is initial
and ( screen-group1 = 'SD1'
or screen-group1 = 'SD3' ).
screen-input = '0'.
modify screen.
endif.
if not s_datum3 is initial
and ( screen-group1 = 'SD1'
or screen-group1 = 'SD2' ).
screen-input = '0'.
modify screen.
endif.
endloop.
start-of-selection.
if not s_datum1 is initial.
clear s_datum2. refresh s_datum2.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum2 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum3. refresh s_datum3.
endif.
if not s_datum3 is initial.
clear s_datum1. refresh s_datum1.
clear s_datum2. refresh s_datum2.
endif.
write:/ 'Datum1', s_datum1.
write:/ 'Datum2', s_datum2.
write:/ 'Datum3', s_datum3.
Regards,
Rich Heilman
‎2006 Feb 23 4:20 AM
HI
this is code is working perfectly
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: s_opt type d modif id bk1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: s_opt1 type d modif id bk2.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.
PARAMETERS: s_opt2 type d modif id bk3.
SELECTION-SCREEN END OF BLOCK b3.
At selection-screen output.
if s_opt is not initial.
loop at screen.
if screen-group1 = 'BK2' or screen-group1 = 'BK3'.
screen-input = '0'.
endif.
modify screen.
endloop.
endif.
if s_opt1 is not initial.
loop at screen.
if screen-group1 = 'BK1' or screen-group1 = 'BK3'.
screen-input = '0'.
endif.
modify screen.
endloop.
endif.
if s_opt2 is not initial.
loop at screen.
if screen-group1 = 'BK2' or screen-group1 = 'BK1'.
screen-input = '0'.
endif.
modify screen.
endloop.
regards
kishore