Dynamically changing selection mode in component SALV_WD_TABLE

I want to programmatically change the selection mode in component SALV_WD_TABLE. I've embedded the component in one of my own components. Under one circumstance, I want multiple selection to be possible, under another, I only want single selection capability.
I've set the context in my component, which is mapped to the SALV_WD_TABLE usage component, so that the relevant node has selection cardinality 0..n. The approach I'd like to take, is to programmatically set the selection cardinality to 0..n in the first scenario, and 0..1 in the second. But I can't figure out how to do that, or even if it's possible!
Is it possible to set the selection cardinality programmatically - if so, how? If it isn't, is there another way I can achieve the same functionality?
Thanks
matt

Hi,
You can do that.
See IF_SALV_WD_TABLE_SETTINGS method set_selection_mode method.
get the config table like this
lr_table_settings ?= wd_this->alv_config_table.
lr_table_settings->set_selection_mode( CL_WD_TABLE=>E_SELECTION_MODE-MULTI ).
use constants from
CL_WD_TABLE=>E_SELECTION_MODE-AUTO

Similar Messages

  • Dynamic change selected columns

    hi all,
    Created an anwers with 5 columns:
    level1 | level2 | level3 | level4 | facts
    I created a session filter on all the level columns. Like this:
    level1 = session.value or
    level2 = session.value or
    level3 = session.value or
    level4 = session.value
    Now i want to dynamic change the columns depended on wich column contains the session value.
    For example: level2 contains the session value. The ouput I (want to) expect:
    level1 | level2 | facts
    Hope someone can help with this...tnx in advanced

    More information at this link:
    http://oraclebizint.wordpress.com/2007/11/16/oracle-bi-ee-101332-using-indexcol-function-varying-underlying-columns-based-on-user-login/
    Hope this helps
    Swapan.

  • Dynamically change table selecting from

    in 3.2 on 11g database is there a way to dynamically change the table used in a select statement for an interactive report? I have a series of similar tables, one for each month of the year. I want to click a month on one page and bring up a report from the table for that month. I want to use one page for this report and have all links from previous page link to the same page, just different result based on what month was clicked.
    I know I could just setup 12 different reports and conditionally display each region based on a value passed to the that page, but I'd prefer to only create one page & one report on that page.
    Thanks for any ideas or solutions.

    Your function will have the code dynamically built.. What you do is you build your sql and pass in the table name and any other items that will change based upon your requirements..
    here is an example...
    function inventory_report (p_State IN VARCHAR2) RETURN VARCHAR2 IS
    declare
      q varchar2(4000);
    begin
      q:='   select p.category, ';
      q:=q||'       p.product_name, ';
      q:=q||'       p.quantity, ';
      q:=q||'       p.unit_price '; 
    -- Here is where we substitute the passed in state name for the data table we extract data from
      q:=q||'  from ' || V('p_State') || ' p, ';
      q:=q||' where p.product_quantity > 0 ';
      return q;
    end;Thank you,
    Tony Miller
    Webster, TX

  • Dynamical changing HtmlInputText component style on failed validation...

    ...but once validation passes the modified style isn't reset...and when navigating away from the page and then back again, the component will still have the modified style.
    this is for JSF1.1 because i understand JSF1.2 has a errorStyle property.
    I understand once first entry the components are rendered and then stored in a component tree for subsequent display, but because i have dynamical changed the style property it seems to be stored in the component tree.
    here is snippets of my code
    JSP page
    <h:inputText id="textName" styleClass="inputText" *validator="#{fieldValidators.validateText}"* value="#{customer.name}" required="true">
    <f:validateLength minimum="1" maximum="40"></f:validateLength>
    </h:inputText>
    _FieldValidators class_
    public void validateText(FacesContext context, UIComponent toValidate, Object value)
    ((UIInput)toValidate).setValid(false);
    *((HtmlInputText)toValidate).setStyleClass("inputText inputValidationError");*
    FacesMessage message = new FacesMessage(errorMessage);
    context.addMessage(toValidate.getClientId(context), message);
    the style class +inputValidationError+ sets the outline of the input type to be red. so input components highlight in red when validation fails.
    so to recap my issue, when the failed validation is corrected, the component still has the +inputValidationError+ style applied, and when navigating away from the page and back to it +inputValidationError+ still is in its style, so still appears with the red border.
    any help or recommendations would be really welcome.
    thanks.

    Implement a PhaseListener which listens on the afterPhase of the RENDER_RESPONSE and get the clientId of all components which have a validation error by FacesContext#getClientIdsWithMessages() and put it in a HashSet or so. Then iterate recursively over all children of UIViewRoot and if it is an instance of UIInput, then (re)set the styleclass accordingly based on the presence of its clientId in the HashSet created before.

  • Dynamically changing tree node

    I'm having a problem when dynamically changing a JTree node. I can add a node to the tree no problem. If I then change the name of the node (via a property table in the app) and fire a node changed event, the change is not properly reflected in the tree, in that the new name is shown but the selection box remains the same size as the old (longer) name.
    If I manually click on the node with the mouse and then change the name everything works fine. Although this is only manifesting itself as a cosmetic problem I think this could be a timing problem that might show up under other circumstances. I have another tree in the app where this problem does not show up at all.
    Any ideas?
    Thanks

    1)fluctuating tree...what???
    2) Create a JPopUpMenu or a subclass. Add a mouselistener to the JTree.
    In this listener you handle rightMouseClick.
    When you detect such an mouse action open the popup with popup.show()
    If you need the selected component call JTree.getLastSelectedPathComponent().
    If you want to check if it is null use this: JTree.getSelectionModel().isSelectionEmpty(). So you can prevent nullpointers, cause selection can be empty
    You can write a method for your popup to give it the selected component.
    Then call the .show().
    Tweety

  • JTable about selection mode, setting a Color to rows and column.

    I need an application with a table containing Double and String data. When the table is shown the Double data must be shown as selected. I need a special kind of selection mode similar to MULTIPLE_INTERVAL_SELECTION but it must be a mode as if CONTROL was pressed when the user left clicks the table so he or she can select and deselect columns without deselecting those wich have been selected previously... Besides I need to paint columns and rows only if they have certain conditions. This is an example of what I have done so far... The selection mode is what is really important.
    UsingJTable.java
    package mytables;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.ListSelectionModel;
    import javax.swing.table.TableColumn;
    public class UsingJTable extends JFrame {
    private static final long serialVersionUID = 1L;
    private JPanel panel = null;
    private JTable table = null;
    private JButton[] buttonArray = null;
    private JPanel buttonsPanel = null;
    public UsingJTable() {
    panel = new JPanel(); 
    table = new JTable( new MyOwnTableModel() );
    JScrollPane sPane = new JScrollPane( table ); 
    sPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
    sPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED );
    panel.setOpaque( true );
    panel.add( sPane );
    buttonsPanel = new JPanel();
    buttonsPanel.setLayout( new FlowLayout() );
    buttonArray = new JButton[ 5 ];
    for( int i = 0; i < buttonArray.length; i++ ) {
    buttonArray[ i ] = new JButton( "columna " + i );
    buttonArray[ i ].addActionListener( new ColumnListener( i ) );
    buttonsPanel.add( buttonArray[ i ] );
    table.setRowSelectionAllowed( false );
    table.setColumnSelectionAllowed( true );
    ListSelectionModel csm = table.getColumnModel().getSelectionModel();
    csm.setSelectionInterval( 0, table.getColumnCount() );
    csm.removeSelectionInterval( 0, table.getColumnCount() - 3 );
    csm.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
    this.setTitle( "Using JTable" );
    this.getContentPane().add( panel );
    this.getContentPane().add( buttonsPanel, BorderLayout.SOUTH );
    this.setSize( 500, 500);
    this.setVisible( true );
    this.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    class ColumnListener implements ActionListener {
    private boolean pressed = false;
    private int column = 0;
    public ColumnListener( int col) {
    this.setColumn( col );
    public void actionPerformed(ActionEvent e) {
    TableColumn tColumn = table.getColumnModel().getColumn( column );
    Color c;
    if ( !pressed )
    c = Color.YELLOW;
    else
    c = Color.WHITE;
    table.setVisible( false );
    tColumn.setCellRenderer( new MyCellRenderer( c ) );
    table.setVisible( true );
    pressed = !pressed;
    public int getColumn() {
    return column;
    public void setColumn(int column) {
    this.column = column;
    public static void main( String args[] )
    new UsingJTable();
    } MyOwnTableModel.java
    package mytables;
    import javax.swing.table.AbstractTableModel;
    public class MyOwnTableModel extends AbstractTableModel {
    private static final long serialVersionUID = 1L;
    private Object data[][] = null;
    private String columnNames[] = null;
    private int rowCount = 0;
    private int columnCount = 0;
    public MyOwnTableModel() {
    initData();
    initColumnNames();
    this.setRowCount( data.length );
    this.setColumnCount( columnNames.length );
    public int getColumnCount() {
    return columnCount;
    public int getRowCount() {
    return rowCount;
    public Object getValueAt(int r, int c) {
    return data[ r ][ c ];
    private void initData() {
    data = new Object[4][5];
    data[ 0 ][ 0 ] = new String("Hern�n");
    data[ 0 ][ 1 ] = new String("Amaya");
    data[ 0 ][ 2 ] = new Integer( 23 );
    data[ 0 ][ 3 ] = new Double( 61.5 );
    data[ 0 ][ 4 ] = new Double( 1.71 );
    data[ 1 ][ 0 ] = new String("Mariana");
    data[ 1 ][ 1 ] = new String("Amaya");
    data[ 1 ][ 2 ] = new Integer( 25 );
    data[ 2 ][ 3 ] = new Double( 75 );
    data[ 2 ][ 4 ] = new Double( 1.65 );
    data[ 2 ][ 0 ] = new String("Nicol�s");
    data[ 2 ][ 1 ] = new String("Coniglio");
    data[ 2 ][ 2 ] = new Integer( 23 );
    data[ 2 ][ 3 ] = new Double( 88.5 );
    data[ 2 ][ 4 ] = new Double( 7.85 );
    data[ 3 ][ 0 ] = new String("Juan Pablo");
    data[ 3 ][ 1 ] = new String("Garribia");
    data[ 3 ][ 2 ] = new Integer( 24 );
    data[ 3 ][ 3 ] = new Double( 70.2 );
    data[ 3 ][ 4 ] = new Double( 1.76 );
    private void initColumnNames() {
    columnNames = new String[ 5 ];
    columnNames[ 0 ] = "Nombre";
    columnNames[ 1 ] = "Apellido";
    columnNames[ 2 ] = "Edad";
    columnNames[ 3 ] = "Peso";
    columnNames[ 4 ] = "Altura";
    public String[] getColumnNames() {
    return columnNames;
    public void setColumnNames(String[] columnNames) {
    this.columnNames = columnNames;
    public Object[][] getData() {
    return data;
    public void setData(Object[][] data) {
    this.data = data;
    public void setColumnCount(int columnCount) {
    this.columnCount = columnCount;
    public void setRowCount(int rowCount) {
    this.rowCount = rowCount;
    public Class getColumnClass(int c) {
    return data[0][c].getClass();
    public String getColumnName(int c) {
    return columnNames[ c ];
    } MycellRenderer.java
    package mytables;
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    public class MyCellRenderer extends DefaultTableCellRenderer {
    private static final long serialVersionUID = 1L;
    private Color cellColor = null;
    public MyCellRenderer( Color c )
    setCellColor( c );
    public Component getTableCellRendererComponent
    (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    // Obtains default cell settings
    Component cell = super.getTableCellRendererComponent ( table, value, isSelected, hasFocus, row, column);
    cell.setBackground( getCellColor());
    return cell;
    public Color getCellColor() {
    return cellColor;
    public void setCellColor(Color cellColor) {
    this.cellColor = cellColor;
    }

    Interesting concept! This is what I have tried and it works, but in the application I need the user to deselect the columns he wants only by left clicking on them... This is the main idea: there will be lots of columns (String and Double data). The user must deselect the Double columns he or she does not want to be processed... Maybe with a boolean array that changes it state if a user left clicks a column... but I suppose this method is called only once to initialize the table, isn't it? Thanks.
    <code>
    table = new JTable( new MyOwnTableModel() ) {
    public boolean isCellSelected(int row, int column) {
    MyOwnTableModel model = (MyOwnTableModel) this.getModel();
    if( model.getColumnClass( column ) == Double.class )
    return true;
    return false;
    </code>

  • Problem with dynamic change a page item value

    Hi,
    I'm trying to dynamically calculated the value of an item based on a simple formula that involves the multiplication of two elements from the same page.
    To do this, create dynamic action as follows:
    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: SQL Statement
    SQL Statement: SELECT :P19_DURATION * :P19_RATE FROM DUAL
    Page items to submit: P19_DURATION
    Selection Type: Item(s)
    Item(s): P19_AMOUNT
    When altering the P19_DURATION get no change in P19_AMOUNT
    Since my knowledge of javascript is almost zero, I'm trying to do this with pl / sql or sql. Try the dynamic action with a function or a PL / SQL statement and nothing works.
    Have to use javascript for this?
    Searching the forum I think it's something simple, but I did not find an example similar to what I need.
    Regards

    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: javascript
    javascript Code:
    amount = $v('P19_DURATION') *  $v('P19_RATE');
    $s('P19_AMOUNT',amount);

  • Dynamically changing internal table in 'gui_download'

    Hi Experts,
                     i have to download 4 internal tables, each with different structures, to the presentation server using 'gui_download', based on which radio-button is selected in the selection screen. I am hoping to use a single 'form' and 4 'perform' calls. how can I dynamically change the tables in the 'gui_download' function modules.
    plz help.....................

    Hi ,
    Build the field catalog dynamically based on the internal table structure based on the radio button selected.Use the dynamic internal table generated from the filedcatalog and use in GUI_DOWNLOAD.
    See the below code:
    *& Report  ZRAJESH02
    REPORT  zrajesh02.
    Dynamic internal table
    TYPE-POOLS: slis.
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                  <dyn_wa>.
    DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
          it_fldcat TYPE lvc_t_fcat.
    DATA: lv_monate TYPE f,
          lv_months TYPE i,
          lv_date TYPE sy-datum,
          p_check1 type n value '1'.
    lv_date = sy-datum + 360.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_check TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis   = lv_date
          i_datum_von   = sy-datum
          i_kz_incl_bis = ' '
        IMPORTING
          e_monate      = lv_monate.
      lv_months = lv_monate.
      PERFORM f_fcat USING 'AUFNR' 'CHAR' '12'.
      PERFORM f_fcat USING 'POSNR' 'CHAR' '06'.
      while p_check1 LE p_check.
      PERFORM f_fcat USING p_check1 'CHAR' '1'.
      p_check1 = p_check1 + 1.
      endwhile.
      PERFORM build_dyn_itab.
      LOOP AT <dyn_table> INTO <dyn_wa>.
        WRITE:/ <dyn_wa>.
      ENDLOOP.
    FORM f_fcat USING fieldname dattyp length.
      DATA:wa_it_fldcat TYPE lvc_s_fcat.
      CLEAR wa_it_fldcat.
      wa_it_fldcat-fieldname = fieldname.
      wa_it_fldcat-datatype = dattyp.
      wa_it_fldcat-intlen = length.
      APPEND wa_it_fldcat TO it_fldcat .
    ENDFORM.                    "f_fcat
    *&      Form  build_dyn_itab
          text
    FORM build_dyn_itab.
      DATA: new_table TYPE REF TO data,
      new_line TYPE REF TO data.
    wa_it_fldcat TYPE lvc_s_fcat.
    CLEAR wa_it_fldcat.
    wa_it_fldcat-fieldname = 'AUFNR'.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 12.
    APPEND wa_it_fldcat TO it_fldcat .
    CLEAR wa_it_fldcat.
    wa_it_fldcat-fieldname = 'POSNR'.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 6.
    APPEND wa_it_fldcat TO it_fldcat .
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = new_table.
      ASSIGN new_table->* TO <dyn_table>.
    Create dynamic work area and assign to FS
      CREATE DATA new_line LIKE LINE OF <dyn_table>.
      ASSIGN new_line->* TO <dyn_wa>.
    ENDFORM.                    "build_dyn_itab
    Thanks,
    Rajesh.

  • Displaying dynamically changing image: a problem with JLabel.

    Hello! I use NetBeans 5.5 and I develop my GUI with Matisse. I'm rather a beginner in developing GUIs with this editor...
    I'd like to display a dynamically changing image. The idea is: GUI shows the image, that is modified as some computations run in a different thread. App will be run on a single machine.
    I'm trying to display the image as a label's icon. The problem is that my app's frame can be resized - and when it is, the label also resizes. When the label is resized, the image should also be resized - the image should always be of the same size as the label. The problem? I noticed, that it works only when I make my app's bigger. When I try to lower its dimensions, the label's dimensions remain the same. Why the label don't make its size smaller?
    My code works as follows: when app's main frame is resize, the panel (the one, that the label is placed in) is also resized. And, since the label is in the panel, it (should) also be resized. So I wrote all the resize-events handlers (therefore I know that the resize event is sent when my app's frame is resized, and when the panel is resized - but the label is resized only when it grows bigger). In this methods I modify the image displayed in the label (I resize the image).
    Or, perhaps, there is some other way to show a (dynamically changing) image with Swing... I chose JLabel, because I didn't want to write my own JComponent. JLabel can display image and that is all I need. The problem is: when the label grows bigger, I create a new, bigger image (icon). Why my label don't get smaller (the resize event isn't even sent)?

    There is no component that dynamically resizes an image. You need to create your own. Something like this:
    JComponent component = new JComponent()
         protected void paintComponent(Graphics g)
              //  Scale image to size of component
              g.drawImage(yourImage, 0, 0, getWidth(), getHeight(), null);
    };

  • Dynamic change the ALV layout

    Alle experts:
    In ALV layout report, how to dynamic change the layout int ABAP porgram?
    e.g. I have save 5 layout, I need to change them base the my selection in ABAP program? How to do this?
    Thanks in advance!

    Try to call fieldcatlog dymnamically. Refer tofollowing code. Reward if helpful.
    REPORT  zfir0001 MESSAGE-ID ztax.
                               Tables
    TABLES : glt0, t001, skat.
                          Internal Tables
    DATA: BEGIN OF itab OCCURS 0,
            racct               LIKE   glt0-racct,    "Account number
            txt20               LIKE   skat-txt20,    "G/L account short text
            co_1000          LIKE     glt0-hslvt,     "Balance carried forward for company code 1000
            co_1100          LIKE     glt0-hslvt,     "Balance carried forward for company code 1100
            co_1200          LIKE     glt0-hslvt,     "Balance carried forward for company code 1200
    DATA : BEGIN OF itab1 OCCURS 0,
             bukrs LIKE glt0-bukrs,
             waers LIKE t001-waers,
           END OF itab1.
    DATA : BEGIN OF it_itab1 OCCURS 0.
            INCLUDE STRUCTURE glt0.
    DATA : END OF it_itab1.
                          Data Declarations
    DATA : w_total   LIKE glt0-hslvt,
           w_count   LIKE glt0-bukrs,
           w_flg     TYPE c,
           lv_count  TYPE i.
          w_slash   TYPE c VALUE ' '.
                          Selection screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE tit1.
    SELECT-OPTIONS : s_bukrs FOR glt0-bukrs OBLIGATORY,
                     s_racct FOR glt0-racct OBLIGATORY,
                     s_ryear FOR glt0-ryear OBLIGATORY,
                     s_rldnr FOR glt0-rldnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      tit1 = 'Please select:'(004).
      TYPE-POOLS: slis.                                 "ALV Declarations
      DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
            gd_tab_group TYPE slis_t_sp_group_alv,
            gd_layout    TYPE slis_layout_alv,
            gd_repid     LIKE sy-repid.
    ********Geting the selected company code in table itab1****
    START-OF-SELECTION.
      IF NOT s_bukrs-high IS INITIAL.
        itab1-bukrs = s_bukrs-low.
        APPEND itab1.
        w_count = s_bukrs-low.
        DO.
          IF s_bukrs-high = w_count.
            EXIT.
          ELSE.
            w_count =  w_count + 1.
          ENDIF.
          SELECT SINGLE * FROM t001
              WHERE bukrs = w_count.
          IF sy-subrc = 0.
            itab1-bukrs = w_count.
            APPEND itab1.
            CLEAR itab1.
          ENDIF.
        ENDDO.
      ELSE.
        itab1-bukrs = s_bukrs-low.
        APPEND itab1.
      ENDIF.
      SELECT * FROM glt0 INTO CORRESPONDING FIELDS OF TABLE it_itab1
              WHERE rldnr   IN s_rldnr
              AND   bukrs   IN s_bukrs
              AND   ryear   IN s_ryear
              AND   racct   IN s_racct.
      SORT it_itab1 BY bukrs.
      LOOP AT it_itab1.
        AT END OF racct.
          w_flg = 'X'.
        ENDAT.
        SELECT SINGLE txt20 INTO (itab-txt20) FROM skat
                  WHERE spras = sy-langu
                  AND   saknr = it_itab1-racct.
        PACK it_itab1-racct TO it_itab1-racct.
        itab-racct = it_itab1-racct.
        w_total = it_itab1-hsl01 + it_itab1-hsl02 + it_itab1-hsl03 + it_itab1-hsl04 +
                  it_itab1-hsl05 + it_itab1-hsl06 + it_itab1-hsl07 + it_itab1-hsl08 +
                  it_itab1-hsl09 + it_itab1-hsl10 + it_itab1-hsl11 + it_itab1-hsl12 +
                  w_total        + it_itab1-hslvt.
        IF w_flg = 'X'.
          READ TABLE itab1 WITH KEY bukrs = it_itab1-bukrs.
          IF sy-subrc = 0.
            SELECT SINGLE * FROM t001
                WHERE bukrs = itab1-bukrs.
            IF t001-waers = 'JPY' OR
               t001-waers = 'HUF'.
              w_total =  w_total * 100.
            ENDIF.
            CASE it_itab1-bukrs.
              WHEN '1000'.
                itab-co_1000 = w_total.
              WHEN '1100'.
                itab-co_1100 = w_total.
              WHEN '1200'.
                itab-co_1200 = w_total.
            ENDCASE.
            COLLECT itab.
            CLEAR: itab, w_flg, w_total.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SORT itab BY racct.
      IF NOT itab[] IS INITIAL.
        PERFORM field_cat1.
        lv_count = 1.
        LOOP AT itab1.
          PERFORM field_cat USING itab1-bukrs.
        ENDLOOP.
        PERFORM display_alv_report .
      ELSE.
        MESSAGE s000 WITH 'No records Found'(003).
      ENDIF.
    *&      Form  display_alv_report
          text
    FORM display_alv_report .
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = gd_repid
          is_layout          = gd_layout
          it_fieldcat        = i_fieldcat[]
          i_save             = 'X'
        TABLES
          t_outtab           = itab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_alv_report
    *&      Form  field_cat1
          text
    FORM field_cat1 .
      i_fieldcat-col_pos     =  0.
      i_fieldcat-fieldname   = 'RACCT'.
      i_fieldcat-seltext_m    = 'Account'(001).
      i_fieldcat-fix_column = 'X'.
    i_fieldcat-emphasize   = 'X'.
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
      i_fieldcat-col_pos     =  1.
      i_fieldcat-fieldname   = 'TXT20'.
      i_fieldcat-seltext_m    = 'Description'(002).
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.                                                    "field_cat1
    *&      Form  field_cat
          text
         -->XV_BURKS   text
    FORM field_cat USING xv_burks TYPE char4.
      lv_count = lv_count + 1.
      i_fieldcat-col_pos     = lv_count.
      CONCATENATE 'CO_' xv_burks INTO i_fieldcat-fieldname.
      i_fieldcat-seltext_m    = xv_burks.
    i_fieldcat-just = 'C'.
    i_fieldcat-no_zero = 'X'.
    i_fieldcat-do_sum = 'X'.
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.   "field_cat
    Edited by: dhanashree wadkar on Apr 30, 2008 6:00 AM

  • How can I dynamically change a Grids ro color

    Hi,
    I am using a grid within a component in my Flex application.
    I have an XML dataProvider, and I want to change the row
    colour of my Grid depending on a value coming form my dataProvider
    – but I cant seem to get this to work :(
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    For example:
    Within my component I have the following grid within an
    “MXML” component called myGrid.mxml:
    [CODE]<mx:Grid id="GGrid">
    <mx:GridRow backgroundColor="0xCFD8DA">
    <mx:GridItem>
    <mx:Label id=”name_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    <mx:GridRow backgroundColor="0xCFD8DA">
    <mx:GridItem>
    <mx:Label id=”expiryDate_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    <mx:GridRow id=”statusRow”>
    <mx:GridItem>
    <mx:Label id=”status_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    </mx:Grid>[/CODE]
    I am setting/declaring my results/variables form my
    dataProvider in the main Application (“MXML”) file:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*"
    creationComplete="initApp()" >
    <mx:HTTPService
    id="myResults"
    url="
    http://localhost/myResults.xml"
    resultFormat="e4x"
    result="myResultHandler(event)" />
    [CODE]<mx:Script>
    <![CDATA[
    import mx.core.Application;
    [Bindable]
    public var myDataFeed:XML;
    public function initApp():void
    myResults.send();
    public function myResultHandler(event:ResultEvent):void
    myDataFeed = event.result as XML;
    Application.application.myGrid.name_lbl.text =
    myDataFeed.name;
    Application.application.myGrid.expiryDate_lbl =
    myDataFeed.expiry;
    Application.application.myGrid.status_lbl.text =
    myDataFeed.status;
    if(myDataFeed.status == “OK”)
    Application.application.statusRow.backgroundColor="0xCFD8DA";
    else if (myDataFeed.status == “WARNING”)
    Application.application.statusRow.backgroundColor="0xFF9900";
    else if (myDataFeed.status == “CRITICAL”)
    Application.application.statusRow.backgroundColor="0xFF0000";
    ]]>
    </mx:Script>
    </mx:Application>[/CODE]
    however, I cannot access the property
    “backgroundColor” of the gridRow in this way:
    [CODE]Application.application.statusRow.backgroundColor[/CODE]
    As I get the following error:
    [CODE]Severity and Description Path Resource Location
    Creation Time
    Id 1119:
    Access of possibly undefined property backgroundColor through
    a reference with static type mx.containers:GridRow.
    enterpriseDB_new enterpriseDB_new.mxml
    line 721 1194443056449 19295[/CODE]
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    Thanks,
    Jon.

    quote:
    Originally posted by:
    ljonny18
    Hi,
    I am using a grid within a component in my Flex application.
    I have an XML dataProvider, and I want to change the row
    colour of my Grid depending on a value coming form my dataProvider
    – but I cant seem to get this to work :(
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    Thanks,
    Jon.
    Hi,
    a few hours ago I stumbled across this cookbook entry - it
    didn't solve MY problem, but maybe it provides a way to solve your
    problem?
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=61&product Id=2&loc=en_US
    From the article:
    quote:
    Changing the background color of a DataGrid cell is not as
    simple as changing some style because the default renderer for a
    DataGrid cell does not have a backgroundColor. Therefore, to do
    this simple task, you have to create a custom itemRenderer where
    you draw your own background in the updateDisplayList function.
    HTH
    Uwe

  • Dynamically Change Ni HSDIO Channels

    I am currently using a PXI-6552 to generate and acquire I2C waveforms simultaneous.  I would like to know if it is possible (and how I would go about it) to dynamically change channels.  My goal is to just pass the two NI-HSDIO references (the purple variables) to a new subVI that I will create to change from 5 channels to a different set of 5 channels.  For instance:
    Pseudo-Code:
    initalize PXI sessions;
    for(i = 0; i < 10; i++)
    Set channels 0-5;
    Run generate and acquire;
    Stop acquisition;
    Set channels to 6-10;
    Run generate and acquire;
    Stop acquisition;
    Set channels to 11-15;
    Run generate and acquire;
    Stop acquisition;
    close PXI sessions;
    Basically I need the quickest way to switch acquisition channels without having to initalize and close the sessions every time. 
    I am currently using the HWC functions downloaded in the .zip example from here: http://www.ni.com/example/31200/en/. (I also attached the two that are necessary for my problem).
    Init HWC Device.vi:  (also attached)
    Run HWC Device.vi:  (also attached)
    I believe the VIs I may need are Assign Dynamic Channels, Configure Idle State, and Configure Initial State.  However I am not sure if those are the only ones.  If it is possible, do I have to close the original channels and then assign more?  Or does re-calling "Assign Dynamic Channels" automatically disable all non-assigned channels?  Etc.
    The important things to note:  I am setting 5 channels at a time -- for both acquisition AND generation.   I need to close the channels and switch to 5 different channels -- for both acquisition AND generation.  All channels should be set to "z" state for high-impedance at all times.
    If you need any other information, please let me know!  Thank you in advance for any suggestions/assistance.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!
    Solved!
    Go to Solution.
    Attachments:
    Init HWC Device.vi ‏24 KB
    Run HWC Device.vi ‏30 KB

    Through trial and error I was able to come up with a way to do this:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • Dynamic change of headings in SQL Report

    Can you dynamically change a reports Column Heading Text. I want a selected value from the database to become 1 of the column headings.

    If you are ready to take bit of trouble and modify the generated package body. you can try the following.
    1. go to the procedure show_internal in the generated package body.
    2. you will see PORTAL30.wwv_user_utilities.add_other_arguments(
    3. 'p_other_args' parameter has "_col_headings" as one of the values.
    4. the corresponding 'p_other_vals' values will show up in the report column heading. [ an example is PORTAL30.wwv_user_lang.lang('Empno') ]
    So if you can pass your 'dynamic' heading values here, you can change the report heading dynamically.

  • Dynamic date selections in a variant

    Hi All,
    I need to dynamically change the date field of a report which runs every month end. Our working calendar is designed such that the last working day is the last Friday of the current period and hence the first working day is the last Saturday of the previous period. Now we have Fiscal Calendar variant which takes care of the last Friday part. I also know we have to select 'D' in the variant screen but my problem is in assigning the Last Saturday of the previous period in the date range field. Any hints or suggestions on this would be highly appreciated and of course rewarded generously.
    Thanks & Regards,
    Rajesh

    Hi Rajesh,
    After seecting Selection Variable "D" you have to carry out following things to cater your requirements;
    (a) Goto Name of Variable (input only using F4)
    (b) Select your variable depending upon your business requirement.
    Current Date
    From month start to today
    Current date +/- ??? days
    current date +/- ??? work days
    First day of current month
    <b>nth working day of current month</b>
    First day of next month
    First day of previous month
    Last day of previous month
    Last Day of the Current Month
    First quarter ????
    Second quarter ????
    Third quarter ????
    Fourth quarter ????
    Current date - xxx,current date + yyy
    Date - xxx, Date + yyy (work days)
    Previous month
    Current period
    (Beginning of mth-xx months, end of mth+yy months)
    I think nth working day of current month is suitable for your requirement.
    Bye,
    Muralidhara

  • Dynamically change sql query (from statement)

    Hi all,
    Is it possible to change the 'from statement' dynamically in
    report 6i? I have 3 identical tables with different names (each
    to collect data in different area) and I want to be able to
    dynamically change the sql query at run time so I can use only
    one (1) report to print data in 3 different tables.
    Is it possible? Thanks for the tip!

    Yes you can. Create a user parameter lets say "frm". give the
    initial value for the parameter as the table a. Ex : FROM EMP .
    Go to the datamodel of the report . Change the query like this,
    Original query => Select * from emp
    Modified query => Select * &frm
    Coz frm has the default value FROM EMP, so it will replace the
    default value. When you call the report from differrent product
    you can pass the parameter value as table a, table b , table x.
    Hope you got your answer.
    Thanx
    Feroz

Maybe you are looking for

  • HP Officejet Pro 7680 all in one printer

    I have a 7680 officejet pro printer which is not fully printing the black text on print jobs which are not set to " fine" on the print function.  I have replaced the cartridge and tried several times to clean the printhead using the machine's "clean

  • Imovie video at 7 frames per second?

    I'm working on a stop motion piece that's meant to run at 7 fps, but the slowest I can seem to make it run in imovie is 10 fps. Is it possible to get this video to work at my desired frame rate, or is 10 fps the slowest the program will allow?

  • G4 Quicksilver as a file server

    I'm planning to make my G4 Quicksilver 2x iGhz / 1 GB into a file server connected via ethernet to my other intel machines. I have various SATA HDs that I plan to populate the G4 with interfacing to an OWC Firmtek SeriTek / 1V4 4 port 1.5 Gb/s eSATA

  • Scroll bar with htmlText

    im doing it like this right now [code] <mx:Accordion id="password" width="100%" height="100%"> <mx:VBox label="How do I reset my password?" width="100%" height="100%"> <mx:Text width="100%" height="100%"> <mx:htmlText> <![CDATA[blah blah blah blah bl

  • Strange Icon apeared  ......

    I just turned on my iphone and it had a strange little icon in the statusbar. On the top right next to the battery was a small blue cicle with a cross in the middle of it. I turned it off and on but it didnt go away. Nothing seems to be unoward with