on 12-16-2008 5:48 PM
Is there an easy way to get the data in an WD ALV as internal table. I have checked the interface but failed in order to find some appropriate method.
Or is the only way to do it via the context binding. Basically I'd like to get the data as displayed in the ALV (sorted...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At least somebody who has the same request I am no longer alone...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have this same question, maybe some of our SAP experts can help us w/ this question? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Word, in order to create mail merge functionality. Sorry for the delay due to XMAS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for your kind feedback. However, obviously I did not make my point clear.
What I would like to access is the data in the rows and columns as displayed (WYSIWYG) in the ALV. I do know how to sort an ALV.
The idea is to export the data as displayed in the ALV to a certain file format. Surely I can access the data via the context (providing the data for the ALV). But this retrieves me only the data as "raw" data, so not dates formated and no fixed values resolved. Also this does exclude filtering, the ALV configuration or sorting in the ALV.
So basically it would be fine to find a way to an itab representing the ALV values as string values perfectly as I do see it one the screen.
Edited by: Hork Tsue on Dec 18, 2008 7:41 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hork,
Which particular file format do you want to save the ALV contents into? Just asking this coz as ALV does already provide the Export to excel functionality by default and this would help you get the data in your desired manner. It would even take into consideration the filtering & sorting done on the ALV by the user.
Regards,
Uday
Hi Hork,
You need to use the create_sort_rule method of if_salv_wd_sort for achieving this sorting functionality. Refer to the code snippet below which am using inside the WDDOINIT method to sort the SEATSOCC field by descending order.
Regards,
Uday
METHOD wddoinit .
* Create component usage for alv component
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
" Create instance of component usage
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
* Get config model
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model( ).
* Sort rows by seatsocc descending
DATA: lr_field TYPE REF TO cl_salv_wd_field.
lr_field = l_value->if_salv_wd_field_settings~get_field( 'SEATSOCC' ).
lr_field->if_salv_wd_sort~create_sort_rule( sort_order =
if_salv_wd_c_sort=>sort_order_descending ).
ENDMETHOD.
Or else you can do it the lame way of sorting the internal table by the desired field before you bind it to the context node. This way the ALV would display the data in sorted manner.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in salv_wd_table....
we have method GET_MODEL---->Returns Standard Execution of ALV Configuration Model..
get_model consist of
table settings...
column settings etc...
use column settings u can sort the table ....
do coding in initialization(wd_init) method...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.