Application Development and Automation 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: 
Read only

Message display

Former Member
0 Likes
3,379

Hello all,

I want to display icons in my message.

For ex. Message is 'Entries with ICON can not be selected'.

Here on ICON place i want to display the actual icon.

Could u plz help me on this?

thanks,

regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,354

Hi,

Only MESSAGE TYPE I (Information) you can pass icon.

Here is the piece of code.

INCLUDE <ICON>.

DATA : V_ICON TYPE ICON-ID VALUE '@0P@'.

MESSAGE I001(00) WITH V_ICON.

Hope this will help you.

Regards,

Smart Varghese

12 REPLIES 12
Read only

Former Member
0 Likes
2,354

have a look at :

Read only

Former Member
0 Likes
2,354

chk the icon table.

SELECT SINGLE id

FROM icon

INTO v_val

WHERE name = (the name u nerd to get).

and pass this by concatenating.

Read only

Former Member
0 Likes
2,354

This message was moderated.

Read only

0 Likes
2,354

You should give the reference of [this|http://www.erpgenie.com/xi/833-abap-code-to-display-sap-icons?format=pdf] document instead of pasting the code!

Read only

Former Member
0 Likes
2,354

Hi,

Just check this code and you will understand.


DATA : icon TYPE icon.


SELECT SINGLE * FROM icon INTO icon WHERE name = 'ICON_MATERIAL'.
IF sy-subrc EQ 0.
  MESSAGE i001(00) WITH icon-id.
ENDIF.

Regards,

Ankur Parab

Read only

Former Member
0 Likes
2,354

Hi,

Try This.

DATA : g_ques(80) TYPE c,

g_ans(1) TYPE c.

CLEAR: g_ques, g_ans.

g_ques = text-013. "Do you want to save data?

PERFORM get_confirmation

USING g_ques

CHANGING g_ans.

FORM get_confirmation USING g_ques TYPE any

CHANGING g_ans TYPE any.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

titlebar = text-015

text_question = g_ques

text_button_1 = text-006

icon_button_1 = 'ICON_OKAY' " Icon as per req.

text_button_2 = text-007

icon_button_2 = 'ICON_CANCEL' " Icon as per req.

default_button = c_one

display_cancel_button = ' '

IMPORTING

answer = g_ans

EXCEPTIONS

text_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF g_ans <> c_one.

MESSAGE i000(zps_msg_01) WITH text-016. "Action Cancelled by User

ENDIF.

ENDFORM.

Read only

Former Member
0 Likes
2,355

Hi,

Only MESSAGE TYPE I (Information) you can pass icon.

Here is the piece of code.

INCLUDE <ICON>.

DATA : V_ICON TYPE ICON-ID VALUE '@0P@'.

MESSAGE I001(00) WITH V_ICON.

Hope this will help you.

Regards,

Smart Varghese

Read only

Former Member
0 Likes
2,354

Hi,

Follow the code along with threads,...and search fm: iconcreatemessage*.

include <icon>.

tables: icon.

data: v1 type icon-id.

v1 = '@00@'.

message e001(znaveen) with v1.

Naveen M.

Read only

Former Member
0 Likes
2,354

Query extended

Read only

Former Member
0 Likes
2,354

Hi all.

I am fine with displaying icon in the message.

Further, i am facing a few difficulties as below:

1. more than one icon cannot be displayed in a single message.

2. when displaying, icon has to be at first position.

More expressively, icon first and then the text can be displayed.

But, text first and then the icon cannot be.

Suggestions appreciated.

Regards,

Prati

Read only

Former Member
2,354

Hi Prati,

Please keep these points.

1. Message should be of type I (Information).

2. The ICON should be the first part of the message.

i.e. MESSAGE I001(00) WITH V_ICON (Icon variable) V_MESSAGE (The message text).

3. We cannot CONCATENATE the V_ICON and V_MESSAGE as it will never give the ICON

instead its value.

Regards,

Smart Varghese.

Read only

0 Likes
2,354

Hi,

thanks for reply.

Is there any other way to do this i want my message to display like this:

'Entries with ICON1 or ICON2 can not be selected.'

thanks,

regards.