Status icons in table controls

Hi,
   i've included status icons inside my table control with an aim to show appropriate status depending on a value of a column (wa_tab-posted).
all i want is that if a line in the table control has the value of wa_tab-posted as 'Y'. the status icon should be RED and Green if not posted ( wa_tab-posted = 'N'.)
so far i have only been able to get a common status icon color based on the last line of the table control.
ie: if the last line of my table control has the value of wa_tab-posted as 'N' then all the status icons show GREEN,,, even the ones where wa_tab-posted is 'Y'.
how do i set unique status icons for each individual lines.
Please advice.
Thanks,
David
Edited by: david joseph on Aug 20, 2008 8:20 AM

REPORT  ZICON_CONTROL.
tables: icon.
controls: tc type tableview using screen 100.
data: begin of it_data occurs 0,
       icon(4),
       value(02),
      end of it_data.
"Based on condion you populate the ICON data here
"if the case is editable and then you have to do the same in PBO
it_data-icon = '@0A@'."ICON_RED_LIGHT.
it_data-value = '00'.
append it_data.
it_data-icon = '@08@'. "ICON_GREEN_LIGHT.
it_data-value = '01'.
append it_data.
call screen 100.
*&      Module  transfer_data  OUTPUT
*       text
module transfer_data output.
read table it_data index tc-current_line.
endmodule.                 " transfer_data  OUTPUT
Flow logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
loop at it_data with control tc.
  module transfer_data.
endloop.
PROCESS AFTER INPUT.
loop.
endloop.
MODULE USER_COMMAND_0100.

