2007 Aug 07 3:50 PM
Hi all,
My requirement is like this.
User inputs some values in the dialog screen. After processing in the middle he encounters an error, and an error message appear on the status bar (status message). Here after the status message the screen fields should be cleared and should be input enable for the user to enter the valid data.
Like this we have some 6 to 7 messages in the processing. So when ever a message executes the screen fields should be cleared.
I can not use chain and end chain as i am not validating the screen fields.
Can you please tell how to reach my requirement.
Thanks.
Praveena.
2007 Aug 08 12:30 AM
To do this:
If there is an error then:
1. Set a variable in the PAI e.g. "g_error = 'X'."
2. Issue your message as an "S" type - then it will display at the bottom of the screen
2. In the PBO have a test:
if g_error = 'X'.
perform clear_screen. "reset you values
clear: g_error. "ready for next time
endif.
2007 Aug 07 4:23 PM
Hi,
If you are not validating the Screen fields, then how these status messages are formed ?
And if you are displaying those status messages, then at that time, you must be knowing which field has an error. So you can clear it.
And if you are using Message Type as 'E' for that field, then it will be cleared automatically.
2007 Aug 07 4:58 PM
Before raising any error message , you get sy-subrc ,if sy-subrc ne 0.
Then clear all variables which you are using in screen,then raise error message.
Other way ,keep one push button in screen, when user click on this button
When CLEA.
Use clear ,refresh command here.
Thanks
Seshu
2007 Aug 07 5:07 PM
Hi,
Before the error message, you need to do all these thigns,
Just before the message, Just clear all the fields, and you need to write these field in between CHAIN and ENDCHAIN so that fields will be enables for input
Regards
Sudheer
2007 Aug 07 5:12 PM
do this way...
Before the message is displayed on the screen, clear the data in the variables. Now, u need to write these fields inbetween CHAIN and ENDCHAIN so as that fields will be enabled for input of data..
2007 Aug 07 5:41 PM
Hi praveena,
Try this approach and let me know if it helped
you...
You should be firstly using a sy-subrc check before you display the message ryt?
Before you display the message, just loop on the screen and clear the required fields .
you can simultaneously make it input enable by
changing screen-active to '1'.
A small snippet of the above is as below :
If sy-subrc <> 0.
Loop at screen.
If screen-name = 'TEXTBOX1'. "ensure that the screen field name is in capitals
clear textbox1.
screen-input = 1.
endif.
modify screen.
endloop.
( display message here. ) "eg:message i000.
endif.
If you want it for all the screen fields, then
try this:
if sy-subrc <> 0.
Loop at screen.
screen-input = 1.
modify screen.
endloop.
( display message here. ) "eg:message i000.
endif.
you can include this code in a perform-form and call it after each message.
Regards,
SJ
2007 Aug 08 12:30 AM
To do this:
If there is an error then:
1. Set a variable in the PAI e.g. "g_error = 'X'."
2. Issue your message as an "S" type - then it will display at the bottom of the screen
2. In the PBO have a test:
if g_error = 'X'.
perform clear_screen. "reset you values
clear: g_error. "ready for next time
endif.