2009 May 06 5:30 AM
Hi Gurus
There are four radio buttons in the selection screen.while a selecting a fourth radio button the user should be prompted to enter select option.while the user selects the fourth radio button only select option should become a mandatory field.If user selects first button then select option should be hidden again. I am finding problem in making select option mandatory while selecting fourth radio button.
My code is
tables : afru.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS :
rb_1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND chk.
SELECTION-SCREEN COMMENT 3(5) text-003.
*
SELECTION-SCREEN POSITION 10.
PARAMETERS :
rb_2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 12(10) text-004.
*
SELECTION-SCREEN POSITION 22.
PARAMETERS :
rb_3 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 24(10) text-005.
SELECTION-SCREEN END OF LINE.
*
PARAMETERS:
rb_4 RADIOBUTTON GROUP g1.
SELECT-OPTIONS:
s_budat FOR afru-budat MODIF ID d1.
SELECTION-SCREEN END OF BLOCK b2.
*Prompt user for custom date
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rb_4 = '' AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
plz suggest steps
Thanks
Ganesh
Hi Gurus
There are four radio buttons in the selection screen.while a selecting a fourth radio button the user should be prompted to enter select option.while the user selects the fourth radio button only select option should become a mandatory field.If user selects first button then select option should be hidden again. I am finding problem in making select option mandatory while selecting fourth radio button.
My code is
tables : afru.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS :
rb_1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND chk.
SELECTION-SCREEN COMMENT 3(5) text-003.
*
SELECTION-SCREEN POSITION 10.
PARAMETERS :
rb_2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 12(10) text-004.
*
SELECTION-SCREEN POSITION 22.
PARAMETERS :
rb_3 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 24(10) text-005.
SELECTION-SCREEN END OF LINE.
*
PARAMETERS:
rb_4 RADIOBUTTON GROUP g1.
SELECT-OPTIONS:
s_budat FOR afru-budat MODIF ID d1.
SELECTION-SCREEN END OF BLOCK b2.
*Prompt user for custom date
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rb_4 = '' AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
plz suggest steps
Thanks
Ganesh
2009 May 06 5:36 AM
Hi,
try this.
AT SELECTION-SCREEN OUTPUT.
If rb_4 eq 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
endif.
This works
2009 May 06 5:40 AM
Try this.
tables : afru.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
*
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS :
rb_1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND chk.
SELECTION-SCREEN COMMENT 3(5) text-003.
*
SELECTION-SCREEN POSITION 10.
PARAMETERS :
rb_2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 12(10) text-004.
*
SELECTION-SCREEN POSITION 22.
PARAMETERS :
rb_3 RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 24(10) text-005.
SELECTION-SCREEN END OF LINE.
*
PARAMETERS:
rb_4 RADIOBUTTON GROUP g1.
SELECT-OPTIONS:
s_budat FOR afru-budat MODIF ID d1.
SELECTION-SCREEN END OF BLOCK b2.
*Prompt user for custom date
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rb_4 = '' AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
at selection-screen on s_budat.
IF rb_4 = 'X' .
if s_budat is initial.
message 'Enter Value for Posting date' type 'I' display like 'E'.
endif.
endif.
2009 May 06 5:40 AM
at selection screen.
if s_budat-low is initial and s_budat-high is initial.
error.
endif.
2009 May 06 5:41 AM
Hi ganesh,
SELECT-OPTIONS:
s_budat FOR afru-budat obligatory MODIF ID d1.
Regards.
2009 May 06 5:45 AM
Hi,
To make the select-option mandatory u can write a validation in at selection-screen on s_budat-low.
AT selection-screen on s_budat-low.
If s_budat[] is initial and rd4 is not initial.
message 'Enter Value For S_BUDAT'
endif.
Hope this resolves your query.
Regards,
Nikhil
Edited by: Nikhil Kayal on May 6, 2009 6:46 AM
2009 May 06 5:54 AM
2009 May 06 5:59 AM
Hi all
When I use obligatory in select options once the if the user radio button it does not allow other radio button to choose...for example if user selects radio button 4 and it shows select option...If the user again want to choose first radio button instead of 4th radio button..obligatory doesnt allow the user to other radio buttons...
Thanks
Ganesh
2009 May 06 6:02 AM
Making select option OBLIGATORY will make this mandatory on the screen.
better try the approach in first raply for this thread.
2009 May 06 6:11 AM
Hi,
Just try out the below code.
AT SELECTION-SCREEN OUTPUT.
If rb_4 eq 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'D1'.
screen-required = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
endif.
Regards,
Nikhil
2009 May 06 6:23 AM
Hi Ganesh,
Please add the following code to ur program and it works.
start-of-selection.
if not rb_4 is initial.
if s_budat[] is initial.
write:/'message[]'.
exit.
else.
write:/'*required logic'.
endif.
endif.
Thanx,
Anusha
2009 May 06 2:15 PM
I solved this using a counter
*Validating the posting date
AT SELECTION-SCREEN ON s_budat.
IF rb_4 = 'X'.
IF gf_cnt EQ '6' AND s_budat-low+4(2) EQ '00'.
MESSAGE text-093 TYPE 'I' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
STOP.
ENDIF.
ENDIF.
*Prompt user for custom date
AT SELECTION-SCREEN OUTPUT.
CLEAR : gf_cnt,
s_budat[],
s_budat.
LOOP AT SCREEN.
IF screen-name CS 'S_BUDAT'.
IF NOT rb_4 IS INITIAL.
screen-active = 1.
gf_cnt = gf_cnt + 1.
ELSE.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |