Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading traffic light symbols into xl

0 Kudos

HI everyone,

I displayed traffic lights in alv using cl_gui_alv_grid . when i am trying to downlaod alv output into xl traffic symbols are not coming, instead @09@ values are coming. But i need traffic symbols. plz can anyone help me.

1 ACCEPTED SOLUTION

0 Kudos

Thanks for all the answers. I resolved this issue by using ole.

1.we need to download traffic lights icons into local pc by using "cl_bds_document_set" class

"get_with_files" method.

2.we need to insert icon into xl cell, whenever it going to fill by using "insert" method in ole

11 REPLIES 11

raymond_giuseppi
Active Contributor
0 Kudos

Which tool did you use to download data (Use a html filetype, so Abap will also export some gif from /sap/public/bc/icons (Mime repository) and link to those in the html document that you can open with Excel for example)

p244500
Active Contributor
0 Kudos

Hi,

Kindly look at attached document .

0 Kudos

Thanks for ur response, but in my system in does not show any for mhtml format. it directly file position. soo can u please tell whats the back end behaviour under mhtml format...

p244500
Active Contributor
0 Kudos

Hi,

MHTML (short for MIMEHTML) is a file extension for a Web page archive file format as saved by Internet Explorer. The archived Web page is an MHTML document. Can you share with us how your going to download ? Normaly with ALV grid will enable this fromat .

0 Kudos

Tqs for ur response. can u plz tell me one thing is it possible with ole . if is it then how??

DoanManhQuynh
Active Contributor

For standard ALV, you cant download to excel and its image. you have to handle download event and get the image yourself.

In the BCALV_GRID_04 demo which Nawanandana Edirisinghe mentioned, the light column is defined as exception column then when you download to MHTML, it become image. For exception column code, you can check below blog:

https://blogs.sap.com/2015/02/23/alv-list-output-exception-column/

the behavior when download to MHTML is quite the same with other format:

    cl_salv_bs_lex=>export_from_result_data_table(
      exporting
        is_format            = l_lean_export_format "Here is file format (MTHTML)
        ir_result_data_table = lr_result_data "Here is ALV result data
      importing
        er_result_file       = l_xml "download file in xstring
        et_export_errors     = lt_errors
        es_filename          = l_filename
        es_file_extension   = l_file_extension

raymond_giuseppi
Active Contributor
0 Kudos

Of course it's possible, you will have to first download the icons from SAP mime repository and paste those in the corresponding cells. Try to perform a macro recording when inserting a picture in an excel cell and then convert VBA to Abap.

raymond_giuseppi
Active Contributor
0 Kudos

You could also execute the mhtml export with methods such as

  • cl_salv_ex_util=>factory_result_data_table (if executed out of ALV execution)
  • cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform
  • cl_salv_export_xml_dialog=>execute
  • cl_salv_export_xml_dialog=>download

Perform some trace during an export (or use search tool and where-used search on those methods)

0 Kudos

Can you please send me the sample code for inserting traffic symbols different for every cell.

i mean how to insert perticular image into perticular cell

0 Kudos

Raymond Giuseppi can you please tell how to download icons

0 Kudos

Thanks for all the answers. I resolved this issue by using ole.

1.we need to download traffic lights icons into local pc by using "cl_bds_document_set" class

"get_with_files" method.

2.we need to insert icon into xl cell, whenever it going to fill by using "insert" method in ole