‎2011 Feb 10 7:45 AM
Dear Experts,
In following code, i want to modify the screen input according to the radiobutton selected.
SELECTION-SCREEN : BEGIN OF BLOCK super WITH FRAME.
PARAMETERS : r1 TYPE c RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND uc.
SELECTION-SCREEN : BEGIN OF BLOCK renewal WITH FRAME.
SELECT-OPTIONS : s_date FOR fplt-fkdat OBLIGATORY, " End date in billing plan
s_auart FOR vbak-auart, " Order Type
s_spart FOR vbak-spart, " Division
s_vtweg FOR vbak-vtweg. " Distributional Channel
SELECTION-SCREEN : END OF BLOCK renewal.
PARAMETERS : r2 TYPE c RADIOBUTTON GROUP g1.
SELECTION-SCREEN : BEGIN OF BLOCK deactivation WITH FRAME TITLE text-002.
SELECT-OPTIONS : s1_auart FOR vbak-auart, " Order Type
s1_vkbur FOR vbak-vkbur, " Sales Office
s1_spart FOR vbak-spart, " Division
s1_vtweg FOR vbak-vtweg. " Distributional Channel
SELECTION-SCREEN : END OF BLOCK deactivation.
SELECTION-SCREEN : END OF BLOCK super.But getting message date has to be entered even if i select radiobutton r2.
can any one provide guidance in this.
Thanks in advance
Regards,
jaspal
‎2011 Feb 10 7:57 AM
set s_date parameter as not obligatory
this code looks field as Obligatory but isn´t
at selection-screen output.
loop at screen.
if screen-name eq 's_date'.
screen-required = 2.
modify screen.
endif.endloop.
you must check in at selection-screen if s_date field has value.
Enjoy
‎2011 Feb 10 8:01 AM
Thanks for your reply.
the parameters s_date has to be obligatory.
Regards,
Jaspal
‎2011 Feb 10 8:11 AM
try the code above an check value of the field in at selection-screen event.
other way is set a default value to field
‎2011 Feb 10 8:24 AM
Dear Jaspalkumar.
You should make s_date not obligatory, but perform the check in an 'AT SELECTION-SCREEN' event.
Something like;
AT SELECTION-SCREEN on s_date.
If r2 is intial and s_date[] is initial.
message e001(00) with 'Date is obligatory'(e01).
endif.
Regards, John
‎2011 Feb 10 8:40 AM
Dear All
This is how i m doing.
AT SELECTION-SCREEN.
LOOP AT SCREEN.
IF r1 = 'X'.
IF screen-name = 'S_DATE' OR screen-name = 'S_AUART' OR screen-name = 'S_SPART' OR screen-name = 'S_VTWEG'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ELSEIF r2 = 'X'.
IF screen-name = 'S1_VKBUR' OR screen-name = 'S1_AUART' OR screen-name = 'S1_SPART' OR screen-name = 'S1_VTWEG'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2011 Feb 10 8:48 AM
HI,
Remove the S_date obligatory from the selection screen. And add the below code--
AT SELECTION-SCREEN.
if sy-ucom eq 'ONLI' and rd1 eq 'X' and s_date is initial.
" Give error message
endif.Regards,
Madhukar Shetty
‎2011 Feb 10 9:03 AM
Thanks all,
as advised by all, even if i make none parameters obligatory, still prob is same. unable to modyfy the screen.
if i click on r2, the fields in renewal block are still able to get input instead of getting diable.
Regards,
Jaspal kumar
‎2011 Feb 10 9:07 AM
Hi,
instead of writing AT SELECTION-SCREEN write AT SELECTION-SCREEN output .
like below
AT SELECTION-SCREEN OUTPUT
LOOP AT SCREEN.
IF r1 = 'X'.
IF screen-name = 'S_DATE' OR screen-name = 'S_AUART' OR screen-name = 'S_SPART' OR screen-name = 'S_VTWEG'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ELSEIF r2 = 'X'.
IF screen-name = 'S1_VKBUR' OR screen-name = 'S1_AUART' OR screen-name = 'S1_SPART' OR screen-name = 'S1_VTWEG'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2011 Feb 10 9:59 AM
Hi,
Just change at Selection screen to At Selection screen Output, If you are doing any action in Selection scereen we have to use At Selection Screen output event.
‎2011 Feb 11 5:50 AM