Skip to Content
0
Former Member
Oct 25, 2005 at 02:17 PM

ICON with field contents in case of ALV GRID

405 Views

please have a look at the program. the output of the program display ICONS with the field contents.

I wanted the same functionality in case of GRID layout.

But in case of GRID layout I am only getting ICON without field contents.

In this Example

if I use ALV LIST the ouput will be STACk ICON with X

IF I use ALV GRID the output will be STACK ICON.

REPORT ZTEST_SO1 .

type-pools : slis.

data : result(25).

types : BEGIN OF Ty_MARA,

gv_flag type char25,

end of ty_mara.

data : gt_mara type standard table of ty_mara,

wa_mara type ty_mara.

DATA : gt_fieldcat type slis_t_fieldcat_alv,

wa_fieldcat type slis_fieldcat_alv.

wa_fieldcat-fieldname = 'GV_FLAG'.

APPEND WA_FIELDCAT TO GT_FIELDCAT.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = '@3B@'

TEXT = 'X'

INFO = 'YY'

ADD_STDINF = 'X'

IMPORTING

RESULT = wa_mara-gv_flag.

IF sy-subrc EQ 0.

APPEND WA_MARA TO GT_MARA.

ENDIF.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZTEST_SO1'

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = GT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = GT_MARA

  • EXCEPTIONS

  • PROGRAM_ERROR = 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.