How to add Traffic Lights to a Report?

Hi,
How do U create a Traffic Light? and how to you change the Light? That's all I need.
Thanks,
Kishan

hi dude,
This is the way u add lights to ur alv report.
I'm following this method and i'm getting lights. This will work for sure.
In data declaration along with your alv display structure as a field named lights(any name).
DATA : BEGIN OF wa_srr,
vbeln LIKE vbak-vbeln, "Sales Order number
posnr LIKE vbap-posnr, "Item nunmber
matnr LIKE makt-matnr, "Material number Desc
maktx LIKE makt-maktx, "Material Description
gbstk LIKE vbuk-gbstk, "Completion status
bukrs LIKE knb1-bukrs, "Company Code
butxt LIKE t001-butxt, "Company Code description
vkorg LIKE vbak-vkorg, "Sales organization
vtext LIKE tvkot-vtext, "Sales Org description
vtweg LIKE vbak-vtweg, "Distribution Channel
dtext LIKE tvtwt-vtext, "Dist Channel description
spart LIKE vbak-spart, "Division
dvtxt LIKE tspat-vtext, "Division Description
kunnr LIKE vbak-kunnr, "Customer Number
name1 LIKE kna1-name1, "Customer Name
land1 LIKE kna1-land1, "Country
regio LIKE kna1-regio, "State
ort01 LIKE kna1-ort01, "City
erdat LIKE vbak-erdat, "Creation Date
vdatu LIKE vbak-vdatu, "Due date
kwmeng LIKE vbap-kwmeng, "Material Quantity
netpr LIKE vbap-netpr, "unit net price
netwr LIKE vbap-netwr, "Price
wavwr LIKE vbap-wavwr, "Cost price
bzirk LIKE vbkd-bzirk, "Sales District
bztxt LIKE t171t-bztxt, "Sales District Discription
lights, "Diplaying Status
END OF wa_srr.
While you are building the field cat do as follows
FORM build_layout CHANGING l_wa_layout TYPE slis_layout_alv.
l_wa_layout-zebra = cb_zebr. "Set alterante colored line
l_wa_layout-colwidth_optimize = cb_colop. "Optimize column width
l_wa_layout-no_vline = cb_novli. "No vertical line
l_wa_layout-no_colhead = cb_nocol. "no column Header
l_wa_layout-lights_fieldname = 'LIGHTS'. "Set light field
(assigning the field u have added in ur structure here as light field in alv report)
ENDFORM. " BUILD_LAYOUT
Then as per the logic, u make green, yellow or red light
Example,
FORM build_light .
LOOP AT it_srr INTO wa_srr. "for all entries in the table
IF wa_srr-gbstk = 'C'. "If status is 'completed',
wa_srr-lights = '3'. "Show green signal light
ELSEIF wa_srr-gbstk = 'B'. "If status is 'Partial'
wa_srr-lights = '2'. "Show yellow signal light
ELSE. "If status is 'incomplete'
wa_srr-lights = '1'. "Show red signal light
ENDIF.
MODIFY it_srr FROM wa_srr. "Update to table
ENDLOOP.
ENDFORM. " build_light
after building ur layout, Pass it to ur alv function module like this.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_background_id = 'ALV_BACKGROUND'
i_grid_title = text-011
pass ur layout structure here********
is_layout = wa_layout
it_fieldcat = it_fcat
it_sort = it_sort
i_save = v_save
is_variant = wa_variant
is_print = wa_print
TABLES
t_outtab = it_srr
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i001. "List cannot be displayed
ENDIF.
wat all i did to add light is,
1) adding an extra field in the main structure.
2)create internal table with this structure as data table for alv report
3) add 'field name' field in layout
4) I have passed values(3, 2, 1) for green, yellow and red light resp, to the field(LIGHTS) in the internal table that is passed to alv function module.(Based on some condition)
5) pass the layout structure layout to alv function module
Thats it. If u do all this teps, u r done with it.
Lemme know u solved it by giving points.
with regards,
praveen.

Similar Messages

  • How to print traffic lights in ALV reports

    hi how to print traffic lights on selection screen in alv reports

    HI,
    check below code
    TYPE-POOLS : icon.
    types:  BEGIN OF ty_display,
            status     TYPE icon-id,
            bukrs      TYPE bseg-bukrs,
            gjahr      TYPE bseg-gjahr,
            monat      TYPE monat,
            work_order TYPE z_work_order,
            glaccount  TYPE saknr,
            message    TYPE string,
          END OF ty_display.
    data : it_display     TYPE TABLE OF ty_display,
             wa_display TYPE ty_display.
    WRITE icon_led_green AS ICON TO wa_display-status.
            wa_display-gjahr = p_year.
            wa_display-bukrs = p_cc.
            wa_display-monat = p_period.
            wa_display-work_order = v_aufnr.
            wa_display-glaccount = wa_bseg-hkont.
        APPEND wa_display TO it_display.
    WRITE icon_led_red AS ICON TO wa_display-status.
              wa_display-gjahr      = p_year.
              wa_display-bukrs      = p_cc.
              wa_display-monat      = p_period.
              wa_display-work_order = v_aufnr.
              wa_display-glaccount  = wa_bseg-hkont.
              wa_display-message    = text-010.
              APPEND wa_display TO it_display.
    change the icon color based on your requirement and append it to the internal table which you have to display in ALV.
    reward points if it is helpful.
    Regards,
    Srilatha

  • How to add "Traffic lights" to a webdynpro table

    Hi guys!
    What are the necessary steps to modify a Table cell in a table control in abap web dynpro.
    In particular i need those "traffic lights" in a table.
    can someone help me?
    thanks!

    Hello Thomas ,
                          Create an Attribute (say  LIGHT ) in the table node with type String .
    Now create a table column for this attribute and the cell editor for this column should be an
    'IMAGE' ui element . bind the attribute with ui element .
    Now at  runtime fill the LIGHT attribute with following values as required :
    light = 'ICON_RED_LIGHT'.
    or
    light = 'ICON_GREEN_LIGHT'
    or
    light = ''ICON_YELLOW_LIGHT'
    I hope this will help you .
    Regards
    Vivek

  • How we can   drill-down, sorting, traffic lights,  in ALV report

    hi gurus ,
    how we can   drill-down, sorting, traffic lights,  in ALV report .
    please any one suggest that...
    regards,
    praveen

    Check the sample code for drill-down, sorting, traffic lights,  in ALV report.
    REPORT YMS_COLOURALV NO STANDARD PAGE HEADING.
    TYPE-POOLS: SLIS, ICON.
    DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: BEGIN OF IMARA OCCURS 0,
    LIGHT(4) TYPE C,
    MATNR TYPE MARA-MATNR,
    MTART TYPE MARA-MTART,
    MAKTX TYPE MAKT-MAKTX,
    COLOR_LINE(4) TYPE C,
    TCOLOR TYPE SLIS_T_SPECIALCOL_ALV, "cell
    END OF IMARA.
    DATA: XCOLOR TYPE SLIS_SPECIALCOL_ALV.
    START-OF-SELECTION.
    PERFORM GET_DATA.
    PERFORM WRITE_REPORT.
    FORM GET_DATA.
    WRITE ICON_GREEN_LIGHT AS ICON TO IMARA-LIGHT.
    IMARA-MATNR = 'ABC'.
    IMARA-MTART = 'ZCFG'.
    IMARA-MAKTX = 'This is description for ABC'.
    APPEND IMARA.
    WRITE ICON_YELLOW_LIGHT AS ICON TO IMARA-LIGHT.
    IMARA-MATNR = 'DEF'.
    IMARA-MTART = 'ZCFG'.
    IMARA-MAKTX = 'This is description for DEF'.
    APPEND IMARA.
    WRITE ICON_RED_LIGHT AS ICON TO IMARA-LIGHT.
    IMARA-MATNR = 'GHI'.
    IMARA-MTART = 'ZCFG'.
    IMARA-MAKTX = 'This is description for GHI'.
    APPEND IMARA.
    LOOP AT IMARA.
    IF SY-TABIX = 1.
    IMARA-COLOR_LINE = 'C410'. " color line
    ENDIF.
    IF SY-TABIX = 2. " color CELL
    CLEAR XCOLOR.
    XCOLOR-FIELDNAME = 'MTART'.
    XCOLOR-COLOR-COL = '3'.
    XCOLOR-COLOR-INT = '1'. " Intensified on/off
    XCOLOR-COLOR-INV = '0'.
    APPEND XCOLOR TO IMARA-TCOLOR.
    ENDIF.
    MODIFY IMARA.
    ENDLOOP.
    ENDFORM. "get_data
    FORM WRITE_REPORT.
    DATA: LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-COLTAB_FIELDNAME = 'TCOLOR'.
    LAYOUT-INFO_FIELDNAME = 'COLOR_LINE'.
    PERFORM BUILD_FIELD_CATALOG.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FIELDCAT
    TABLES
    T_OUTTAB = IMARA.
    ENDFORM. "write_report
    FORM BUILD_FIELD_CATALOG.
    DATA: FC_TMP TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    CLEAR: FIELDCAT. REFRESH: FIELDCAT.
    CLEAR: FC_TMP.
    FC_TMP-REPTEXT_DDIC = 'Status'.
    FC_TMP-FIELDNAME = 'LIGHT'.
    FC_TMP-TABNAME = 'IMARA'.
    FC_TMP-OUTPUTLEN = '4'.
    FC_TMP-ICON = 'X'.
    APPEND FC_TMP TO FIELDCAT.
    CLEAR: FC_TMP.
    FC_TMP-REPTEXT_DDIC = 'Material Number'.
    FC_TMP-FIELDNAME = 'MATNR'.
    FC_TMP-TABNAME = 'IMARA'.
    FC_TMP-OUTPUTLEN = '18'.
    APPEND FC_TMP TO FIELDCAT.
    CLEAR: FC_TMP.
    FC_TMP-REPTEXT_DDIC = 'Material Type'.
    FC_TMP-FIELDNAME = 'MTART'.
    FC_TMP-TABNAME = 'IMARA'.
    FC_TMP-OUTPUTLEN = '10'.
    APPEND FC_TMP TO FIELDCAT.
    CLEAR: FC_TMP.
    FC_TMP-REPTEXT_DDIC = 'Material'.
    FC_TMP-FIELDNAME = 'MAKTX'.
    FC_TMP-TABNAME = 'IMARA'.
    FC_TMP-OUTPUTLEN = '40'.
    APPEND FC_TMP TO FIELDCAT.
    ENDFORM. "build_field_catalog

  • How to add two columns in OBIEE report?

    Hi to All,
    Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
    Thanks in Advance,
    Thenmozhi

    Assume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
    For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
    Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
    Let me know if you are looking for something else.
    Thanks

  • How we add & grandtotal of sales order report in alv

    hi guru how we add & grandtotal of sales order report in alv
    regards
    subhasis

    hi subhasis,
    since u want the grand total in ALV use the following code...
    clear gs_fieldcat.
    gs_fieldcat-fieldname = field.
    gs_fieldcat-tabname = DB table
    gs_fieldcat-seltext_m = text.
    gs_fieldcat-do_sum = 'X'
    gs_fieldcat-datatype = data type (Curr or Quant)
    gs_fieldcat-ref_fieldname = reference field name
    gs_fieldcat-ref_tabname  = reference table name
    append gs_fieldcat to gt_fieldcat.
    hope this will work...
    please reward points in case usefull
    regards,
    prashant

  • How to use traffic lights concept in alv in webdynpro abap

    Hai ,
              How to use traffic lights concept for alv in webdynpro abap. If possible give me some code.

    Hi Ravi,
    You can create ICON  to get traffic light.
    Go through this step by step.. in this example
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?quicklink=index&overridelayout=true
    Please go through this...
    Re: Display ICON in the ALV table column
    Re: Image in ALV
    cheers,
    Kris.

  • Custom traffic lighting with Interactive Reporting

    Has anyone written a custom javascript solution for cell-based traffic lighting in Interactive Reports? It does not appear that the object model gives access to cell-level properties in either the pivot or OLAPquery objects although spotlighting can be applied to individual columns and rows.

    Oh yes, understand perfectly what you want, sighing...
    I planned to write another blog post about reporting partial scores, but since Posterous closed down in March, I am not blogging any more, just paying to keep the old posts online on demand of a lot of users. There are several reasons for that, which I will not explain but it is mainly because I feel really exploited.
    Two possiblities:
    Using the mastery widget of InfoSemantics (but limited to SWF-output)
    Using JavaScript
    Lilybiri

  • Reg:HOw to add new charactersitics in standard report

    hi all
    HOw to add new charactersitics in standard report
    regards
    JK Rao

    You need to copy the std report and make necessary changes in the copied report. SAP does not allow changes to std report. The technical details of the report can be seen by selecting from the menu Extras - technical information. Select the library and Report name. Copy the same using t code GRR1. Carry out necessary changes and SAVE. Before execution, you will have to specify the report group in which report needs to be attached. You can choose and existing group or specify a new one.
    Regards
    Rakesh Pawaskar

  • How to add company logo in z report

    Hi !
    i want to know how to add company logo into custom report ...
    generally we used below mentioned code for sap logo
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY       = IT_LIST[]
       I_LOGO                   = 'ENJOYSAP_LOGO'.
    ENDFORM.            "top_of_page"
    what changes we need to do to add company logo into custom report
    Please guide
    Regards
    Sheetal

    First upload  ur  required logo in  SAp  by  t-code  SE78.
    Use teh  above mentioned  ALV code  for the same.
    Try  to  search  on SDN for  the  u can find the  full  ALV code for the same.
    ..lakhan

  • How to add search help to a report.

    How to add search help to a report.

    Hi
    It can use the event AT SELECTION-SCREEN ON VALUE REQUEST:
    PARAMETERS: P_FIELD LIKE ....
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FIELD.
    * Here it needs to insert the abap code to call the search help,
    * for example it can call fm F4IF_FIELD_VALUE_REQUEST
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
               TABNAME        = SPACE
                SEARCHHELP = <SEARCH HELP>
                DYNPPROG     = SY-REPID
                DYNPNR          = SY-DYNNR
                DYNPROFIELD = 'P_FIELD'.
    Max

  • Traffic lights in classical report

    Hi All,
    Is it possible display traffic lights in classical report ?
    if so please help me
    Regs,
    Murthy

    hi,
    check below logic
    use type pools as TYPE-POOLS : icon.
    Types:
       BEGIN OF ty_display,
            status     TYPE icon-id,
            bukrs      TYPE bseg-bukrs,
            gjahr      TYPE bseg-gjahr,
            monat      TYPE monat,
            work_order TYPE z_work_order,
            glaccount  TYPE saknr,
            message    TYPE string,
          END OF ty_display.
    data : it_display     TYPE TABLE OF ty_display,
             wa_display    TYPE ty_display.
    WRITE icon_led_green AS ICON TO wa_display-status.
            wa_display-gjahr = p_year.
            wa_display-bukrs = p_cc.
            wa_display-monat = p_period.
            wa_display-work_order = v_aufnr.
            wa_display-glaccount = wa_bseg-hkont.
            APPEND wa_display TO it_display.
    WRITE icon_led_red AS ICON TO wa_display-status.
            wa_display-gjahr = p_year.
            wa_display-bukrs = p_cc.
            wa_display-monat = p_period.
            wa_display-work_order = v_aufnr.
            wa_display-glaccount = wa_bseg-hkont.
            APPEND wa_display TO it_display.
    regards,
    srilatha
    Edited by: srilatha kurapati on Aug 21, 2008 1:51 PM

  • Crystal 2008 How to Add a stylesheet to a report?

    Crystal 2008 How to Add a stylesheet to a report?
    I have no idea where to start:
    - Dont know how to link css to report
    - Dont know how to format different fields etc
    Please help.

    Hello,
    Hit the F1 key in CR Designer and then search on StyleSheet and it will give you info on to.
    Thank you
    Don

  • How do I add 'Traffic Lights' as sorting option?

    Hi! We use MD04 most often. We are able to set the traffic lights, however 'Traffic Lights' does not show up on that next screen as a sorting option. Any ideas on why not? Thank you for any help!  Maria

    Thanks for your response Steve, but Spier is correct I'm looking to add it as a print driver. I can export to pdf fine but sometimes when that isn't working or if I want the file to be compressed further I do File>Print and chose a printer, usually there is an option for Adobe PDF but the only option I currently have is Postscript. Looks like it was taken away. Thanks everyone!

  • How to add different query results in Report designer

    Hi,
    I am creating a report based on 3 queries.  At the end i need to show total of 3 query results.
    How can i add results of queries in report designer??
    thanks in advance

    Hi Siva,
    As u said that u want to show the results of the queries through report designer but i think it is used for formatted reports .
    If u want to see tha results of diffrent query then u can use workbook .
    In workbook u can also analyse reports easily by applying slice and dice techniques .
    from different queries result set will be displayed on workbook with formatting  and good look and feel.
    regards,
    Supriya

Maybe you are looking for

  • Using a custom menu button on the slide to open and close TOC in Captivate 7

    HI I have a custom menu button. When the user clicks I want to show TOC, ( I see there is a state to show TOC) but when the user clicks the same menu button again on that slide how can I hide the TOC. ie toggle between hide and show. thanks

  • How to make a backup without password

    I have tried to create new backups, but every time as they are with a lock on. have deleted itunes on pc n without help. bought a new computer without help. my problem is that I have two girls who have switched phones, the mobile phone that owned the

  • 2 weird errors trying to install/run Acrobat 8 on my PC. I'm lost!

    Hi all! My husband purchased Adobe Acrobat 8 Professional (for Windows) many years ago and has one more install allowed on a computer of his choice. He & I wanted to install it on my Windows 7 laptop. I went thru the whole installation process, inclu

  • Adobe E-mail Service doesn't work

    I'm trying to send ONE photo to a friend.  The HTML Email dialog box appears requesting verification.  Is this really necessary?  Anyway, I'm supposed to receive an email with a "Sender Verification" number.  I never get an email.  I press "Resend e-

  • Business Rule Deployment Date & Time

    Hi All, Can we know if a business rule is deployed or not, including the time and date for deployment?? This must be available in RDBMS i think. Like i tried a query which selects all the Business Rules and display created , modified and moved date a