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 validations

Former Member
0 Likes
862

Hi,

I am having four select-options and a check box in my selection screen. My requirement is to check/ Tick the check box only if values for the select-option two is provided. Else the check box should not be checked. All the select-options and check-box are in the same screen. Please suggest a way to achieve this requirement.

Thanks in advance,

Aravindan.

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
833

Hi, Anbalagan

you can use the following Logic

 " IN AT SELECTION SCREEN EVENT Write following CODE
IF seopt2[] IS NOT INITIAL.
     cbox = 'X'. 
ELSE.
     cbox = ''.
END IF.

@Santosh: I think there is no need for using MODIFY ID. Please Correct me if wrong

Best Regards,

Faisal

7 REPLIES 7
Read only

Former Member
0 Likes
833

Hi,

use modif id for parameters

and put it into if condition

regards

Santosh

Read only

faisalatsap
Active Contributor
0 Likes
834

Hi, Anbalagan

you can use the following Logic

 " IN AT SELECTION SCREEN EVENT Write following CODE
IF seopt2[] IS NOT INITIAL.
     cbox = 'X'. 
ELSE.
     cbox = ''.
END IF.

@Santosh: I think there is no need for using MODIFY ID. Please Correct me if wrong

Best Regards,

Faisal

Read only

Former Member
0 Likes
833

hi

you have to write the code in the event AT SELECTION-SCREEN OUTPUT.

IF s_option2[] IS NOT INITIAL.

checkbox = 'X'.

ELSE.

checkbox = ' '.

END IF.

Read only

Former Member
0 Likes
833

Hi Aravindan,

You can write follwoing code for check-box validation.

at selection-screen on p_checkbox.

if not p_checkbox is initial.

if s_opt2[] is initial.

message e208(00) with 'Checkbox can not be selected with s_opt2.'

endif.

endif.

Hope this will help you.

Regards,

Anil Salekar

Read only

Former Member
0 Likes
833

Hi Aravindan,

You can write follwoing code for check-box validation.

at selection-screen on p_check.

if s_opt1[] is initial and

not s_opt2[] is initial and

s_opt3[] is initial and

s_opt[] is initial.

" can tick the checkbox

else.

" cannot tick the checkbox

endif.

Hope this will help you.

Regards,

Abhijit G. Borkar

Read only

venkat_o
Active Contributor
0 Likes
833

Hi, Try this way.


   REPORT ztest_notepad.
   TABLES:nbew.
   SELECT-OPTIONS:
           einri FOR nbew-einri,
           falnr FOR nbew-falnr,
           lfdnr FOR nbew-lfdnr,
           bewty FOR nbew-bewty.
   PARAMETERS:p_check AS CHECKBOX.
   DATA:msg TYPE string.

   AT SELECTION-SCREEN.
     IF falnr[] IS NOT INITIAL.
       msg = 'Checkbox should be checked.'.
       MESSAGE msg TYPE 'E'.
     ENDIF.

   START-OF-SELECTION.

     WRITE 'Venkat'.
Thanks Venkat.O

Read only

Former Member
0 Likes
833

HI,

TRY THIS CODE...

tables: mara,vbak,marc.

select-OPTIONS matnr for mara-matnr.

select-OPTIONS werks FOR marc-werks.

SELECT-OPTIONS vbeln for vbak-vbeln.

SELECT-OPTIONS matkl FOR mara-matkl.

PARAMETERS: c1 as CHECKBOX USER-COMMAND CHK1.

PARAMETERS: c2 as CHECKBOX USER-COMMAND CHK2.

PARAMETERS: c3 as CHECKBOX USER-COMMAND CHK3.

PARAMETERS: c4 as CHECKBOX USER-COMMAND CHK4.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'CHK1' OR 'CHK2' OR 'CHK3' OR 'CHK4'.

IF MATNR-HIGH IS INITIAL OR MATNR-LOW IS INITIAL OR WERKS-HIGH IS INITIAL OR WERKS-LOW IS INITIAL

OR VBELN-HIGH IS INITIAL OR VBELN-LOW IS INITIAL OR MATKL-HIGH IS INITIAL OR MATKL-LOW IS INITIAL.

MESSAGE 'FILL REQUIRED ENTRIES' TYPE 'I'.

CLEAR: C1,C2,C3,C4.

ENDIF.

ENDCASE.