Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection screen validation problem.

Former Member
0 Likes
1,242

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.

10 REPLIES 10
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,111

remove the obligatory check from the selection parameters and instead you can do your validations in at selection-screen.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,111

Something similar to your requirement:

Read only

Former Member
0 Likes
1,111

Share the relevant part of your code...

You can try by validating at selection screen event.

Read only

Former Member
0 Likes
1,111

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....

Read only

Former Member
0 Likes
1,111

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.

Read only

Former Member
0 Likes
1,111

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.

Read only

Former Member
0 Likes
1,111

You try to validate that in at selection screen output

Read only

Former Member
0 Likes
1,111

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.

Read only

0 Likes
1,111

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

Read only

Former Member
0 Likes
1,111

Moderator message - Please search before asking - post locked Rob