Similar Messages

  • How to display an status Icon in Table UI web dynpro ABAP?

    Hi Experts ,
    How to display an status Icon ( Traffic light ) in Table UI web dynpro ABAP? can somebody tell with a coding example. also I need to update status on condition so whats the best way?
    Thanks in advance.
    Regards,

    Hi Laeeq,
    click on table cntrol n place it on the screen..
    now click on the icon button n place it in the table control area.. a column of icons get created. name it (say) ICON.
    in the PBO..
    loop at internal table and call module in the loop (say) .
    MODULE ICON_DISP.
    now in the module try the foll code :
    module icon_display output.
    check some condition and assign the icon to the variable icon_r
      icon_R = 'ICON_GREEN_LIGHT'.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name                        = ICON_R
        TEXT                        = ' '
        INFO                        = ' '
        ADD_STDINF                  = 'X'
       IMPORTING
         RESULT                      = ICON
      EXCEPTIONS
        ICON_NOT_FOUND              = 1
        OUTPUTFIELD_TOO_SHORT       = 2
        OTHERS                      = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      endmodule.
    where icon(35) and icon_r(35) type c .
    hope this helps u..
    Regards
    Aparna

  • Status icons on tabstrip controls

    Hello
    I have a problem displaying the status icon on a tabstrip control.
    I've created an infotype. On the tabstrip control, I've added texteditors and status icons.The status icon is there as an indication to state whether there is information populated in the texteditor.
    The texteditors all have information populated in them. Whenever I run the infotype on PA30, the status icon does not appear. It only appears when I click on the texteditor button which is not what i want it to do.
    On PA30,I would like the ICON to appear when there is information in the texteditor and not when I click on the texteditor button.
    Please advice me on how to fix this problem.
    Thanks
    Adhil Ramruthan

    REPORT  ZICON_CONTROL.
    tables: icon.
    controls: tc type tableview using screen 100.
    data: begin of it_data occurs 0,
           icon(4),
           value(02),
          end of it_data.
    "Based on condion you populate the ICON data here
    "if the case is editable and then you have to do the same in PBO
    it_data-icon = '@0A@'."ICON_RED_LIGHT.
    it_data-value = '00'.
    append it_data.
    it_data-icon = '@08@'. "ICON_GREEN_LIGHT.
    it_data-value = '01'.
    append it_data.
    call screen 100.
    *&      Module  transfer_data  OUTPUT
    *       text
    module transfer_data output.
    read table it_data index tc-current_line.
    endmodule.                 " transfer_data  OUTPUT
    Flow logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    loop at it_data with control tc.
      module transfer_data.
    endloop.
    PROCESS AFTER INPUT.
    loop.
    endloop.
    MODULE USER_COMMAND_0100.

  • Using Insert and Delete icons in table control wizard.

    Can anyone tell me how to perform a new row insertion or deletion in a table created using the table control wizard.
    I see there is a form fcode_insert_row and fcode_delete_row, but dont know how to call them and what parameters to pass and all.
    Since iam new to SAP-ABAP, some code samples will be a great help.
    Thanks to all in advance.

    Hi Lavanya ,
    You have to add the icons personally in the table control.. . Put fcode for addition button as INSE and delete as DELE ..coding will be already thr in the wizard no need to anything just add icons in the table control by selecting from f4 help on icons option of screen.
    Thanks,
    Vishnu .

  • Dynamic pushbotton-icon in table control

    Hello,
    in my table control i have a pushbutton.
    i want to display it with a dynamic icon
    is this possible ?
    thanks very much for your answers
    Helmut

    Hi Anubhab,
         Thanks. With your help i could able to solve the problem. Let me put this in some
    more detail.
    When we are pulling the field from a table to table control we need to make sure the fields should have a data elements. After pulling all the fields to a table control ,we need to drag out  and delete the current table control column headings and then drop in the (new) I/O fields into their place.  I then set the text on these new fields within the PBO.  If we try to drop the (new) I/O fields on top of the existing ones with out deleting it won't work.
    Thanks & Regards.
    Srikanth

  • Pushbutton Icon in Table Control

    Hi Guys,
    I have a table control that contains a push button in each row.  How can I place and remove an icon for a specific row?
    Thanks.

    Try something like this
    * In your dynpro, after PBO
    LOOP AT t_output WITH CONTROL itab_ctrl
                                  CURSOR  itab_ctrl-current_line.
        MODULE screen.
      ENDLOOP.
    MODULE screen OUTPUT.
      base = itab_ctrl-current_line.
    loop at screen.
    icon_name = 'ICON_RED_LIGHT'. "This is an example: use your icon
    CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name                  = icon_name
            add_stdinf            = ' '
          IMPORTING
            RESULT                = t_output-icon "This is the field you use as pushbutton
          EXCEPTIONS
            icon_not_found        = 1
            outputfield_too_short = 2
            OTHERS                = 3.
    modify screen.
    endloop.
    ENDMODULE.
    Edited by: Simone Milesi on May 4, 2010 2:40 PM

  • Hand mouse icon in Table Controle

    Hi Guys,
    Is it possible to change the mouse icon into a hand in a table controle when it pass over a field?
    This field must call other transaction filling the Parameter ID with your content.
    Att.

    Hi
    I don't think, you should use an ALV grid setting a cell available for hotspot
    Max

  • GUI Status not working (table control)

    Hello Friends,
    i have created one subscreen (with Table control). This subscreen shows a table. This subscreen is called with a transaktion. Now the problem enters when i want to get out of the screen . i can not! the exit buitton does not work, and i can not move or get out even my commands do not obey!
    Does it has to do with my Gui_Satus?
    How do i use it appropiately.
    Best Regards

    hello ,
    i think you havent set Function Type = 'E' for that Exit/Cancel Buttions.
    in PAI
    module exit at exit-command.
    module exit.
    case sy-ucomm.
      when 'EXIT'.
              set screen 0.
             leave screen.
    endmodule.
    regards
    Prabhu

  • Redlight in Table Control

    Hi Friends,
    I want to display diffrent lights ( reg light icon or green or other) in table control column depends on some condition.
    Can you please help me on this. Thanks in Advance.
    Thanks & Regards,
    Murali Krishna K

    . Create program in SE38 type module pool and Activated
    2. Go to SE51 give the program name and screen number then Layout Editor in drags table control with wizard.
    3. Start the Wizard give the table control name (TBCL)>click the continue>give the Internal table name >Continueàselect the filed(MATNR) or Fields>continue>continue>check the Scroll check box>continue>continue-->click the completed --> Save --> Activated.
    4.Add the Status Icon into Table Control(drag the Icon into table contol ) and Change the Code for Status Icons Below
    DATA:  STA_ICON10     TYPE ICONS-TEXT,
                  ICON_NAME(20)  TYPE C,
    PROCESS BEFORE OUTPUT.
      MODULE STATUS_0102.
    Code:
    MODULE STATUS_ICONS OUTPUT.
    SELECT SINGLE *
    FROM MARA
    WHERE MATNR = TB_TABLE-MATNR.
    IF SY-SUBRC <> 0.
    ICON_NAME = 'ICON_LED_RED'.
    ELSE.
    ICON_NAME = 'ICON_LED_GREEN'.
    ENDIF.
    CALL FUNCTION 'ICON_CREATE'
    EXPORTING
    NAME = ICON_NAME
    INFO = 'STATUS'
    ADD_STDINF = 'X'
    IMPORTING
    RESULT = STA_ICON10
    EXCEPTIONS
    ICON_NOT_FOUND = 1
    OUTPUTFIELD_TOO_SHORT = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.   ENDIF.
    ENDMODULE.                 " STATUS_ICONS  OUTPUT
    Message was edited by:
            Durga Vinta

  • How to display icon status in table control

    hi, i trying to display icon in table control its not displaying
    i given below statment.
    DATA: BEGIN OF WA_MARA,
            ICON1(4) TYPE C,
             END OF WA_MARA.
         INCLUDE <list>.
    MOVE ICON_GREEN_LIGHT TO IT_MARA-ICON1.
    APPEND IT_MARA..
    when i debugging it display green icon but after run the program its display ' @08@ '   in table control.
    how to display green icon in table control help me.

    Hi,
    check the link:
    Table control in custom infotypes

  • How to use PF status in Table Control?

    I have made 1 table control. Now I need to use three buttons like SELECT, DESELECT, DELETE the rows of table control using PF STATUS.  Can you plz help with the Code.

    Hi.
    Refer this code.
    The following example processes a table control with LOOP with parallel loop using an internal table. By using function codes you can sort columns and delete rows from the internal table. The ready for input status of the table control fields is controlled using a function code.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
          lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      DESCRIBE TABLE itab LINES lines.
      flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
      ENDCASE.
    ENDMODULE.
    Reward all helpfull answers.
    Regards.
    Jay

  • How to handle double click in a table control?

    Hi,
    Can any one let me how to handle double click event in a table control in dialog programming?
    here i need to navigate to another screen when user double click on the table contols (emp number column).
    thanks in advance,
    PrasadBabu.

    to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
    Table Control Question
    Check the above thread which was posted recently on SDN, please award points if found helpful

  • Set cursor in table control field

    I have developed module using table control have done validation for one field on Enter key press.In change mode if user changes value in table control field and presses Enter key then system is showing Error message on status bar and table control gets gray out.
    if user again hits Enter key then this error message clears and Table control is in Edit mode.
    Here I wan that Cursor should go to same filed from which error message occurred.
    I have written Get Cursor In PAI event and Set Cursor in PBO after Loop at table control. I tried Set cursor within Lop at Table control in PBO.
    But cursor is not coming on that field of table control.
    I have written set cursor as below:
    Set Cursor Field itab-fieldname Line lineno Offset offsetval.
    Here itab is internal table assigned to table control.
    Please let me know why cursor is not setting on particular field on table control.

    Hi Ganesh,
       A simpler way would be to include the fields of the table in a chain-endchain block.
    in PAI section.
    PROCESS AFTER INPUT.
      loop at IT_FINAL.
        chain.
          field WA_FINAL-JOBCARD.
          field WA_FINAL-MATIDTAG.
          field WA_FINAL-VORNR.
          field WA_FINAL-ARBPL.
          field WA_FINAL-ZZPULLCONTNRQTY.
          field WA_FINAL-NOOFTAGS.
          field WA_FINAL-ROUTE_TO.
       module validate.
        endchain.
      endloop.
    you can issue your error messages in the module validate.
    REgards,
    Ravi

  • Status control icon  display in table control

    Hi,
    In the workarea the field of status control icon is showing Red/green/yellow that is ok but when i am modifying the internal table from this work area then text(Red or green something...) is coming insted of status Icon.
    So how to modify internal table from this workarea so that i can display icon in my table control's internal table ?Your input is highly appreciated..
    Thanx
    Prince  Raja

    DATA : c_green(4) TYPE c VALUE '@08@',
           c_red(4) TYPE c VALUE '@0A@'.
          IF flag = 'X'.
            READ TABLE it_output INTO is_output WITH KEY
                                      bukrs = is_final-bukrs
                                      anln1 = is_final-anln1
                                      anln2 = is_final-anln2
                                      BINARY SEARCH.
            IF sy-subrc = 0.
              is_output-c_icon  = c_green.
              is_output-leabg_n = is_final-leabg.
              is_output-message = it_return-message.
    * Modify the output internal table with the changed new values
              MODIFY it_output FROM is_output
                               TRANSPORTING c_icon leabg_n message
                               WHERE bukrs = is_output-bukrs
                                 AND anln1 = is_output-anln1
                                 AND anln2 = is_output-anln2.
            ENDIF.
    Regards
    Gopi

  • Is it possible to add icons to a field in the table control  ?

    Dear Gurus,
               Greetings..............
    Is it possible to add icons to the line item of  a field in the table control ?
    Thanks in advance
    Raj Kumar

    HI
    YES IT IS POSSIBLE.
    DO THE FOLLOWING
    1.DECLARE INCLUDE <ICON>.
    2.IN YOUR INTERNAL TABLE DECLARE FIELD ICON
    icon(4) TYPE c,
    3. POPULATE YOUR INTERNAL TABLE WITH APPROPRIATE ICONS BY SELECTING FROM INCLUDE SPECIFIED ABOVE.
    EG:
    wa2-icon = '@5C@'.
    4.PASS IT TO FIELDCAT
    wa_fieldcat-fieldname = 'ICON'.
        wa_fieldcat-icon = 'X'.            " Displayed as Icon
      wa_fieldcat-tabname = ' '.
      wa_fieldcat-seltext = 'Status'.
      wa_fieldcat-coltext = text-001.
      APPEND wa_fieldcat TO it_fieldcat.

