on ‎2006 May 02 9:58 PM
Hi,
I have a silly question..
Is it possible to dynamically declare a variable based on the contents of a parameter...like:
Tables: RSDUPD.
Parameter: p_Daty like RSDUPD-DATU
Data: l_last_day like (p_Daty)
Thanks
Request clarification before answering.
Use this syntax:
CREATE DATA l_last_day TYPE (p_daty).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok....thanks for the answer but its time to make the question harder.
I have the following code:
DATA: it_query_results TYPE REF TO data.
PARAMETER: prxy_cls(30).
CREATE DATA it_query_results TYPE STANDARD TABLE OF (prxy_cls).
ASSIGN it_query_results->* TO <l_it_query_result>.
....I do all sorts of processing with <l_it_query_result>.....then
CALL METHOD o_query_result->execute_asynchronous
EXPORTING
output = <l_it_query_result>.
only problem is method execute_asynchronous doesnt expect a type ref and only expects table type ZBWCOPA9030V00_QUERY_RESULT1...which is what I am entering in the parameter prxy_cls..
need help badly..
thanks
To the best of knowledge, if you are calling a function module or method, and that method expects the parameter/table of a particular type, then you have to stick to that type. In only one situation it could have worked had the method you are using been having parameter/table with no type attached.
So if you using issues facing issues with that field-symbol in case of calling function/method, just declare a parameter/table of that type, pass your data from the field-symbol to that and call the function/method.e.g.
1. DATA: t_temp_table type <whatever type the method expects>.
2. Pass data from <l_it_query_result> to t_temp_table .
3. Call method.
For all other purposes internal to your program, the field-symbol <l_it_query_result> should work fine.
Please let me know if this helps.
Hi,
As the specific PROXY / function expects parameter of a specific type there is not much we can do there. What you can do, is to declare a variable of the same type as that of the PROXY parameter, move the value of the dynamic vairable into that and then pass that variable to the PROXY.
Regards,
Ravi
Note : Please mark the helpful answers
Thanks all,
I have resorted to writing different programs for different proxy classes.
I wanted to get the name of the proxy class as varible and then exceute the appropriate ones....but because of the type casting problems it seems that all I can do is do data declaration for all the classes and then use case statement to choose the right one based on the parameter.
On top of this there is the issue with the class parameter which expects a specific data type so I will have to follow the same logic as above.
So its no use....I finally written different programs for different proxy classes
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.