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: 

SAP icon to represent .zip or .txt file?

Former Member
0 Kudos
751

Hi,

I have not been able to find an SAP icon that represents a zip file, a text file (.txt) or a .png file. I used transaction code 'ICON' to view all of the SAP icons but there is nothing there that meets my requirement.

Anyone have any tips? Is what I'm asking or even possible? Can we import icons into SAP?

Thanks,

Jennifer

1 ACCEPTED SOLUTION

Former Member
0 Kudos
177

Hi,

you can import icon using Tcode se78.Goto tcode se78 click on graphics general -> select bitmap images -> provide image name -> select color image -> through import icon u can import new image by providing details .

6 REPLIES 6

Former Member
0 Kudos
177

Hi Jennifer,

You can upload any image file ( eg .png) to se78 and you can use it in any of ur ABAP development. For that you can follow these steps.

1. get_bds_graphic_as_bmp Method call for transfering image from se78 to a hexadecimal string.

2. Then you have to trace the image according to VGA standard for showing it in the screen.

3. Next step is to put your image to an internal table for converting it into a URL use FM DP_CREATE_URL.

4. URL is nothing but your image link.

5. The final step is to create a container to hold your image and then give your image URL to your container using load_picture_from_url

Here is a sample code and please go through the comments , then change according to your requirement , also try google for more examples on these FMs which will be more helpful .

Think that this will solve your problem and if any issues please do post.

Thanks,

Benson

method call for transfering image from se78 to a hexadecimal string.

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp

EXPORTING

p_object = 'GRAPHICS'

p_name = '11'" IMAGE NAME - Image name from SE78

p_id = 'BMAP'

p_btype = 'BCOL' " (BMON = black&white, BCOL = colour)

RECEIVING

p_bmp = lv_graphic_xstr

EXCEPTIONS

not_found = 1

OTHERS = 2.

if sy-subrc ne 0.

MESSAGE i011(zror)."image not found

endif.

gv_graphic_size = XSTRLEN( lv_graphic_xstr )."assigning image size

CHECK gv_graphic_size > 0."check for trace of image in VGA standard

lv_graphic_conv = gv_graphic_size.

lv_graphic_offs = 0."assigning offset value

WHILE lv_graphic_conv > 255." checking for retrace of image and giving to workarea ,255 is the pixels for VGA standard

wa_graphic_table-line = lv_graphic_xstr+lv_graphic_offs(255).

APPEND wa_graphic_table TO it_graphic_table.

lv_graphic_offs = lv_graphic_offs + 255.

lv_graphic_conv = lv_graphic_conv - 255.

ENDWHILE.

assigning the offset value and image to workarea.

wa_graphic_table-line = lv_graphic_xstr+lv_graphic_offs(lv_graphic_conv).

APPEND wa_graphic_table TO it_graphic_table.

function call for creating the url for image

CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

type = 'image' "#EC NOTEXT

subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'

size = gv_graphic_size

lifetime = cndp_lifetime_transaction "'T'

TABLES

data = it_graphic_table

CHANGING

url = graphic_url

EXCEPTIONS

  • dp_invalid_parameter = 1

  • dp_error_put_table = 2

  • dp_error_general = 3

OTHERS = 4 .

IF sy-subrc NE 0.

MESSAGE i011(zror)." image not found

EXIT.

ENDIF.

  • Create a container to hold your image.

CREATE OBJECT ob_container2"object for container

EXPORTING

container_name = 'CONT2'.

CREATE OBJECT ob_picture"object for image

EXPORTING

parent = ob_container2.

method for putting image in container.

CALL METHOD ob_picture->load_picture_from_url

EXPORTING

url = graphic_url

IMPORTING

RESULT = g_result.

0 Kudos
177

Thank you for the reply and code suggestion.

My real requirement is to display this new icon (or bmp image) within an ALV grid. I have seen many examples online on how to add a logo to the top of the ALV grid report.

We have a report that displays an ALV grid. Each row in the grid displays the infomation pertaining to a BDS document (file name, file type, size, etc). One of the columns displays the SAP icon that goes with the document type.

My requirement is to display a custom icon for those documents where there is no SAP icon (i.e. zip files, txt files, png files).

Would this be possible?

Thanks,

Jennifer

0 Kudos
177

Jennifer, if I may ask a dumb question...what does an ICON tell your user that a three-character value, like 'ZIP', 'TXT', 'PDF', 'PNG', does not? For your users, is it a question of just being cute and looking like MicroSoft? Or some real, valid business reason?

I'm trying to think of how I could come up with an ICON that clearly and decisively denotes TXT as opposed to PNG or RTF or ?? To me, the three letters for the file extension are what I report for my archived docs, and that makes it easy to retrieve and send to desktop and call the frontend execute....

When my users demand an icon for something that is not obvious, I show them the list in table ICON and tell them to pick out which ones they want to use for their particular button or whatever. It's then their choice, not mine...

There are, of course, of few icons for file types, but your post implies that you've already found and reviewed those.

0 Kudos
177

Completely agree. In fact, while you were writing this answer, I was contacting my functional designer and suggesting the same thing.

If document type eq 'TXT' then use SAP icon ICON_DISPLAY_TEXT.

If document type eq 'ZIP' then use SAP icon ICON_FOLDER.

If document type eq 'PNG' then use SAP icon ICON_GIF or ICON_BMP.

If document type eq 'WAV' then use SAP icon ICON_VOICE_OUTPUT.

If document type eq 'AVI' then use SAP icon ICON_VIDEO.

If document type eq 'XPS' then use SAP icon ICON_FAX.

We can only go so far with certain user request.....

Thank you very much,

Jennifer

Former Member
0 Kudos
178

Hi,

you can import icon using Tcode se78.Goto tcode se78 click on graphics general -> select bitmap images -> provide image name -> select color image -> through import icon u can import new image by providing details .

Former Member
0 Kudos
177

Hi,

you can import icon using Tcode se78.Goto tcode se78 click on graphics general -> select bitmap images -> provide image name -> select color image -> through import icon u can import new image by providing details .