Application Development 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: 

refreshing the screen

Former Member
0 Kudos

hi,

i'm trying to throw an error message in the selection screen if there is any unwanted selection in the selection screen and im doing that in at selection-screen. it works well but the screen is not being refreshed, every time it shows an error message i need to refresh the screen .how can i do this. i'm not using modification groups.

thanks,

ravi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If are validating at selection screen event, why dont you initialize your selection fields before your pop-up the error message?

6 REPLIES 6

Former Member
0 Kudos

If are validating at selection screen event, why dont you initialize your selection fields before your pop-up the error message?

0 Kudos

As Shankar said, Try clearing that value before you throw the message.

Parameters: p_datum type sy-datum.

at selection-screen.

if p_datum > sy-datum.
clear p_datum.
message E000(00) with 'Date must be before today'.
endif.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Ravi,

But why exactly do you want to refresh ur screen ?

If you refresh the screen before throwing the error, the user may or may not understand the error any more, for he doesnt see the values entered by him anymore.

Pls tell as to why you want to do this.

Reg,

PP.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code for refreshing the screen.Kindly reward points,if it is useful.

You can accomplish this with a RFC enabled Function module.

1. Create a function module. The only functionality will be to wait for 10 secs.

2. Create a subroutine which will set a user-command.

3. and at user-command call the function module.

Below is the code, I found on the web. It is quite simple..

DATA: ZNUM LIKE SY-TABIX.

: GET TIME.

: WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.

: CALL FUNCTION 'Z_WAIT_30_SECS'

: STARTING NEW TASK 'IF'

: PERFORMING START_REFRESH ON END OF TASK.

: AT USER-COMMAND.

: IF SY-UCOMM = 'REFR'.

: SY-LSIND = SY-LSIND - 1.

: ADD 1 TO ZNUM.

: GET TIME.

: WRITE: /01 'Update Number:', ZNUM, SY-UZEIT.

: CALL FUNCTION 'Z_WAIT_30_SECS'

: STARTING NEW TASK 'IF'

: PERFORMING START_REFRESH ON END OF TASK.

: ENDIF.

: FORM START_REFRESH USING TASKNAME.

: SET USER-COMMAND 'REFR'.

: ENDFORM. "

: FUNCTION Z_WAIT_30_SECS.

: DATA: ZTIME LIKE SY-UZEIT.

: GET TIME.

: ZTIME = SY-UZEIT + 30.

: DO.

: GET TIME.

: IF SY-UZEIT >= ZTIME.

: EXIT.

: ENDIF.

: ENDDO.

: ENDFUNCTION.

andreas_mann3
Active Contributor
0 Kudos

Hi ravi,

use:

AT SELECTION-SCREEN <b>ON</b> p_datum. 
  if p_datum > sy-datum.
   message E000(00) .
  endif.

Andreas

Former Member
0 Kudos

Hi,

In the

AT SELECTION-SCREEN ON s_budat.

perform validation.

http://www.sapdevelopment.co.uk/reporting/selscr/selscrhome.htm