on 02-24-2014 11:21 AM
Hello,
I am adding additional columns in a table in WDA. I am facing problem in binding that internal table containing values with the existing table
I am using BIND_TABLE() method and it is giving appropriate results first time ..
But it is giving me an error message as " invalid operand type for the move-corresponding statement in get_static_attributes() " where get_static_attributes() is a standard method, when i scroll down in the table to see entries below (since all rows are not visible in one view, I have to scroll down to see other entries)
I have attached my code below, request you to kindly review the code and suggest any changes to resolve the issue.
DATA: lo_nd_tree_nodes TYPE REF TO if_wd_context_node.
DATA it_table_data TYPE wd_this->elements_tree_nodes.
lo_nd_tree_nodes = wd_context->get_child_node( wd_this->wdctx_tree_nodes ).
lo_nd_tree_nodes->BIND_TABLE( it_table_data ). " it_table_data contains the entire table columns alongwith the added columns having data.
This error comes because the get_static_attributes() method gives structure type output but in BIND_TABLE() method i am giving input type as table bcoz BIND_TABLE() method only takes table as input. So, there is a structure mistach causing the error.
So how will i bind the table bcoz i don't have to bind a single row of a table but all the rows (for the columns added) of the entire table..
Your valuable inputs will be rewarded appropriately.
PS: We are currently working on cProject 4.5 application (WebDynpro Application)
We are using table view in cProject and want to add some additional columns in existing view.
Thanks and Regards,
Mayur
Hello All,
Thank you very much for attempting to solve my problem.
However I have solved it myself using method UPDATE_CONTEXT_AND_TABLE_DATA() provided in component controller instead of BIND_TABLE().
Best Regards,
Mayur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,,
this link might be useful according to ur requirement
How to arrange the new table column in the Table with columns - Web Dynpro ABAP - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Naveen,
Thanks for replying.
I have already created the columns in my table.
I need to fill in the data in those columns which are from different db tables.
But in my case it is giving me the output once ....only when i am scrolling down in case of large number of rows , it is giving me this error (dump).
Best Regards,
Mayur
Hi Patil,
structure of the node and structure of the internal table or workarea should be same.
eg:
if the node 'TABLE' has 8 attributes then local table 'LT_TABLE' shuld be type of node 'TABLE' . else you may get run time error as mentioned.
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for replying...
If my table structure would be different the it will not bind the table even once.
But in my case it is giving me the output once ....only when i am scrolling down in case of large number of rows , it is giving me this error (dump).
The reason behind the error is that due to get_static_attributes() method in standard code....it is not able to convert table into structure ... as get_static_attributes() method only takes structure as input whereas bind_table() method takes table as input..
My question is that in this scenario hw shud i bind my table then ...so that after scrolling also it should not give error instead populate the data with new entries.
Best Regards,
Mayur
Hello Rama,
Thanks for replying.
I have written my code in post enhancement method in Modify View.
So according to the sequence of method call----
1. init() method
2. modifyview() method
3.scroll() method (in case of scrolling)
So before scrolling the modifyview is called and my code is executed. And i get the error in get_static_attributes() method which is present in scroll() method.
I have to write my code in modify view only so that the data is visible.
Best Regards,
Mayur
Hello Rama,
Below is the code for scroll() method ...
DATA:
lt_table_data TYPE dpr_tt_ui_table_data,
ls_table_data TYPE dpr_ts_ui_table_data,
lv_lines TYPE i.
* trigger changemanager
cl_dpr_ui_event_source=>start_report_change_events( ).
wd_comp_controller->set_visible_rows( ).
* For safety reason add 2 lines to max visible lines
lv_lines = wd_comp_controller->MV_VISIBLE_ROW_COUNT + 2.
* sy-index = wd_comp_controller->mv_last_visi_row + 2.
wd_comp_controller->UPDATE_ROWS_FROM_ELEMENT(
exporting ir_element = wd_comp_controller->mr_selected_element
iv_element_index = wd_comp_controller->mv_first_visi_row
iv_lines = lv_lines ).
Inside this wd_comp_controller->UPDATE_ROWS_FROM_ELEMENT another method is called , get_static_attributes() which is pasted below.
ir_element->get_static_attributes( IMPORTING static_attributes = ls_table_data ).
This get_static_attributes() method is giving dump bcoz as u can see it is importing ls_table_data which is a structure of type dpr_ts_ui_table_data ..... whereas in my bind_table() method i have table having same structure.
data: it_table_data TYPE TABLE OF dpr_ts_ui_table_data.
lo_nd_tree_nodes->BIND_TABLE( it_table_data ). " it_table_data contains the entire table columns.
Best Regards,
Mayur
Hi Mayur,
ir_element->get_static_attributes( IMPORTING static_attributes = ls_table_data ).
The above statement always gets the data of only selected row / single row. Hence ls_table_data is fine here.
Problem: I think, the type of LS_TABLE_DATA is not having the columns you have added in.i.e. the data we are receiving from get_static_attributes( ) method and ls_table_data is mismatch.
Please check for the above point. and place the debugging point at get_static_attributes( ) and check the below points
If issue is still there, pls share, the declaration part of ls_table_data.
Regards,
Rama
Hello Rama,
As during debugging my control is not going inside the implementation of get_static_attributes() method
so instead of binding the entire table i have read the table in work-area and tried to set one row :-
READ TABLE it_table_data INTO wa_table_data index 1.
lo_nd_tree_nodes->SET_STATIC_ATTRIBUTES( wa_table_data ).
In this case only first row of my alv is getting populated with data in additional columns as i have only read first row.
I am also not having any problem while scrolling also. This means that my number of columns are same otherwise it would have not populated even one single row due to column mismatch.
The problem is coming in case i bind the entire table using bind_table() method.
Instead of bind_table() method i have even tried bind_elements() method....it is also giving same error while scrolling.
I have pasted you the code inside the get_static_attributes() method :-
field-symbols:
<values> type data.
assign me->static_attributes->* to <values>.
move-corresponding <values> to static_attributes. (LINE WHERE ERROR IS COMING)
here static_attributes is also of type DATA.
Best Regards,
Mayur
the safest approach is always to use the same structure in program as is in the context. Once you have everything bound to the DDIC, you should map the it_table_data to the structure of it. This should be ok in your program.
But as I see your data is named "elements_tree_nodes". If you are using an alv tree, then you should use a different approach for the binding part - search for webdynpro tree here, you will find more examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jozef,
Thanks for replying.
i have even tried using structure dpr_ts_ui_table_data , in which i have added my additional columns.
data: it_table_data TYPE TABLE OF dpr_ts_ui_table_data.
If my table structure would be different the it will not bind the table even once.
But in my case it is giving me the output once ....only when i am scrolling down in case of large number of rows , it is giving me this error (dump).
The reason behind the error is that due to get_static_attributes() method in standard code....it is not able to convert table into structure ... as get_static_attributes() method only takes structure as input whereas bind_table() method takes table as input..
My question is that in this scenario hw shud i bind my table then ...so that after scrolling also it should not give error instead populate the data with new entries.
Best Regards,
Mayur
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.