on 2012 Sep 24 12:05 PM
Hello,
i am calling a method that has one exporting parameter with type ANY TABLE.
My problem is that abap won't let me activate the code because of the incompatible actual parameter:
data: lt_dynamic type ref to data,
lo_node type ref to if_wd_context_node,
field-symbols: <ls_dynamic> type any table.
* create data lt_dynamic type ?
lo_node->get_static_attributes_table( importing table = lt_dynamic ). <-- not activating
lo_node->get_static_attributes_table( importing table = <lt_dynamic> ). <-- activating but the field symbol is not assigned
I need the reference of the table "table" of the method "get_static_attributes_table" in this example.
Regards
Ioan.
Request clarification before answering.
You're correct that you can't create & assign a field of type 'ANY TABLE'. You have to know what type of data to create, and then assign it to your field symbol.
I did a quick where-used on the interface of that method, and it looks like the type of that table depends on the element which that node represents. So for example when the node has name 'EXTR_SELECT_TABLE' the type of the table passed into the method is if_main_view=>element_extr_select_table. It appears that each application will know the proper type for the element node that it's working with, so I think you'll need to roll up your sleeves and do some reverse-engineering to find out what type your table needs to be. The good news is if you're only working with a single static element node, you can just declare your table of the correct type using the DATA keyword. You won't have to use pointers/field symbols/references.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
i just found out, what i am trying i not possible. The method GET_STATIC_ATTRIBUTES_TABLE also uses the exporting parameter to determine the type of the table .
And generally i don't think that this is possible. The <lt_dynamic> field symbol has to be assigned and for that you need a variable/memory area, that can store any table. I don't have too much time now to look but in my opinion is not possible ... for now at least
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 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.