If you want a start date and end date, it is a mistake to use a select option. It's a mistake often made by functional consultants as well. I've even challenged functional guys and they've insisted "no, I want a select option". When I've taken them through the requirement, they realise that they don't actually want a select option, they want a date range.
The reason it's a mistake is that the structure of a select option (an internal table with header line) is:
That means the user can enter all sorts of weird and wonderful combinations of selections, ranges and exclusions - and your code won't be able to handle it properly. What will you do if the user enters?
The user wants January 2013 and 2014, but not the second of January. But many date handling and validation routines, will fail with this selection. The user doesn't get what they expect.
Not infrequently, the specification will ask for special handling of an empty selection - something like "if the select is blank, then select nothing". This is also a mistake. An empty select option in standard SAP throughout the SAP system means "select everything". If you follow the functional consultants request, you've broken the expected functionality for the user.
Far better (and what most SAP programs do, where they really just want a start and end date) is to simply use:
PARAMETERS: start TYPE d, end TYPE d.
This solution satisfies the actual requirement 99% of the time, and makes your program behave in an expected way.
For the second error, use a checkbox next to the select option to specify whether to use the select option in the data seletion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |