08-12-2008 9:08 AM
Hi All,
I am displaying ALV by using FM 'REUSE_ALV_LIST_DISPLAY'.
When i try to display ICON (ICON_4 ICON_RED_LIGHT '@0A@'." Red light; negative) in ALV,
i get short dump.
I am using ECC 6.0
Any pointers in this direction will be helpful.
Please let me know how to use ICONS in FM using ECC 6.0
Best Regards,
Tarun
08-12-2008 9:10 AM
08-12-2008 9:20 AM
Hi,
Instead of using ICON_4 ICON_RED_LIGHT, populate the values and do changes in the layout. sampe code is shown below
gs_layout-lights_fieldname = 'LIGHT' .
gs_layout-lights_tabname = 'GT_OUTPUT' .
gs_output-light = '1' "possible values 1, 2, 3
....
append gs_output to gt_output.
* Display ALV List
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* i_bypassing_buffer = c_x
* i_buffer_active = ' '
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_output
EXCEPTIONS
program_error = 0
OTHERS = 0.
08-12-2008 10:41 AM
hello, i am using field ICON with all their properties in my internal table which i am passing to FM.
the structure of my internal table is-
data: BEGIN OF it_report,
icon TYPE icon,
chain TYPE komg-kunnr,
matnr TYPE komg-matnr,
mvgr4 TYPE komg-zzmvgr4,
datab(10) TYPE c,
datbi(10) TYPE c,
end of it_report.
Hope, i clearly mention what you need.
Regards,
Tarun
08-12-2008 9:25 AM
Hi Tarun,
We can use ICONS in this Way.
I have used this Icons for CS02.
Hope this will help you.Sample.
&----
*& Report ZPP_BOM_CHANGE1
*&
&----
*&
*&
&----
REPORT zpp_bom_change1 LINE-SIZE 155.
TYPE-POOLS : slis.
INCLUDE <list>.
TABLES : mast,stpo,cdpos,cdhdr,syst.
TYPES : BEGIN OF ty_final,
matnr TYPE mast-matnr,
werks TYPE mast-werks,
stlan TYPE mast-stlan,
stlal TYPE mast-stlal,
mandt TYPE sy-mandt,
stlty TYPE stpo-stlty,
IDNRK TYPE MAST-IDNRK,
stlnr TYPE stpo-stlnr,
annam TYPE mast-annam,
idnrk TYPE stpo-idnrk,
posnr TYPE stpo-posnr,
menge TYPE stpo-menge,
meins TYPE stpo-meins,
postp TYPE stpo-postp,
andat TYPE stpo-andat,
aedat TYPE stpo-aedat,
maktx TYPE makt-maktx,
changenr TYPE cdpos-changenr,
chngind TYPE cdpos-chngind,
tabkey TYPE cdpos-tabkey,
value_new TYPE cdpos-value_new,
qty(13) TYPE c,
unit(3) TYPE c,
qty_old(13) type c,
name(12) TYPE c,
unit_new TYPE cdpos-unit_new,
value_old TYPE cdpos-value_old,
unit_old TYPE cdpos-unit_old,
username TYPE cdhdr-username,
udate TYPE cdhdr-udate,
tcode TYPE cdhdr-tcode,
carrid(10) TYPE c,
status TYPE string,
vardat TYPE sy-datum,
tabix TYPE sy-tabix,
fname TYPE cdpos-fname,
END OF ty_final.
DATA : wa_final TYPE ty_final,
it_final TYPE TABLE OF ty_final INITIAL SIZE 0.
TYPES : BEGIN OF ty_mast,
matnr TYPE mast-matnr,
werks TYPE mast-werks,
stlan TYPE mast-stlan,
stlnr TYPE mast-stlnr,
stlal TYPE mast-stlal,
aedat TYPE mast-aedat,
annam TYPE mast-annam,
END OF ty_mast.
DATA : wa_mast TYPE ty_mast,
it_mast TYPE TABLE OF ty_mast INITIAL SIZE 0.
TYPES : BEGIN OF ty_stpo,
mandt TYPE sy-mandt,
stlty TYPE stpo-stlty,
stlnr TYPE stpo-stlnr,
stlkn TYPE stpo-stlkn,
stpoz TYPE stpo-stpoz,
annam TYPE stpo-annam,
aenam TYPE stpo-aenam,
idnrk TYPE stpo-idnrk,
posnr TYPE stpo-posnr,
menge TYPE stpo-menge,
meins TYPE stpo-meins,
postp TYPE stpo-postp,
andat TYPE stpo-andat,
aedat TYPE stpo-aedat,
mkey(70),
END OF ty_stpo.
DATA : wa_stpo TYPE ty_stpo,
it_stpo TYPE TABLE OF ty_stpo INITIAL SIZE 0.
TYPES: BEGIN OF ty_cdpos,
objectclas TYPE cdpos-objectclas,
objectid TYPE cdpos-objectid,
tabkey TYPE cdpos-tabkey,
changenr TYPE cdpos-changenr,
chngind TYPE cdpos-chngind,
value_new TYPE cdpos-value_new,
unit_new TYPE cdpos-unit_new,
value_old TYPE cdpos-value_old,
unit_old TYPE cdpos-unit_old,
fname TYPE cdpos-fname,
END OF ty_cdpos.
DATA: wa_cdpos TYPE ty_cdpos,
it_cdpos TYPE TABLE OF ty_cdpos INITIAL SIZE 0.
TYPES: BEGIN OF ty_cdpos1,
objectclas TYPE cdpos-objectclas,
objectid TYPE cdpos-objectid,
tabkey TYPE cdpos-tabkey,
changenr TYPE cdpos-changenr,
chngind TYPE cdpos-chngind,
value_new TYPE cdpos-value_new,
unit_new TYPE cdpos-unit_new,
value_old TYPE cdpos-value_old,
unit_old TYPE cdpos-unit_old,
fname TYPE cdpos-fname,
END OF ty_cdpos1.
DATA: wa_cdpos1 TYPE ty_cdpos1,
it_cdpos1 TYPE TABLE OF ty_cdpos1 INITIAL SIZE 0.
TYPES: BEGIN OF ty_cdhdr,
objectid TYPE cdhdr-objectid,
objectclas TYPE cdhdr-objectclas,
changenr TYPE cdhdr-changenr,
username TYPE cdhdr-username,
change_ind TYPE cdhdr-change_ind,
udate TYPE cdhdr-udate,
tcode TYPE cdhdr-tcode,
END OF ty_cdhdr.
DATA: wa_cdhdr TYPE ty_cdhdr,
it_cdhdr TYPE STANDARD TABLE OF ty_cdhdr INITIAL SIZE 0.
TYPES : BEGIN OF ty_makt,
matnr TYPE makt-matnr,
maktx TYPE makt-maktx,
END OF ty_makt.
DATA : wa_makt TYPE ty_makt,
it_makt TYPE TABLE OF ty_makt INITIAL SIZE 0.
TYPES : BEGIN OF ty_stas,
mandt type stas-mandt,
stlty type stas-stlty,
stlnr TYPE stas-stlnr,
stlal type stas-stlal,
stlkn type stas-stlkn,
stasz type stas-stasz,
stvkn TYPE stas-stvkn,
skey(70),
END OF ty_stas.
DATA : wa_stas TYPE ty_stas,
it_stas TYPE TABLE OF ty_stas INITIAL SIZE 0.
DATA: var(20) TYPE c,
var2(70),
var4(70),
var8(2),
var6(10) TYPE c,
VAR7(10),
wa_stlnr TYPE stpo-stlnr.
*DATA: BEGIN OF wa,
mandt TYPE sy-mandt,
stlty TYPE stpo-stlty,
stlnr TYPE stpo-stlnr,
END OF wa.
*
DATA: BEGIN OF old occurs 0,
ovalue(15),
ounit(5),
okey(70),
END OF old.
*DATA: BEGIN OF wa_makt,
matnr type makt-matnr,
maktx type makt-maktx,
END OF wa_makt.
DATA: var1(18) TYPE c.
DATA: var5(18) TYPE c.
DATA: var3(18).
DATA: var9(40).
DATA: vardat TYPE sy-datum.
DATA: qty(18) TYPE c.
VARDAT1 TYPE SY-DATUM.
DATA: v_repid LIKE sy-repid.
DATA: fcat TYPE slis_t_fieldcat_alv,
header TYPE slis_t_listheader,
events TYPE slis_t_event.
CONSTANTS: formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: layout TYPE slis_layout_alv.
layout-zebra = 'X'.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE tit1.
PARAMETERS : s_matnr LIKE mast-matnr,
s_werks LIKE mast-werks,
s_stlan LIKE mast-stlan.
Select-options : s_stlal For mast-stlal no-extension no intervals,
: Date for sy-datum.
s_stlal LIKE mast-stlal.
SELECTION-SCREEN END OF BLOCK blk1.
INITIALIZATION.
tit1 = 'SELECTION-CRITERIA'.
v_repid = sy-repid.
PERFORM field_catalog USING fcat[].
PERFORM build_eventtab USING events[].
START-OF-SELECTION.
SELECT matnr werks stlan stlnr stlal annam FROM mast INTO
CORRESPONDING FIELDS OF TABLE it_mast
WHERE matnr = s_matnr
AND werks = s_werks
AND stlan = s_stlan
AND stlal in s_stlal .
if sy-subrc eq 0.
SELECT mandt stlty stlnr stlal stlkn stasz stvkn FROM stas
INTO TABLE it_stas FOR ALL ENTRIES IN it_mast WHERE stlnr = it_mast-stlnr
AND stlal = it_mast-stlal
AND stlty = 'M'.
endif.
if sy-subrc eq 0.
SELECT mandt stlty stlnr stlkn stpoz idnrk annam aenam posnr menge meins postp andat aedat FROM stpo INTO
CORRESPONDING FIELDS OF TABLE it_stpo
FOR ALL ENTRIES IN it_stas
WHERE stlkn = it_stas-stvkn
AND stlnr = it_stas-stlnr
AND postp = 'L'
AND stlty = 'M'
AND andat in DATE.
endif.
LOOP AT it_stpo INTO wa_stpo.
CONCATENATE wa_stpo-mandt wa_stpo-stlty wa_stpo-stlnr INTO var.
CONCATENATE wa_stpo-mandt wa_stpo-stlty wa_stpo-stlnr wa_stpo-stlkn wa_stpo-stpoz INTO var2.
wa_stpo-mkey = var2.
MODIFY it_stpo FROM wa_stpo.
ENDLOOP.
LOOP AT it_stas INTO wa_stas.
CONCATENATE wa_stas-mandt wa_stas-stlty wa_stas-stlnr wa_stas-stlal wa_stas-stlkn wa_stas-stasz INTO var4.
wa_stas-skey = var4.
MODIFY it_stas FROM wa_stas.
ENDLOOP.
SELECT objectid objectclas changenr username change_ind udate tcode FROM cdhdr INTO TABLE it_cdhdr
WHERE objectid = var AND objectclas = 'STUE' AND UDATE in Date.
if sy-subrc eq 0.
SELECT objectclas
objectid
tabkey
changenr
chngind
value_new
unit_new
value_old
unit_old
fname
INTO TABLE it_cdpos FROM cdpos
FOR ALL ENTRIES IN it_cdhdr WHERE changenr = it_cdhdr-changenr
AND tabname = 'STPO' AND ( fname = 'MENGE' OR fname = 'KEY' ) .
SELECT objectclas
objectid
tabkey
changenr
chngind
value_new
unit_new
value_old
unit_old
fname
INTO TABLE it_cdpos1 FROM cdpos
FOR ALL ENTRIES IN it_cdhdr WHERE changenr = it_cdhdr-changenr
AND tabname = 'STAS' AND chngind = 'D' and fname = 'KEY'.
endif.
if sy-subrc eq 0.
SELECT matnr maktx FROM makt INTO TABLE it_makt
FOR ALL ENTRIES IN it_stpo
WHERE matnr = it_stpo-idnrk AND spras = 'EN'.
endif.
SORT it_stpo BY idnrk.
SORT it_stpo BY posnr.
CLEAR wa_final.
LOOP AT it_cdpos INTO wa_cdpos .
if s_stlal ne ''.
LOOP AT it_stpo INTO wa_stpo WHERE mkey = wa_cdpos-tabkey.
wa_final-fname = wa_cdpos-fname.
wa_final-chngind = wa_cdpos-chngind.
wa_final-changenr = wa_cdpos-changenr.
wa_final-tabkey = wa_cdpos-tabkey.
wa_final-value_old = wa_cdpos-value_old.
wa_final-value_new = wa_cdpos-value_new.
wa_final-unit_new = wa_cdpos-unit_new.
wa_final-unit_old = wa_cdpos-unit_old.
READ TABLE it_cdhdr INTO wa_cdhdr WITH KEY changenr = wa_cdpos-changenr.
wa_final-username = wa_cdhdr-username.
wa_final-udate = wa_cdhdr-udate.
wa_final-tcode = wa_cdhdr-tcode.
APPEND wa_final TO it_final.
ENDLOOP.
else.
wa_final-fname = wa_cdpos-fname.
wa_final-chngind = wa_cdpos-chngind.
wa_final-changenr = wa_cdpos-changenr.
wa_final-tabkey = wa_cdpos-tabkey.
wa_final-value_old = wa_cdpos-value_old.
wa_final-value_new = wa_cdpos-value_new.
wa_final-unit_new = wa_cdpos-unit_new.
wa_final-unit_old = wa_cdpos-unit_old.
READ TABLE it_cdhdr INTO wa_cdhdr WITH KEY changenr = wa_cdpos-changenr.
wa_final-username = wa_cdhdr-username.
wa_final-udate = wa_cdhdr-udate.
wa_final-tcode = wa_cdhdr-tcode.
APPEND wa_final TO it_final.
endif.
ENDLOOP.
clear wa_final.
LOOP AT it_final INTO wa_final.
IF wa_final-chngind = 'I'.
LOOP AT it_stpo INTO wa_stpo WHERE mkey = wa_final-tabkey.
WRITE: wa_stpo-idnrk TO var1 NO-ZERO.
wa_final-idnrk = var1.
wa_final-posnr = wa_stpo-posnr.
wa_final-name = wa_stpo-annam.
wa_final-qty = wa_stpo-menge.
wa_final-unit = wa_stpo-meins.
wa_final-vardat = wa_stpo-andat.
READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_stpo-idnrk.
wa_final-maktx = wa_makt-maktx.
MODIFY it_final FROM wa_final.
ENDLOOP.
clear wa_final.
clear wa_stpo.
LOOP AT it_stpo INTO wa_stpo WHERE mkey ne wa_final-tabkey.
wa_final-name = wa_final-username.
wa_final-vardat = wa_final-udate.
Modify it_final from wa_final.
endloop.
ENDIF.
ENDLOOP.
LOOP AT it_final INTO wa_final.
IF wa_final-chngind = 'U'.
LOOP AT it_stpo INTO wa_stpo WHERE mkey = wa_final-tabkey.
WRITE: wa_stpo-idnrk TO var1 NO-ZERO.
wa_final-idnrk = var1.
MOVE: wa_stpo-posnr to wa_final-posnr.
MOVE: wa_final-value_new TO wa_final-qty.
MOVE: wa_final-unit_new TO wa_final-unit.
MOVE: wa_final-udate TO wa_final-vardat.
MOVE: wa_final-username TO wa_final-name.
old-ovalue = wa_final-value_old.
old-ounit = wa_final-unit_old.
old-okey = wa_final-tabkey.
READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_stpo-idnrk.
wa_final-maktx = wa_makt-maktx.
MODIFY it_final FROM wa_final.
Append old.
ENDLOOP.
ENDIF.
ENDLOOP.
delete adjacent duplicates from old comparing okey.
LOOP AT it_final INTO wa_final.
loop at old where okey = wa_final-tabkey.
if wa_final-chngind = 'I'.
wa_final-qty = old-ovalue.
wa_final-unit = old-ounit.
Modify it_final from wa_final.
endif.
endloop.
endloop.
if s_stlal ne ''.
clear wa_final.
LOOP AT it_cdpos1 INTO wa_cdpos1.
if wa_cdpos1-chngind = 'D'.
var8 = wa_cdpos1-tabkey+12(2).
Read table it_stas into wa_stas with key stlal = var8.
if sy-subrc eq 0.
wa_final-chngind = wa_Cdpos1-chngind.
wa_final-tabkey = wa_cdpos1-tabkey.
READ TABLE it_cdhdr INTO wa_cdhdr WITH KEY changenr = wa_cdpos1-changenr.
wa_final-username = wa_cdhdr-username.
wa_final-udate = wa_cdhdr-udate.
append wa_final to it_final.
endif.
endif.
endloop.
endif.
SORT it_final BY andat udate .
SORT it_final BY changenr.
sort it_final by idnrk.
LOOP AT it_final INTO wa_final .
IF wa_final-chngind = 'I' .
MOVE: icon_green_light TO wa_final-carrid.
MOVE: 'Created' TO wa_final-status.
MOVE: wa_final-menge TO wa_final-qty.
MOVE: wa_final-meins TO wa_final-unit.
MOVE: wa_final-annam TO wa_final-name.
MOVE: wa_final-andat TO wa_final-vardat.
MODIFY it_final FROM wa_final.
ENDIF.
IF wa_final-chngind = 'U'.
MOVE: icon_yellow_light TO wa_final-carrid.
MOVE: 'Changed' TO wa_final-status.
MOVE: wa_stpo-idnrk to wa_final-idnrk.
MOVE: wa_final-value_new TO wa_final-qty.
MOVE: wa_final-meins TO wa_final-unit.
MOVE: wa_final-udate TO wa_final-vardat.
MOVE: wa_final-username TO wa_final-name.
MODIFY it_final FROM wa_final.
ENDIF.
IF wa_final-chngind = 'D'.
MOVE: icon_red_light TO wa_final-carrid.
MOVE: 'Deleted' TO wa_final-status.
wa_final-idnrk = ''.
wa_final-posnr = ''.
wa_final-maktx = ''.
wa_final-qty = ''.
wa_final-unit = ''.
wa_final-value_old = ''.
wa_final-unit_old = ''.
wa_final-name = wa_final-username.
wa_final-vardat = wa_final-udate.
MODIFY it_final FROM wa_final.
ENDIF.
ENDLOOP.
PERFORM list_header USING header[] .
PERFORM alv_display.
&----
*& Form field_catalog
&----
text
----
-->P_FCAT[] text
----
FORM field_catalog USING p_fcat TYPE slis_t_fieldcat_alv.
DATA: a_fcat TYPE slis_fieldcat_alv.
REFRESH p_fcat[].
CLEAR a_fcat.
a_fcat-col_pos = 1.
a_fcat-fieldname = 'CARRID'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Indicator'.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 2.
a_fcat-fieldname = 'STATUS'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Status'.
a_fcat-outputlen = 10.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 3.
a_fcat-fieldname = 'VARDAT'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'DATE'.
a_fcat-outputlen = 10.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 4.
a_fcat-fieldname = 'IDNRK'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Material'.
a_fcat-lzero = ' '.
a_fcat-outputlen = 20.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 5.
a_fcat-fieldname = 'MAKTX'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Material Description'.
a_fcat-outputlen = 40.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 6.
a_fcat-fieldname = 'POSNR'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Item'.
a_fcat-outputlen = 06.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 7.
a_fcat-fieldname = 'VALUE_OLD'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Old_Quantity'.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 8.
a_fcat-fieldname = 'UNIT_OLD'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Old_Unit'.
a_fcat-outputlen = 09.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 9.
a_fcat-fieldname = 'QTY'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'New_Quantity'.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 10.
a_fcat-fieldname = 'UNIT'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'New_Unit'.
a_fcat-outputlen = 09.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
a_fcat-col_pos = 11.
a_fcat-fieldname = 'NAME'.
a_fcat-tabname = 'IT_FINAL'.
a_fcat-seltext_l = 'Username'.
APPEND a_fcat TO p_fcat.
CLEAR a_fcat.
ENDFORM. " field_catalog
&----
*& Form alv_display
&----
text
----
--> p1 text
<-- p2 text
----
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = layout
it_fieldcat = fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = 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
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.ENDIF
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
.
ENDFORM. " alv_display
&----
*& Form list_header
&----
text
----
-->P_HEADER[] text
----
FORM list_header USING p_header TYPE slis_t_listheader.
DATA: a_header TYPE slis_listheader,
w_date(35),
text1(50) TYPE c,
text2(50) TYPE c,
text3(50) TYPE c,
text4(50) TYPE c,
text5(50) type c,
text6(50) type c.
WRITE: s_matnr TO var5 NO-ZERO.
select single matnr maktx from makt into wa_makt where matnr = s_matnr.
var9 = wa_makt-maktx.
WRITE: text-001 TO text1,
text-002 TO text2,
text-003 TO text3,
text-004 TO text4,
text-005 to text5,
text-006 to text6.
*clear a_header.
write: date-low to var6 using EDIT MASK '==PDATE'.
write: date-high to var7 using EDIT MASK '==PDATE'.
concatenate 'From :' VAR6 ' To : ' VAR7 into w_date.
clear a_header.
a_header-typ = 'H'.
a_header-info = 'Bevcon Wayors Pvt.Ltd'.
APPEND a_header TO p_header.
a_header-typ = 'H'.
a_header-info = 'Engg Changes in Material BOM'.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = var5.
a_header-key = text1.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = var9.
a_header-key = text2.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = s_werks.
a_header-key = text3.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = s_stlan.
a_header-key = text4.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = s_stlal-low.
a_header-key = text5.
APPEND a_header TO p_header.
a_header-typ = 'S'.
a_header-info = w_date.
a_header-key = text6.
APPEND a_header TO p_header.
ENDFORM. " list_header
&----
*& Form build_eventtab
&----
text
----
-->P_EVENTS[] text
----
FORM build_eventtab USING p_events TYPE slis_t_event.
DATA: a_events TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_events.
READ TABLE p_events INTO a_events WITH KEY name = slis_ev_top_of_page.
IF sy-subrc EQ 0.
MOVE formname_top_of_page TO a_events-form.
APPEND a_events TO p_events.
ENDIF.
ENDFORM. " build_eventtab
&----
*& Form top_of_page
&----
text
----
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = header
I_LOGO = ''
I_END_OF_LIST_GRID =
.
ENDFORM. "top_of_page
Best of Luck.
with Regards,
Sharmishta.
08-12-2008 9:44 AM
use type pool icon, assign the value ICON_RED_LIGHT to your variable type icon_4.
In the fieldcatalog set
wa_fcat-icon = 'X'.
for that field.