Skip to Content
author's profile photo Former Member
Former Member

Create Excel From Table View in CRM Web ui 7.0


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 Code alternative meter Id Recorder id

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

Please guide me in this.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2012 at 04:44 PM

    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 ).
    lt_config_tab = iv_config_table.

    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.

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


    * 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.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 02, 2012 at 04:52 PM

    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.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.