Maybe you are looking for

  • Problem with Officejet Pro 8600 wireless printing

    HP Officejet Pro 8600 will no longer print wirelessly from laptop, but will from IPad and Android phone using Samsung and Google Print. Used to work fine. Unaware of any changes to settings in either printer or computer setup. Have gone thru all trou

  • Exporting JPG

    Does anyone know if there is a way to eliminate the extra space when you export a file as a jpeg? for example.....I have a document that i use for a business card template and it is 3.5" wide.  When I have an image that I want to use as the backgroun

  • How to change the dynamically  LOV value to old value if it errors out

    We have an use case like when a value is selected from LOV, some validations(EO validations) occur on that and if the validation fails we are throwing exception.But the new value is appearing in LOV text box. We need to display the old value in the L

  • Calling GOS attachment service

    Dear experts, I need to call the GOS method for attaching documents to an object from my ABAP pgm. I use the method CL_GOS_VIEW_MANAGER->START_SERVICE_DIRECT with the service 'CREATE_ATTA'. Before that I have created an object referring to CL_GOS_MAN

  • How to Hide FPM Close button

    Hi, I have created one FPM application. When that application is called from portal, an aditional button 'CLOSE' is appearing. I did not put that button to FPM application and when I test the application from R/3, the button is not appearing. But it