‎2009 Jan 07 5:17 AM
Hi all,
I have 10 selection screen fields, in that 3 date fields which r given with select-options.
Now If one date field is given, then rest of the rwo date fields should be disabled.
How to do that with clear example.
Thanks,
Rohith.
‎2009 Jan 07 5:21 AM
This will sove your problem.
parameters: date1 type sy-datum.
parameters: date2 type sy-datum.
parameters: date3 type sy-datum.
at selection-screen output.
if date1 is not initial.
loop at screen.
if screen-name = 'DATE2' or screen-name = 'DATE3'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
‎2009 Jan 07 5:33 AM
Hello,
Plz try the code below:
REPORT Y_WA NO STANDARD PAGE HEADING LINE-COUNT 60(5).
TABLES: BKPF.
SELECT-OPTIONS:
S_DT1 FOR BKPF-BLDAT MODIF ID M1,
S_DT2 FOR BKPF-BLDAT MODIF ID M2,
S_DT3 FOR BKPF-BLDAT MODIF ID M3.
AT SELECTION-SCREEN OUTPUT.
PERFORM F_SUPRESS_FIELDS.
*&---------------------------------------------------------------------*
*& Form F_SUPRESS_FIELDS
*&---------------------------------------------------------------------*
FORM F_SUPRESS_FIELDS .
IF S_DT1 IS NOT INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'M2' OR SCREEN-GROUP1 = 'M3'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF S_DT2 IS NOT INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'M3' OR SCREEN-GROUP1 ='M1'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF S_DT3 IS NOT INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'M1' OR SCREEN-GROUP1 = 'M2'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " F_SUPRESS_FIELDS
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 7, 2009 6:43 AM
‎2009 Jan 08 3:19 AM
Hi,
With this, the fields will get disable only when the user press 'Enter'.
If he goes with mouse click or Tab button then this will not work.
So for event, after entering one of the fields in the three dates, it should get disable.
<<removed_by_moderator>>
Thank You,
Rohith.
Edited by: Vijay Babu Dudla on Jan 15, 2009 4:47 AM
‎2009 Jan 07 5:22 AM
HI.
Refer this link.
http://www.henrikfrank.dk/abaptips/reporting/selectionscreen/disableparameter.htm
Regards.
Jay
‎2009 Jan 07 5:23 AM
Hi Rohit,
Try to use the SCREEN internal table logic.
LOOP AT SCREEN.
if so_date is not initila.
then enabling that button
IF screen-group1 = c_date. "'date.
screen-required = c_1. "'1'.
screen-output = c_1. "'1'.
screen-input = c_1. "'1'.
MODIFY SCREEN.
ENDIF.
endif.
if so_date is not initial.
then enabling that button
IF screen-group1 = c_date1. "'date1'.
screen-required = c_1. "'1'.
screen-output = c_1. "'1'.
screen-input = c_1. "'1'.
MODIFY SCREEN.
ENDIF.
ENDIF.
if so_date is not initila.
then enabling that button
IF screen-group1 = c_date2. "'date2'.
screen-required = c_1. "1'.
screen-output = c_1. "'1'.
screen-input = c_1. "'1'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
mention the group properties of that filed in your screen as the DATE ,DATE1 and DATE2 as per your requiremnt.
Thanks!
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:29 PM
‎2009 Jan 07 5:27 AM
Hi,
if any one of the date field on the slection screen is filled with value then do it like that.
at selection-screen.
if date1 = 'X'.
display the other 2 with no display option as given in the following format.
[OBLIGATORY|NO-DISPLAY]
[VISIBLE LENGTH vlen]
[NO-EXTENSION]
[NO INTERVALS]
[MODIF ID modid] ... .
hope it will help.
Regards
Rajesh
‎2009 Jan 07 5:32 AM
Hi,
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
If screen-name = date2.
if date1 IS NOT INITIAL.
screen-invisible = 1.
endif.
endif.
modify screen.
If screen-name = date3.
if date1 IS NOT INITIAL.
screen-invisible = 1.
endif.
endif.
modify screen.
ENDLOOP.
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:29 PM
‎2009 Jan 07 5:36 AM
‎2009 Jan 07 5:39 AM
Hi,
SELECT-OPTIONS : s_date1 FOR sy-datum,
s_date2 FOR sy-datum,
s_date3 FOR sy-datum.
AT SELECTION-SCREEN OUTPUT.
IF s_date1 IS NOT INITIAL AND s_date2 IS INITIAL AND s_date3 IS INITIAL.
LOOP AT SCREEN.
IF screen-name = 'S_DATE2-LOW' OR screen-name = 'S_DATE2-HIGH'
OR screen-name = 'S_DATE3-LOW' OR screen-name = 'S_DATE3-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF s_date2 IS NOT INITIAL AND s_date1 IS INITIAL AND s_date3 IS INITIAL.
LOOP AT SCREEN.
IF screen-name = 'S_DATE1-LOW' OR screen-name = 'S_DATE1-HIGH'
OR screen-name = 'S_DATE3-LOW' OR screen-name = 'S_DATE3-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF s_date3 IS NOT INITIAL AND s_date1 IS INITIAL AND s_date2 IS INITIAL.
LOOP AT SCREEN.
IF screen-name = 'S_DATE1-LOW' OR screen-name = 'S_DATE1-HIGH'
OR screen-name = 'S_DATE2-LOW' OR screen-name = 'S_DATE2-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Thanks & REgards
Edited by: Always Learner on Jan 7, 2009 7:07 AM
‎2009 Jan 07 5:54 AM
Hi,
LOOP AT SCREEN.
*Put if condition*
MODIFY SCREEN.
ENDIF.
ENDLOOP.
this will work out for you
fareed
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:30 PM
‎2009 Jan 15 9:13 AM