‎2010 Apr 30 7:23 AM
Hi Gurus,
I have a report with a selection screen.
The report has 2 radio buttons.The radiobuttons are grouped together.
My Requirement is to display different blocks based on radio button selection.
These blocks have mandatory fields.
The problem is that when I switch from one radiobutton to other.
It checks for the mandatory fields which I want to avoid.
The mandatory fields should be checked only when I process the report (F8).
Please advise.
Thanks in advance.
‎2010 Apr 30 7:28 AM
remove the obligatory check from the selection parameters and instead you can do your validations in at selection-screen.
‎2010 Apr 30 7:30 AM
‎2010 Apr 30 7:31 AM
Share the relevant part of your code...
You can try by validating at selection screen event.
‎2010 Apr 30 11:10 AM
Hi Viraj,
Remove the obligatory part from the selection screen elements i.e. from the parameters or the select-options.
Now validate these fields in your program under the condition when corresponding radio button is selected.. i.e. radio1 = 'X'.
and If <field> IS INITIAL.
give your validations..
Endif.
Hope you have got my point.....
I think this will solve your problem....
‎2010 Apr 30 11:17 AM
Hi Viraj,
1. Take off the 'Obligatory' addition
2. Do the validation in the AT SELECTION-SCREEN.
'If <....> is initial
message ....
endif ".
Hope this helps!
Enjoy ABAPing
Cheers,
Kripa Rangachari.
‎2010 Apr 30 11:57 AM
Just try this code
SELECTION-SCREEN: BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_AUART FOR VBAK-AUART OBLIGATORY NO INTERVALS,
" Sales Document Type
S_AUGRU FOR VBAK-AUGRU OBLIGATORY NO INTERVALS,
" Order reason
S_ERDAT FOR VBAK-ERDAT OBLIGATORY.
" Date on which the record was created
SELECTION-SCREEN: END OF BLOCK B01.
*-- Mail Sending Options
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
PARAMETERS:P_EMAIL AS CHECKBOX DEFAULT SPACE USER-COMMAND V_COM .
PARAMETERS : P_MODE TYPE SO_ESCAPE default 'U' MODIF ID US1.
SELECT-OPTIONS: S_EMAIL FOR ADR6-SMTP_ADDR
NO INTERVALS MODIF ID US2.
SELECT-OPTIONS: S_EMAIL FOR TRDYSE01CM-USERNAME
NO INTERVALS MODIF ID US2.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 55(40) TEXT-019 MODIF ID US2.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
‎2010 Apr 30 12:00 PM
‎2010 May 01 6:22 AM
I do not wish to remove the obligatory check.
Can anyone suggest me how I can do it with keeping the check as it is.
‎2010 May 01 12:28 PM
Hi Viraj
Without removing the obligatory check its not possible to switch bewtween 2 radio buttons. Just remove the obligatory check.
In the At selection screen, check the sy-ucommm = 'ONLI', then validate (depends on radio button selected) the fields and throw error message accordingly.
Vinoth
‎2010 May 01 11:03 PM
Moderator message - Please search before asking - post locked Rob