Hi welcome !!!
I would like to share the code/logic of method GET_TABLE_DATA of interface IF_WD_TABLE_METHOD_HNDL which helps to read the data from a filtered Table in Web Dynpro ABAP.
I have come across few SCN threads where in the requirement for reading filtered table data is left unanswered, as the method GET_TABLE_DATA( ) is not available in interface IF_WD_TABLE_METHOD_HNDL in their systems. I think the method GET_TABLE_DATA is available from SAP_ABA 731.
So, it might be useful if the logic to read the data from a filtered table is available for all.
Create below method.
IO_TBL Importing type ref to CL_WD_TABLE
METHOD get_table_data .
Let us say, we have created the above method GET_TABLE_DATA in component controller of WD component.
Please refer to the below steps to read data from a filtered table
- Go to attributes tab of view and create an view attribute GO_TBL of type ref to CL_WD_TABLE
- Go to method WDDOMODIFYVIEW( ) and write the below logic to get the reference of table ui element “MY_TABLE“
METHOD wddomodifyview . IF first_time = abap_true. "Note: my_table is the ui name of table in view layout wd_this->go_tbl ?= view->get_element( 'MY_TABLE' ). ENDIF. ENDMETHOD.
- Now, to read data from filtered table, use the below code
data lt_data type WDR_TABLE_ROW_DATA_TAB. wd_comp_controller->get_table_data( exporting io_tbl = wd_this->go_tbl receiving rt_data = lt_data ).
Thank you for your time and hope content of this blog was helpful.
Your comments / Feedback / suggestions are highly appreciable & always welcome 🙂 🙂 🙂