2014 Jan 09 10:39 AM
Dear Experts,
I am doing an report program. In that program I am using some text symbols and call to these text symbols to display the texts in output.
My requirement is, I gave the symbol number as 511 and I need to put some green color icon in text,So that when I use symbol number 511 that green should come in the out put.
Actual requirement is, from the out put screen, When I ll press PROCESS button, a document number will generate and if that document number is available in my Ztable, then in a pop screen it show like [ <green icon>This document is already available ]means text must be after that <green icon>.
Below is the egample...
Symbol Text
511 ...
in output popup it ll show like....
... This document is already available.
Regards,
Ajit Sarangi
2014 Jan 09 10:51 AM
My question is in the place of text how I ll put that green symbol icon ?
2014 Jan 09 10:53 AM
Hi,
I don't understand your problem ..
you don't know how to write icon ? WRITE ... AS ICON .. and see the trans. ICON to get the right name
you don't know how to write icon in your pop-up ?
regards
Fred
2014 Jan 09 11:30 AM
@Girod,
I know the syntax for icon. But my problem is I want a symbol number as mentioned above, and when I call that number in my program that Green-ICON, Should come with the text in the popup screen, like...
... This document is already available.
Regards,
Ajit
2014 Jan 09 2:08 PM
Try write this into your text symbol text-511 (without double quotes):
"@08@ Your text"
@08@ is ID of green light icon from ICON table.
2014 Jan 09 7:02 PM
Hi Ajit,
Kindly find the sample code.
type-pools: slis.
include <ICON>.
TYPES : BEGIN OF ty_output,
icon TYPE char4,
f2 type string,
end of ty_output.
data: i_output TYPE STANDARD TABLE OF ty_output,
w_output type ty_output,
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
w_output-icon = icon_green_light.
w_output-f2 = 'Hi'.
append w_output to i_output.
clear: w_output.
*w_output-f1 = 2.
*w_output-f2 = 'Hi Hi'.
*append w_output to i_output.
*clear: w_output.
CLEAR ls_fieldcat.
ls_fieldcat-row_pos = '1'.
ls_fieldcat-col_pos = '1'.
ls_fieldcat-fieldname = 'ICON'.
ls_fieldcat-tabname = 'I_OUTPUT'.
ls_fieldcat-seltext_m = 'SELECT'.
ls_fieldcat-icon = 'X'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-row_pos = '1'.
ls_fieldcat-col_pos = '2'.
ls_fieldcat-fieldname = 'F2'.
ls_fieldcat-tabname = 'I_OUTPUT'.
ls_fieldcat-seltext_m = 'DESCRIPTION'.
*ls_fieldcat-icon = 'X'.
ls_fieldcat-outputlen = 50.
APPEND ls_fieldcat TO lt_fieldcat.
* Display data in a POPUP
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_zebra = 'X'
it_fieldcat = lt_fieldcat
i_tabname = 'I_OUTPUT'
* i_checkbox_fieldname = 'CHECKBOX'
TABLES
t_outtab = i_output.
this will display tarffic light in pop up
BR
Sumeet
2014 Jan 09 9:48 PM
Hello Ajit,
Instead using the text symbols you could use the Message class.
First in SE91 Create a message class say 'ZMSG'
- Within this create message With Message Number 000 and Message Text as ' The Document & already available'
Now when you create a report use the message class as below
REPORT ycl_popup.
DATA: lv_doc_exists TYPE abap_bool value abap_true,
lv_doc_number TYPE i value '12345'.
IF lv_doc_exists = abap_true.
MESSAGE ID 'ZMSG' TYPE 'S' NUMBER '026'
WITH lv_doc_number sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
So now your output will be Green icon (Green tick mark icon- Because the type of message is a Success Message - 'S') followed by the text 'The Document 12345 already available'
Message type S = Success, E = Error, W = Warning , I = Information
Cheers,
Saras
2014 Jan 10 1:30 AM
Hello Ajit Sarangi,
Is your requirement is to display the message along with the traffic signel lights (3 colours namely Red, yellow and green). Based on the message you are displaying on the output it should highlight the respective color and other colors should be there but not highlighted. If yes then you can user application error handling method.
There are set of function modules,
BAL_LOG_CREATE
BAL_LOG_MSG_ADD
BAL_DSP_LOG_DISPLAY
BAL_LOG_MSGD_DELETE
At your initialization you can initialize the message log using
BAL_LOG_CREATE
When ever you come across the message to be displayed you can add the message to Log using
BAL_LOG_MSG_ADD
- during this process you have to specify the type of the message based on that the color will he highlighted automatically
At end of execution you can display the message log using
BAL_DSP_LOG_DISPLAY
- this displayes all the messages using the popup screen
At end you have to clear the log using
BAL_LOG_MSGD_DELETE
Hope this helps. Let me know you you want further information regarding this.
Thanks
Nivash