cancel
Showing results for 
Search instead for 
Did you mean: 

How to call manually Export to Excel event of ALV standar component

former_member189690
Participant
0 Kudos

Hi gurus,

I want to call manually Export to excel standar event within my wda application but I don't know which is the way to do it?

Is there any place to call it directly? Example: draw a custom button that calls Expor standar function pressing on it...

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member189690
Participant
0 Kudos

thx!

former_member610985
Participant
0 Kudos

Hi All,

I too face the same problem (getting null exception) as mention by devasarathy. Please any one helo me in resolving the issue. Devasarathy please let me know if you find any solution for this.

Regards,

Arun

Former Member
0 Kudos

Hi,

       I am facing the same problem which you was, please help me if you come with a any solution for this.I want to add my custom header on the ALV after downloading it into excel sheet.

Thanks and regards,

Mandar Gavkar

ChrisPaine
Active Contributor
0 Kudos

Hello,

have a look at my blog -

[Using WD ABAP ALV export - the hacked way|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/19646] [original link is broken] [original link is broken] [original link is broken];

this give you a code example of how to call the ALV Excel export functionality from a button other than the standard ALV export one. (you don't even need to be displaying an ALV table in your app).

Hope this helps,

Chris

former_member189690
Participant
0 Kudos

Hi Chris,

Is this source code able to create a .XLS file?

Thanks!

ChrisPaine
Active Contributor
0 Kudos

It creates an XML Excel file. Which is exactly what the standard ALV component does - it reuses the standard ALV functionality to create the file.

The XLS format is not open - you need to licence technology from Microsoft to create XLS files. The newer XLSX format is open and there is work currently happening to allow exporting and even importing in that format.

Cheers,

Chris

former_member189690
Participant
0 Kudos

Thank you for your reply, but I have an error on your source code while I'm trying to call get_interface method at this point:

  • get a reference to the interface for updating details of the ALV table

lo_interface = lo_component->if_salv_wd_component_table~get_interface( ).

The following syntax error appears:

Class CL_SALV_WD_C_TABLE does not contain an interface IF_SALV_WD_COMPONENT_TABLE ...

How can I get the interface?

I don't understand if the source code is wrong, or we are working on different releases...

Can you help me?

Thanks a lot...

Former Member
0 Kudos

Hello,

I am not sure why you are getting that syntax error. But have a look at the method IF_SALV_WD_COMPONENT_TABLE~GET_INTERFACE in the class CL_SALV_WD_C_TABLE using transaction se24.

you should be able to find the method there and the return parameter of that method is of type IF_SALV_WD_COMP_TABLE_IF.

Please check if your declarations and usage is proper.

Hope this helps!

Regards,

Srilatha

former_member189690
Participant
0 Kudos

Hi,

I'm 100% sure there is no method with GET_INTERFACE name, neither IF_SALV_WD_COMPONENT_TABLE interfase, I type the methods inside class CL_SALV_WD_C_TABLE:

IF_SALV_WD_COMPONENT~ADD_COMPONENT_USAGE

IF_SALV_WD_COMPONENT~BEFORE_NAVIGATION

IF_SALV_WD_COMPONENT~CREATE_COMPONENT_USAGE

IF_SALV_WD_COMPONENT~DELETE_COMPONENT_USAGE

IF_SALV_WD_COMPONENT~FIRE_EVENT

IF_SALV_WD_COMPONENT~FREE

IF_SALV_WD_COMPONENT~INIT

IF_SALV_WD_COMPONENT~POST_PROCESSING

IF_SALV_WD_COMPONENT~SET_CUSTOM_CONTROLLER

IF_SALV_WD_COMPONENT~VIEW_BEFORE_ACTION

IF_SALV_WD_COMPONENT~VIEW_GET

IF_SALV_WD_COMPONENT~VIEW_INIT

IF_SALV_WD_COMPONENT~VIEW_MODIFY

IF_SALV_WD_COMPONENT~VIEW_ON_EVENT

IF_SALV_WD_COMPONENT~VIEW_ON_HANDLE_EVENT

IF_SALV_WD_COMPONENT~VIEW_REGISTER

IF_SALV_WD_KAYAK~GET_PDF_XML

IF_SALV_WD_COMP_TABLE_PERS~DELETE

IF_SALV_WD_COMP_TABLE_PERS~LOAD

IF_SALV_WD_COMP_TABLE_PERS~SAVE

IF_SALV_WD_COMP_TABLE_PERS~SAVE_P13N

IF_SALV_WD_COMP_TABLE_PERS~SAVE_AS

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_LIST

IF_SALV_WD_COMP_TABLE_PERS~GET_SCOPE_LIST

IF_SALV_WD_COMP_TABLE_PERS~GET_SCOPE_DEPENDENCY_LIST

IF_SALV_WD_COMP_TABLE_PERS~SET

IF_SALV_WD_COMP_TABLE_PERS~GET_DIALOG_SETTINGS

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_SETTINGS

IF_SALV_WD_COMP_TABLE_PERS~SAVE_PROPERTIES

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_PROPERTIES

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_SAVE_AS

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_DELETE

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_SAVE

IF_SALV_WD_COMP_TABLE_PERS~GET_CONFIG

IF_SALV_WD_COMP_TABLE_PERS~GET_VIEW_FROM_LIST

IF_SALV_WD_COMP_TABLE_PERS~GET_CONFIG_DATA

IF_SALV_WD_COMP_TABLE_PERS~MAP_CONFIG_TO_MODEL

IF_SALV_WD_COMP_TABLE_PERS~SET_START_MODEL

IF_SALV_WD_COMP_TABLE_PERS~SET_VIEW_SETTINGS

IF_SALV_WD_COMP_TABLE_PERS~SET_DIALOG_SETTINGS

IF_SALV_WD_COMP_TABLE_PERS~CLOSE

IF_SALV_WD_COMP_TABLE_PERS~INIT

IF_SALV_WD_COMP_TABLE_PERS~GET_START_MODEL

IF_SALV_WD_COMP_TABLE_PERS~SET_STANDARD_VIEW

IF_SALV_WD_COMP_TABLE_PERS~SET_CONFIG_LOADED

IF_SALV_WD_COMP_TABLE_PERS~SET_VIEW_UI_LIST_CHANGED

IF_SALV_WD_COMP_TABLE_PERS~SET_VIEW_UI_ITEM_CHANGED

IF_SALV_WD_COMP_TABLE_PERS~SET_START_MODEL_FILLED

IF_SALV_WD_COMP_TABLE_PERS~SET_VIEW_LIST_CHANGED

IF_SALV_WD_COMP_TABLE_PERS~SET_VIEW_UI_LIST_CHANGED_P13N

IF_SALV_WD_COMP_TABLE_IF~DATA_CHECK

IF_SALV_WD_COMP_TABLE_IF~GET_DATA_XML

IF_SALV_WD_COMP_TABLE_IF~GET_FILTER_VALUES

IF_SALV_WD_COMP_TABLE_IF~GET_FUNCTION_ELEMENTS

IF_SALV_WD_COMP_TABLE_IF~GET_MODEL

IF_SALV_WD_COMP_TABLE_IF~GET_SERVICES

IF_SALV_WD_COMP_TABLE_IF~GET_UI_INFO

IF_SALV_WD_COMP_TABLE_IF~REFRESH

IF_SALV_WD_COMP_TABLE_IF~SET_DATA

IF_SALV_WD_COMP_TABLE_IF~SET_DATA_XML

IF_SALV_WD_COMP_TABLE_IF~SET_DIALOG_SETTINGS

IF_SALV_WD_COMP_TABLE_IF~SET_END_OF_LIST

IF_SALV_WD_COMP_TABLE_IF~SET_FILTER_VALUES

IF_SALV_WD_COMP_TABLE_IF~SET_FOCUS

IF_SALV_WD_COMP_TABLE_IF~SET_FUNCTION_ELEMENTS

IF_SALV_WD_COMP_TABLE_IF~SET_TOP_OF_LIST

CONSTRUCTOR

GET_CONFIG_CONTROLLER

GET_END_OF_LIST

GET_PARENT_COMPONENT

GET_TOP_OF_LIST

SET_COMPONENT_INTERFACE

SET_CONFIG_LOADED

SUPPLY_DRDN_VALUES

ON_NEW_DATA

ON_NEW_MODEL

Thanks.

ChrisPaine
Active Contributor
0 Kudos

Hmmm, it might be that this is a 7.01 /7.00 difference,

as in my system the method/interface do exist - I'm using NW7.01 SP5

I do see that this interface was created 01.07.2009 - so it's relatively recent - that might explain why it's not available.

What version are you working on?

former_member189690
Participant
0 Kudos

Oh yes, you are absolutely right Chris!

Now, I'm in another customer and I have checked, with 7.01 SP5 method is appearing.

So, when I come back to the customer that has the issue I will tell Administrators to upgrade SAP_BASIS.

I will inform you I can solve the issue.

Thank you Chris.

Former Member
0 Kudos

Hi Chris,

I tried to use your logic as mentioned in your blog but I am getting Null Object reference error in the below line:

lo_interface->set_data(

exporting

only_if_new_descr = abap_false

changing

r_data_source = lo_nd_table ).

Even though this method exists IF_SALV_WD_COMPONENT_TABLE~GET_INTERFACE in the class CL_SALV_WD_C_TABLE and I am using 7.02 release as wel.

Please let me know what is the problem here.

Regards,

Sarathy.

Former Member
0 Kudos

Hi,

       I am facing the same problem which you was, please help me if you come with a any solution for this.I want to add my custom header on the ALV after downloading it into excel sheet.

Thanks and regards,

Mandar Gavkar

Former Member
0 Kudos

you can do:



DATA:

lr_filter                       TYPE REF TO if_salv_wd_std_functions,
lcn_alv                         TYPE REF TO if_wd_context_node,
lr_interfacecontroller          TYPE REF TO iwci_salv_wd_table,
l_value                         TYPE REF TO cl_salv_wd_config_table.

lcn_alv = wd_context->get_child_node( name = if_main_view=>wdctx_alv ). "your main view name and ALV node at the context node"
lr_interfacecontroller = wd_this->wd_cpifc_alv( ). "your ALV name
l_value = lr_interfacecontroller->get_model( ).

IF l_value IS NOT INITIAL.

lr_filter  ?= l_value. 
lr_filter->set_export_allowed( abap_true ).

ENDIF

thanks!

Jason PV