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

Former Member
0 Likes
535

Hi,

This is sandeep....

while i am doing validation on selection-screen,in that i am not able to get the exact output...

The selection-screen like this...

selection-screen begin of block b1 with frame title text-001.

SELECT-OPTIONS:S_KUNNR FOR KNA1-KUNNR,

S_BUKRS FOR BSID-BUKRS,

S_BUDAT FOR BSID-BUDAT.

PARAMETERS:OPEN AS CHECKBOX,

CLEARED AS CHECKBOX.

selection-screen end of block b1.

the requirement is without checking the <b>"CLEARED"</b> checkbox,we not allow the user to fill the closeing date <b>"S_BUDAT"</b>...in that time we need to get the error message as <u>'Without CLEARED choosing you not allow to fill this field'</u>.....

Please help me on this issue......

Thanking You..!

With Regards,

Sandeep.

5 REPLIES 5
Read only

Former Member
0 Likes
517

Hi Sandeep,

You can not fullfill your requirement using check box as selection of checkbox will not trigger any AT SELECTION.. event. So user may need to press ENTER key then only AT SELECTION SCREEN OUTPUT will be called and you can write your logic there. So better redesign the selection screen.

Regards,

Atish

Read only

0 Likes
517

Atish,

Not quite correct as linking USER-COMMAND to a checkbox will trigger the AT SELECTION SCREEN OUTPUT.

Surbjeet

Read only

Former Member
0 Likes
517

tables: sscrfields.

at selection-screen.

if ( sscrfields-ucomm = 'ONLI' or

sscrfields-ucomm = 'SJOB' or

sscrfields-ucomm = 'PRIN' ) and

s_budat[] is not initial and

cleared is initial.

-


error message

endif.

Read only

former_member378318
Contributor
0 Likes
517

Hi Sandeep,

Try the following code it should help you. It ensures that the budat field can only be input when the cleared flag is ticked:

SELECT-OPTIONS:s_kunnr FOR kna1-kunnr,

s_bukrs FOR bsid-bukrs,

s_budat FOR bsid-budat MODIF ID id1.

PARAMETERS: open AS CHECKBOX,

cleared AS CHECKBOX USER-COMMAND cm1.

AT SELECTION-SCREEN OUTPUT.

IF cleared IS INITIAL.

CLEAR: s_budat[].

LOOP AT SCREEN.

IF screen-group1 = 'ID1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Let me know if it helps.

Surbjeet

Read only

former_member194669
Active Contributor
0 Likes
517

Hi,

You can do it by Intialization event make the S_BUDAT in display move

Initialization.

LOOP AT SCREEN.

IF screen-name = 'S_BUDAT'.

screen-input = 1. "<< disable

ENDIF.

MODIFY SCREEN.

ENDLOOP.

PARAMETERS:OPEN AS CHECKBOX,

CLEARED AS CHECKBOX USER-COMMAND cmd.

then after the user click on check box CLEARED then open the S_BUDAT for input

AT SELECTION-SCREEN OUTPUT.

"" if sy-ucomm is CMD

CASE CMD.

WHEN ' '.

LOOP AT SCREEN.

IF screen-name = 'S_BUDAT'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDCASE.

Please check the syntax of of the above command

aRs