2010 Sep 23 5:13 PM
Hi,
I have developed a selection screen. There's a button that lauches an action to perform when the selection screen fields are filled. When the user inputs bad data, the program warn the user that the filled entries have an error and clear the screen inputs.
How can I manage to display back the data that was previously filled ? Should I use the INITIALIZATION key word ?
Thanks in advance for your help.
Thibault
2010 Sep 28 3:33 PM
Formal way to pre-populate select-options is like this:
INITIALIZATION.
S1-sign = 'I'.
S1-option = 'BT'.
S1-low = '888'.
S1-high = '889'.
APPEND S1.
* To avoid extended program check complaint, you might want to do APPEND S1 TO S1.
Proper way to catch user errors is to wait until they execute the program. Pushing a button to validate the user entries is not a common practice in SAP. First of all, none of the SAP's standard programs do that. Secondly, there is no guarantee that users push that button. I understand that it is some times necessary to catch the errors before they submit a background job. However, according to my past experience, it causes other problems. I don't remember the details, though.
Formal way to pre-populate select-options is like this:
INITIALIZATION.
S1-sign = 'I'.
S1-option = 'BT'.
S1-low = '888'.
S1-high = '889'.
APPEND S1.
* To avoid extended program check complaint, you might want to do APPEND S1 TO S1.
Proper way to catch user errors is to wait until they execute the program. Pushing a button to validate the user entries is not a common practice in SAP. First of all, none of the SAP's standard programs do that. Secondly, there is no guarantee that users push that button. I understand that it is some times necessary to catch the errors before they submit a background job. However, according to my past experience, it causes other problems. I don't remember the details, though.
2010 Sep 23 5:21 PM
Hi,
Put your validation code inside AT SELECTION-SCREEN.
Regds,
Senthil
2010 Sep 28 1:46 PM
Here is a point,
I am at least trying to initialize the select option range value, so that the user does not have to type in a value (I am trying to do that for test purpose only):
selection-screen begin of screen 1 as subscreen.
select-options S1 for
VBAP-VGBEL
modif id 001.
selection-screen end of screen 1 .
INITIALIZATION.
DATA: lv_s1Low TYPE VGBEL,
lv_s1High TYPE VGBEL.
lv_s1Low = '888'.
lv_s1High = '889'.
MOVE: 'BT' TO S1,
lv_s1Low TO S1-LOW,
lv_s1High TO S1-HIGH.
APPEND S1.When executing the program, nothing happens, the input fields are still empy !!When this will be working, I will be able to get back the previously typed in values.
Thanks in advance for your help.
Thibault
2010 Sep 28 1:51 PM
I even tried in the PBO with the screen definition above....
AT SELECTION-SCREEN OUTPUT.
INITIALIZATION.
DATA: lv_s1Low TYPE VGBEL,
lv_s1High TYPE VGBEL.
lv_s1Low = '888'.
lv_s1High = '889'.
MOVE: 'BT' TO S1,
lv_s1Low TO S1-LOW,
lv_s1High TO S1-HIGH.
APPEND S1.
2010 Sep 28 1:58 PM
Did you forget your 'I'-include ? IBT888 889
But, why clear the screen inputs? If you validate the data entered in AT SELECTION-SCREEN event (when SSCRFIELDS-UCOMM eq 'PRIN' or 'ONLI' or 'SJOB, meaning user is executing the program), and isse an Error message, they're not going anywhere until they pass validation.
2010 Sep 28 2:01 PM
I am not sure what you talking about.
Why would I need an include ? The syntax control does not return any error.
I am declaring select option, then initializing them, but the result can't be seen when executing the program....
2010 Sep 28 2:06 PM
I think I miss explained the initial problem. If nothing is found, it does not go anywhere.
If it finds something to display, and the user wants to get back to make a new search, then I want the filter parameters to be restored. I hope it sounds clearer now...
2010 Sep 28 2:15 PM
Your loading of the table should be I, BT, 888, 889....
Suggestion: try reading the tables from the selection-options index 1, at the end of processing or during initialization, to put the data values back into the select-options tables header rows.... this might put them back into the fields on the screen, if your using the old select-options statements and not declaring data...type range of ... etc.
2010 Sep 28 3:33 PM
Formal way to pre-populate select-options is like this:
INITIALIZATION.
S1-sign = 'I'.
S1-option = 'BT'.
S1-low = '888'.
S1-high = '889'.
APPEND S1.
* To avoid extended program check complaint, you might want to do APPEND S1 TO S1.
Proper way to catch user errors is to wait until they execute the program. Pushing a button to validate the user entries is not a common practice in SAP. First of all, none of the SAP's standard programs do that. Secondly, there is no guarantee that users push that button. I understand that it is some times necessary to catch the errors before they submit a background job. However, according to my past experience, it causes other problems. I don't remember the details, though.
2010 Sep 28 3:35 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |