‎2005 Sep 14 3:53 PM
All,
When I create a select-option in my program like:
SELECT-OPTIONS: s_role FOR AGR_DEFINE-AGR_NAME.
It does not work. To make it work I need to define AGR_DEFINE with the tables statement.
My question is why? In my opinion I just make a reference to a dictionary object. The tables statement is more or less used to create a headerline for a used database table. I don't see any relation in that. Still it is needed to make it work. Any ideas?
‎2005 Sep 14 3:58 PM
Hi,
You can make it works in the folling way.
data ZAGR_DEFINE type AGR_DEFINE.
SELECT-OPTIONS: s_role FOR ZAGR_DEFINE-AGR_NAME.
or
data ZAGR_NAME type AGR_DEFINE-AGR_NAME.
SELECT-OPTIONS: s_role FOR ZAGR_NAME.
Svetlin
Message was edited by: Svetlin Rusev
‎2005 Sep 14 3:58 PM
Hi,
You can make it works in the folling way.
data ZAGR_DEFINE type AGR_DEFINE.
SELECT-OPTIONS: s_role FOR ZAGR_DEFINE-AGR_NAME.
or
data ZAGR_NAME type AGR_DEFINE-AGR_NAME.
SELECT-OPTIONS: s_role FOR ZAGR_NAME.
Svetlin
Message was edited by: Svetlin Rusev
‎2005 Sep 14 4:00 PM
Ok, that's a new solution. Still I can't understand why I have to declare the table in order to make a select-option with reference to a dictionary-object.
‎2005 Sep 14 4:07 PM
Hi
Because the system gives some dictionary characteristics of table field, as search help (for example).
Max
‎2005 Sep 14 4:07 PM
This has been the syntax for select-options since the begining. You need the definition of 'FOR' defined before you use it in the select-option.
I guess the interpreter/compiler was designed to understand and inherit the properties of the referred field if you use 'LIKE' or 'TYPE' but not when you are using 'FOR'. Since the LOW and HIGH fields of the select-option inherits the properties of the 'FOR' field, the properties of it are needed to be defined before. Why, I still don't know, but that is the design.
For some strange reason, SYST(or SY) fields reference will work even if you don't define them before. Is there a clue here? System structure/fields seem to be available for referencing but not static database table fields.
Regards,
Srinivas
‎2005 Sep 14 4:07 PM
The answer can be that you are not referencing the field to do this you use the statement LIKE
‎2005 Sep 14 4:36 PM
Thank you all for the quick and usefull replies. I guess it's just designed this way and has to do with the way the interpreter works. From a conceptual point of view however it still does not make much sense to me.
‎2005 Sep 14 3:59 PM
try this..
data: w_role type agr_name.
SELECT-OPTIONS: s_role FOR w_role.
good Luck,
Suresh Datti