Status Icon Which Is Used To Display Icon in The Table Control
Status Icon Which Is Used To Display Icon in The Table Control
Before drag and drop, in your internal table create one column for status icon.
After designed the table control, just drag and drop the status icon control inside the table control. Then
write the code as per your requirement.
https://forums.sdn.sap.com/thread.jspa?threadID=278641&tstart=4410
Status icon is used in screens to indicate visually about the status of the program. Before the
status icon can be used, it should be placed on the screen, it is a type of screen element. To
use the status icon we have to write some abap code and also to change icons whenever
required in the program. First step is to create a variable of type ICONS-TEXT.
The name of the variable in the abap program should be same as that of in the screen.
Declaring it merely won't show anything, we have to use the function module ICON_CREATE to
fill it with the required icon, generally PBO of the screen is used for this purpose. There are 3
parameters to be passed.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
Here name can be anything like ICON_RED_LIGHT,ICON_GREEN_LIGHT etc. Infact any icon
can be shown that exists but we should adhere to SAP
hai anna,
http://help.sap.com/saphelp_nw04s/helpdata/en/59/348efa61c611d295750000e8353423/frames
et.htm
REPORT demo_dynpro_status_icons.
icon_name(20) TYPE c,
icon_text(10) TYPE c.
CASE value.
WHEN 1.
icon_name = 'ICON_GREEN_LIGHT'.
icon_text = text-003.
WHEN 2.
icon_name = 'ICON_YELLOW_LIGHT'.
icon_text = text-002.
WHEN 3.
icon_name = 'ICON_RED_LIGHT'.
icon_text = text-001.
ENDCASE.
EXPORTING
name = icon_name
text = icon_text
info = 'Status'
add_stdinf = 'X'
IMPORTING
result = status_icon
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 1.
WHEN 2.
WHEN 3.
ENDCASE.
ENDMODULE.
LEAVE PROGRAM.
ENDMODULE.
MODULE change.
CASE value.
WHEN 1.
value = 2.
WHEN 2.
value = 3.
WHEN 3.
value = 1.
ENDCASE.
ENDMODULE.
Case sy-ucomm.
When ‘asc’.
Write:wa-f1,
Wa-f2,
Wa-f3.
Endloop.
When ‘dsc’,
Get cursor field wa-field.
Write:wa-f1,
Wa-f2,
Wa-f3.
Endloop.