cancel
Showing results for 
Search instead for 
Did you mean: 

Create Excel From Table View in CRM Web ui 7.0

Former Member
0 Kudos

Hi,

I have seen all the blogs for Creating Excel from Web ui.

Sap has give standard functionality to create CSV file from table view.

But My requirement is, when user selects Rows from Table View on web ui Like below:

Say User have selected all the three rows below :

only these row will be taken into internal table as a Row or header and create Excel out of it like below :

company Codealternative meter IdRecorder id

Here the internal table will be dynamic as user can select any number of fields.

Please guide me in this.

Thanks

Sunita.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sunita,

You can redifine method CL_BSP_WD_CONTEXT_NODE_TV->IF_BSP_WD_MODEL_TV_EXCEL_EXPRT~GET_DATA_XML in your model controller as follows:

DATA: lt_config_tab TYPE bsp_dlc_column_descr_tab,
         lr_table_model TYPE REF TO zl_zsample__priceel_cn00,
         lr_col TYPE REF TO if_bol_bo_col,
         lv_string     TYPE string.
   FIELD-SYMBOLS <ls_config_data> TYPE bsp_dlc_column_descr.

* Get configuration data.
   IF iv_config_table IS NOT SUPPLIED.
     lt_config_tab = cl_bsp_dlc_table_utility=>get_table_from_config_xml( iv_config_xml ).
   ELSE.
     lt_config_tab = iv_config_table.
   ENDIF.

   LOOP AT lt_config_tab ASSIGNING <ls_config_data>.

*   Only consider data if it was not removed by personalization.
     IF <ls_config_data>-hidden IS NOT INITIAL.
       DELETE lt_config_tab INDEX sy-tabix.
       CONTINUE.
     ENDIF.

     WHILE <ls_config_data>-name CA '.'.
       SPLIT <ls_config_data>-name AT '.' INTO lv_string <ls_config_data>-name.
     ENDWHILE.

   ENDLOOP.


* Get marked rows and set collection
   lr_col = me->collection_wrapper->get_marked( ).
   lr_table_model = me.
   lr_table_model->set_collection( lr_col ).

* Forward to XML generator.
   rv_content_bin = cl_chtmlb_xml_provider=>get_xml_from_model( it_config      = lt_config_tab
                                                                iv_table_model = lr_table_model
                                                                iv_name        = me->structure_name
                                                                iv_view_controller = iv_view_controller ).

Hope it helps.

Regards,

Eric

Former Member
0 Kudos

Hi Eric,

Thanks for the reply.

I have redefined method IF_BSP_WD_MODEL_TV_EXCEL_EXPRT~GET_CSV

And able to get the Excel in CSV format.

Thanks

Sunita.

Answers (1)

Answers (1)

Former Member
0 Kudos

One Clarification required, what if it displays all the rows,user can hide or delete the fields from EXCEL.

If you would really like to modify, Copy your Tag, Copy the class and assign your own class to your tag.

Then redifine  method as per u r requirement by calling the configuration, then get the selected rows and export it to Excel.

regards,

Charan

Former Member
0 Kudos

Hello Krishna,

How do I export it to Excel. As I have created a dynamic table where is My Rows are converted as Column.

Do we have any direct class? or HTML or Javascript code?

I refererred this PDF by David Lawn, But it has javascript code. in which my onclientclick event is not getting triggered,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3024333a-f9c0-2e10-24a2-b16a42f2d...

Please help me.

/Sunita