2007 Apr 24 4:55 PM
Hi folks!
I have a simple Z table (say ZTABLE) and a Z view based on it with some related description (say ZVIEW). The ZTABLE has a DEC field (called COEF) with 2 decimals and it should have only numbers between 0 and 1.
I set the valid interval from 0 to 1 but, as help says, it's only checked for CHAR, NUMC, DEC, INT1, INT2 and INT4 data types. Not for DEC.
Then I use an event on ZVIEW. On SE11 I went to "Table maintenance generator" - Environment - Modification - Events. So there I put the 05 event (Creating a new entry) and I programed the check. It works fine for new entries, but if you have a record on table and you want to change the COEF field you can put there any number, even outside the 0-1 range.
I tried with the 01 event (Before saving the data in the database) but it seams to be called only for last record.
Could anybody tell me what can I do?
Thanks!
2007 Apr 24 5:00 PM
Hi,
Since it is a Z TABLE..
You can directly modify the flow logic in SE51.
Go to SE51
Give the program name - SAPL + Function group name
Screen number
Press change..
In the flow logic..
Add a module after the FIELD ztable-number, in the PAI event..
Ex..
FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
And in the module validate the number..
MODULE NUMBER_CHECK INPUT.
IF ZTABLE-NUMBER <> '0' OR
ZTABLE-NUMBER <> '1'.
MESSAGE E208(00) WITH 'Not a valid number'.
ENDIF.
ENDMODULE.
Thanks,
Naren
Hi folks!
I have a simple Z table (say ZTABLE) and a Z view based on it with some related description (say ZVIEW). The ZTABLE has a DEC field (called COEF) with 2 decimals and it should have only numbers between 0 and 1.
I set the valid interval from 0 to 1 but, as help says, it's only checked for CHAR, NUMC, DEC, INT1, INT2 and INT4 data types. Not for DEC.
Then I use an event on ZVIEW. On SE11 I went to "Table maintenance generator" - Environment - Modification - Events. So there I put the 05 event (Creating a new entry) and I programed the check. It works fine for new entries, but if you have a record on table and you want to change the COEF field you can put there any number, even outside the 0-1 range.
I tried with the 01 event (Before saving the data in the database) but it seams to be called only for last record.
Could anybody tell me what can I do?
Thanks!
2007 Apr 24 5:00 PM
Hi,
Since it is a Z TABLE..
You can directly modify the flow logic in SE51.
Go to SE51
Give the program name - SAPL + Function group name
Screen number
Press change..
In the flow logic..
Add a module after the FIELD ztable-number, in the PAI event..
Ex..
FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
And in the module validate the number..
MODULE NUMBER_CHECK INPUT.
IF ZTABLE-NUMBER <> '0' OR
ZTABLE-NUMBER <> '1'.
MESSAGE E208(00) WITH 'Not a valid number'.
ENDIF.
ENDMODULE.
Thanks,
Naren
2007 Apr 25 7:21 PM
It worked well! Thanks!
But I have a little more question to understand exactly what I did:
On this example whats the difference between doing this?:
FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
and doing this?:
FIELD ZTABLE-NUMBER.
MODULE NUMBER_CHECK.
The MODULE should be on the last screen field or on the field I want to check? On my example the last one is the field to check.
Very thanks again!
2007 Apr 27 7:39 PM
Hi,
The difference between
FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
FIELD ZTABLE-NUMBER.
MODULE NUMBER_CHECK.
Is if there is any error in the field..
The second will block all the fields for input..
The first will open the NUMBER field for input and block all the other fields..
Thanks,
Naren
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |