Вы находитесь на странице: 1из 5

In screen painter the last control is 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.

e.g. DATA: status 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

    NAME = 'icon name'

    TEXT   = 'text to be displayed'

    INFO   = 'tooltip text'

  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

recommended style guidelines

hai anna,

how to place icons on table control.the 4 icons are 1)find,2)find next,3)asc,3)dsc.

Plz suggest me anna.


his link may be help ful

http://help.sap.com/saphelp_nw04s/helpdata/en/59/348efa61c611d295750000e8353423/frames
et.htm

and also check this....

REPORT demo_dynpro_status_icons.

DATA value TYPE i VALUE 1.

DATA: status_icon TYPE icons-text,

icon_name(20) TYPE c,

icon_text(10) TYPE c.

CALL SCREEN 100.

MODULE set_icon OUTPUT.

SET PF-STATUS 'SCREEN_100'.

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.

CALL FUNCTION 'ICON_CREATE'

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.

MESSAGE e888(sabapdocu) WITH text-004.

WHEN 2.

MESSAGE e888(sabapdocu) WITH text-005.

WHEN 3.

MESSAGE e888(sabapdocu) WITH text-006.

ENDCASE.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.
ENDMODULE.

MODULE change.

CASE value.

WHEN 1.

value = 2.

WHEN 2.

value = 3.

WHEN 3.

value = 1.

ENDCASE.

ENDMODULE.

CALL FUNCTION 'ICON_CREATE'


EXPORTING
NAME = 'icon name'
TEXT = 'text to be displayed'
INFO = 'tooltip text'

Case sy-ucomm.

When ‘asc’.

Get cursor field wa-field.

Sort itab by wa-field. “by default it is asc.

Loop at itab into wa.

Write:wa-f1,

Wa-f2,

Wa-f3.

Endloop.

When ‘dsc’,
Get cursor field wa-field.

Sort itab descending by wa-field.

Loop at itab into wa.

Write:wa-f1,

Wa-f2,

Wa-f3.

Endloop.

Вам также может понравиться