on 05-12-2006 3:36 PM
hi all!!
i want to display icon in one of the fields of alv
instead of value ..
is it possible ..
there is icon field in fieldcatalog
can it be if use??
Thanks in advance .
hii
DATA: BEGIN OF IT_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN, "Sales Document
VBTYP LIKE VBAK-VBTYP, "SD document category
AUDAT LIKE VBAK-AUDAT, "Document date (date received/sent)
AUGRU LIKE VBAK-AUGRU, "Order reason (reason for the business)
AUART LIKE VBAK-AUART, "Sales Document Type
NETWR LIKE VBAK-NETWR, "Net Sales Order in Doc. Currency
WAERK LIKE VBAK-WAERK, "SD document currency
<b> ICON TYPE ICON-ID</b>, "traffic lights
END OF IT_VBAK.
FORM GET_DATA.
SELECT VBELN
VBTYP
AUDAT
AUGRU
AUART
NETWR
WAERK FROM VBAK INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN AND VBTYP = P_VBTYP
AND ERDAT > '01.01.2004' AND NETWR > 0.
LOOP AT IT_VBAK.
<b>IF IT_VBAK-NETWR < 10000.
IT_VBAK-ICON = '@08@'.
ELSEIF IT_VBAK-NETWR > 100000.
IT_VBAK-ICON = '@0A@'.
ELSE.
IT_VBAK-ICON = '@09@'.</b>
ENDIF.
MODIFY IT_VBAK INDEX SY-TABIX.
ENDLOOP.
ENDFORM.
FORM DEFINE_FIELDCATALOG.
<b>WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'ICON'.
WA_FIELDCAT-SELTEXT_L = 'ICON'.
WA_FIELDCAT-ICON = 'X'.
WA_FIELDCAT-OUTPUTLEN = 8.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.</b>
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC NO.'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-FIELDNAME = 'AUDAT'.
WA_FIELDCAT-SELTEXT_L = 'CREATED ON'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 4.
WA_FIELDCAT-FIELDNAME = 'VBTYP'.
WA_FIELDCAT-SELTEXT_L = 'CATEGORY'.
WA_FIELDCAT-OUTPUTLEN = 1.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 6.
WA_FIELDCAT-FIELDNAME = 'AUGRU'.
WA_FIELDCAT-SELTEXT_L = 'REASON'.
WA_FIELDCAT-OUTPUTLEN = 3.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-FIELDNAME = 'AUART'.
WA_FIELDCAT-SELTEXT_L = 'DOC TYPE'.
WA_FIELDCAT-OUTPUTLEN = 4.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 7.
WA_FIELDCAT-FIELDNAME = 'NETWR'.
WA_FIELDCAT-SELTEXT_L = 'NET VALUE'.
WA_FIELDCAT-OUTPUTLEN = 17.
WA_FIELDCAT-DECIMALS_OUT = 2.
WA_FIELDCAT-DO_SUM = 'X'.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 8.
WA_FIELDCAT-FIELDNAME = 'WAERK'.
WA_FIELDCAT-SELTEXT_L = 'UNIT'.
WA_FIELDCAT-OUTPUTLEN = 50.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "DEFINE_FIELDCATALOG
&----
*& Form DEFINE_LAYOUT
&----
text
----
FORM DEFINE_LAYOUT.
LAYOUT-ZEBRA = 'X'.
LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL SUM'.
LAYOUT-WINDOW_TITLEBAR = 'TESTING'.
LAYOUT-TOTALS_TEXT = 'TOTAL'.
ENDFORM.
hope this helps
Thanks&Regards
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Did you check this sample program <b>BALVBT01</b>
for icons in alv report
Regards
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
DATA: BEGIN OF IT_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN, "Sales Document
VBTYP LIKE VBAK-VBTYP, "SD document category
AUDAT LIKE VBAK-AUDAT, "Document date (date received/sent)
AUGRU LIKE VBAK-AUGRU, "Order reason (reason for the business)
AUART LIKE VBAK-AUART, "Sales Document Type
NETWR LIKE VBAK-NETWR, "Net Sales Order in Doc. Currency
WAERK LIKE VBAK-WAERK, "SD document currency
<b> ICON TYPE ICON-ID,</b> "traffic lights
END OF IT_VBAK.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'ICON'.
WA_FIELDCAT-SELTEXT_L = 'ICON'.
WA_FIELDCAT-ICON = 'X'.
WA_FIELDCAT-OUTPUTLEN = 8.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
now pass this to alv fm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Praveen
Icon
value set: SPACE, 'X' 'X' = column contents to be output as an icon.
The caller must consider the printability of icons.
Thanks & Regards
Sreenivasulu P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This report SHOWICON will show how to display icons in list.
YOu can get some insight into using icons.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is very easy to do.
1) Have a field in your internal table which is at least 4 characters long and a character field.
Data: begin of alv_itab occurs 0,
<b> status(4) type c,</b>
matnr type mara-matnr,
maktx type makt-maktx,
end of alv_itab.
2) when filling the internal table, you can write the icon to the field like this.
Write icon_green_light as icon to alv_itab-status.
Make sure that you put the following line of code at the top of your program.
Type-pools: icon.
3) As you have already discovered, you should put an "X" in the icon field of your field catalog, this will center the icon in the field.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.