ALV Table: DROPDOWN-Column with different valuesets per row

Hello,
I tried to create a dropdown by index cell in a table with different valuesets in each row. So I created an attribute VALUESET of type WDR_CONTEXT_ATTR_VALUE_LIST in my node to provide different valuesets per element. In my ALV-table I bound the property "valueset_fieldname" of the dropdown-cell to the context-attribute VALUESET:
  lo_column = lo_alv_model>if_salv_wd_column_settings~get_column( id = 'PRICE').
  CREATE OBJECT lo_drop_down_idx
    EXPORTING
      selected_key_fieldname = u2018PRICEu2019.
  lo_drop_down_idx->set_valueset_fieldname( value = u2018VALUESETu2019 ).
  lo_column->set_cell_editor( lo_drop_down_idx ).
Now I have the problem, that the list of the dropdown-cell displays the proper amount of values but not the proper texts . My valueset looks for example like this:
Value: A
Text:  A
Value: B
Text:  B
Value: C
Text:  C
Value: D
Text:  D
But my Dropdown-cell shows these values:
A
A
A
D
Could you please help?
Edited by: Developer on Feb 2, 2010 5:32 PM

Hello Lekha,
thank you for your answer. I think there might be an other reason for this problem. When I debug the view with the Webdynpro-Debugger the valueset in the context contains the correct values but the dropdown shows wrong values.
You also sent me a link with a codesample. In this coding you use the following statement:
lr_drp_idx->set_texts( 'VALUESET'   ). This is a method of the class CL_WD_DROPDOWN_BY_IDX. I used the class cl_salv_wd_uie_dropdown_by_idx as I'm working with an ALV-Table. This class doesn't have the method set_texts. Instead it has a method called 'set_valueset_fieldname'. Maybe this method has a bug?
Regards,

Similar Messages

  • Action on alv table dropdown field

    Hello Gurus,
    i have alv table with some fields .in that one field is dropdown contains YES and NO values.if i select YES value for that field i
    need to set some fields in editable mode in that same row or else if i select NO value those fields are in greyout.
    this is my requirement.how can i achive this requirement.could you suggest me on this.could you send me sample code or
    reference links if poosible.
    Could anyone please suggest solutions?
    and if possible send me the sample code for this requirement.
    Thanks in Advance for your replies.
    Regards,
    Babu

    Hi,
    Create a context attribute READ_ONLY in the node to whcih the ALV is bound.
    Implement the column settings.
    For those columns which you want to make them enable/disbale for those columns
    create a input field  CL_SALV_WD_UIE_INPUT_FIELD for that alv config object CL_SALV_WD_CONFIG_TABLE.
    there are many thread on the same please search SCN.
    data lo_config type ref to cl_salv_wd_config_table. "model object
    * GET THE MODEL OBJECT USING CODE WIZARD
    *GET THE COLUMN SETTINGS GET_COLUMNS of IF_SALV_WD_COLUMN_SETTINGS of CL_SALV_WD_CONFIG_TABLE
    * LOOP AT THESE COLUMNS and create an INPUT field for those columns to enable/disbale
    * pass this read_only field name
    lo_input->GET_READ_ONLY_FIELDNAME
    VALUE( 'READ_ONLY' ).
    First Time  in WDODOINIT-
    I suppose that dropdown column as NO for all rows.
    If that dropdown column name is CHOOSE
    LOOP AT IT_TAB into WA_ITAB.
    IF wa_itab-choose = 'NO'.
    wa_itab-read_only = abap_true. "disbale
    ELSE.
    wa_itab-read_only = abap_false. "Enabale
    ENDIF.
    ENDLOOP.
    Next when the drop down is selected then ON_DATACHECK event gets triggered (or check for other event also)
    Implement this event handler
    You will get the index in this Method importing parameters
    Try to read the node at that index. - USe code wizard
    DATA LO_NODE type ref to if_wd_context_node.
    LO_NODE = WD_context->get_child_node ( 'TEST' ). "node name
    LO_ELEMENT = LO_NODE->GET_ELEMENT ( index = lv_index ).
    if LO_ELEMENT is bound.
    LO_ELEMENT->set_static_attribute
    importing
    name = 'READ_ONLY'
    exporting
    value = abap_false.  "enable
    endif.
    Hope this helps.
    Regards,
    Lekha.

  • In Alv table, a column is editable mode, but want few cells in read only

    Hi All,
    I have a ALV table which column A and B.
    Both are in editable mode. I want to make fews in column B, to be read only.
    How to make it. Please help me.
    Thanks
    Vimalraj

    hi,
    refer this program,
    *& Report  ZALV_COLOR_DISPLAY_EDIT
    REPORT  zalv_color_display_edit.
    TYPE-POOLS: slis.
    TABLES : zcust_master2.
    INTERNAL TABLE DECLARATION
    TYPES : BEGIN OF wi_zcust_master2,
            zcustid LIKE zcust_master2-zcustid,
            zcustname LIKE zcust_master2-zcustname,
            zaddr LIKE zcust_master2-zaddr,
            zcity LIKE zcust_master2-zcity,
            zstate LIKE zcust_master2-zstate,
            zcountry LIKE zcust_master2-zcountry,
            zphone LIKE zcust_master2-zphone,
            zemail LIKE zcust_master2-zemail,
            zfax LIKE zcust_master2-zfax,
            zstat LIKE zcust_master2-zstat,
            field_style  TYPE lvc_t_styl,
    END OF wi_zcust_master2.
    DATA: it_wi_zcust_master2 TYPE STANDARD TABLE OF wi_zcust_master2
                                                     INITIAL SIZE 0,
          wa_zcust_master2 TYPE wi_zcust_master2.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER
    line,
          wa_fieldcat TYPE lvc_s_fcat,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM set_specific_field_attributes.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'ZCUSTID'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER ID'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCUSTNAME'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER NAME'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZADDR'.
      wa_fieldcat-scrtext_m   = 'ADDRESS'.
      wa_fieldcat-col_pos     = 2.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCITY'.
      wa_fieldcat-scrtext_m   = 'CITY'.
      wa_fieldcat-col_pos     = 3.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTATE'.
      wa_fieldcat-scrtext_m   = 'STATE'.
      wa_fieldcat-col_pos     = 4.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCOUNTRY'.
      wa_fieldcat-scrtext_m   = 'COUNTRY'.
      wa_fieldcat-col_pos     = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZPHONE'.
      wa_fieldcat-scrtext_m   = 'PHONE NUMBER'.
      wa_fieldcat-col_pos     = 6.
    wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZEMAIL'.
      wa_fieldcat-scrtext_m   = 'EMAIL'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZFAX'.
      wa_fieldcat-scrtext_m   = 'FAX'.
      wa_fieldcat-col_pos     = 8.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTAT'.
      wa_fieldcat-scrtext_m   = 'STATUS'.
      wa_fieldcat-col_pos     = 9.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program = gd_repid
          is_layout_lvc      = gd_layout
          it_fieldcat_lvc    = it_fieldcat
          i_save             = 'X'
        TABLES
          t_outtab           = it_wi_zcust_master2
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          text
    -->  p1        text
    <--  p2        text
    FORM data_retrieval .
      DATA: ld_color(1) TYPE c.
      SELECT zcustid zcustname zaddr zcity zstate zcountry zphone zemail
    zfax zstat UP TO 10 ROWS FROM zcust_master2 INTO CORRESPONDING FIELDS OF
    TABLE it_wi_zcust_master2.
    ENDFORM.                    "data_retrieval
    *&      Form  set_specific_field_attributes
          populate FIELD_STYLE table with specific field attributes
    FORM set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    Populate style variable (FIELD_STYLE) with style properties
    The following code sets it to be disabled(display only) if 'ZFAX'
    is NOT INITIAL.
      LOOP AT it_wi_zcust_master2 INTO  wa_zcust_master2.
        IF  wa_zcust_master2-zfax IS NOT INITIAL.
          ls_stylerow-fieldname = 'ZFAX' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                          "set field to disabled
          APPEND ls_stylerow  TO  wa_zcust_master2-field_style.
          MODIFY it_wi_zcust_master2  FROM  wa_zcust_master2.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "set_specific_field_attributes
    Regards,
    K.Tharani.

  • One Key FIgure in more than one column with different restrictions

    Hi,
      I am using a key figure in more than one column with different restrictions, but restriction in one column is affecting the result in other column. What shall i do to make it independent from one another??

    Hi Pravender Chauhan,
        If you want in Single column different value for different Rows based on same Key Figure, you can create Structure where you can define different logic for each row but using same key figure.
    If you want to use different Key figures then you should have to Restricted Key Figure and for any calculation you can use calculated Key figure.
    Assign points if Useful.
    Regards,
    Rajdeep.

  • How can I setup an .indd with two columns with different threads so that I can export to epub?

    Hi all. Sorry, english is not my native language. I´ve made an .indd: each page has two columns with different threads (is a bilingual text). When I export this .indd to .epub only appears one column from a thread following the next thread. What can i do to fix this? My indesign is CS6
    Thank you

    There are fixed format EPUB files as can be used for children's books, etc. where there are a lot of illustrations. However, those are very work-intensive to produce. I've never worked on one.
    Anne-Marie Concepcion did a Lynda.com video on producing one.
    Rorohiko produces a product called ePubCrawler which can help in produced fixed format EPUB files:
    Fixed Layout EPUB Assistant In InDesign: ePubCrawler | Rorohiko ...

  • Want to update a column with  different column of same table

    I have a table TEST_CDR which is having 250 millions records also having partition by hash.
    there are two column in this table ID and CDR_ID want to update ID in CDR_ID but it take too much time like 24 hours or more.
    please suggest me a simple way.

    Hi,
    You can try this. but be careful about your backups and go through CTAS,nologging and parallel concepts...
    Please refer this link.
    http://www.dba-oracle.com/t_fast_batch_updates_ctas.htm
    http://www.dba-oracle.com/t_nologging_append.htm
    http://www.dba-oracle.com/t_efficient_update_sql_dml_tips.htm
    http://eriglen.blogspot.in/2011/08/ctas-create-table-as-select-with.html
    1.CTAS with nologging and parallel..
    SQL> create table test_cdr_1(id,cdr_id) nologging parallel as select id,id from test_cdr;
    2.rebuild indexes, triggers and constraints to test_cdr_1
    3.rename test_cdr to bkup_test_cdr;
    4.rename test_cdr_1 to test_cdr;
    Regards,
    ragunath.

  • Return only the columns with different values.

    Hi all,
    I am trying to solve a seemingly trivial problem but can't seem to get any straight answer anywhere in any forum. Consider a single table with 5 columns and only two rows:
    row_id           first_name         last_name        age            gender
    1                    John                  doe               27             M
    1                    Jane                  doe               27              F  Assume there is no primary key or any other constraint. Also assume that there are only and only two rows in this table. So I basically need a query that, in the above set of rows, would return first_name and gender, as they are the only differing columns in the two rows, and also their values. Even if i can somehow get the column names that are differing that would be enough as I can easily access the values later on. Also it is important to remember that I may not know the column names of all the columns, so basically I somehow must utilize user_tab_columns in the process.
    Any help appreciated.
    Edited by: 894302 on May 1, 2013 10:35 AM

    Hi,
    894302 wrote:
    There is nothing wrong with it. Here you have added all the columns in the decode statement as you already know all the column names. What if there is a table whose column names are unknown i.e I can pass the table as a parameter to a procedure and I would need to loop through all the columns and then perform this operation.Table- and column names must be hard-coded into the query. If you want to figure out what the columns are at run time, given only hte table name, then you need dynamic SQL.
    All the column names are in the data dictionary view all_tab_columns. You can easily loop through them to build exactly as many lines like
    DECODE (a.row_id,     b.row_id,     NULL, 'row_id,')     ||as you need in the SELECT clause. The FROM clause is dynamic, too: it has the variable table name in 2 places.
    But i am not sure if it worth the effort to do it on the database side. Probably easier to do it on the middle tier such as .NET, which where the business logic is implemented in my company.I don't know much about .NET, so I can't compare them
    It's not very hard to do in PL/SQL (as dynamic SQL goes).
    Edited by: Frank Kulash on May 1, 2013 4:39 PM
    Here's a function that does the dynamic SQL:
    CREATE OR REPLACE FUNCTION  different_columns
    (  in_table_name  IN  VARCHAR2
    ,  in_owner_name  IN  VARCHAR2     DEFAULT USER
    RETURN VARCHAR2
    IS
        return_str     VARCHAR2 (4000);
        sql_str     VARCHAR2 (1000);
    BEGIN
        sql_str := 'SELECT  RTRIM ( ';
        FOR  c  IN ( SELECT    column_name
                          ,        ROW_NUMBER () OVER (ORDER BY  column_id  DESC)  AS r_n
                          FROM        all_tab_columns
               WHERE        owner     = in_owner_name
               AND        table_name     = in_table_name
               ORDER BY  column_id
        LOOP
            sql_str := sql_str || '                DECODE (a.'
                         || c.column_name
                      || ', b.'
                      || c.column_name
                      || ', NULL, '''
                      || c.column_name
                      || ', '')';
         IF  c.r_n > 1
         THEN
             sql_str := sql_str || ' ||';
         END IF;
         sql_str := sql_str || CHR (10);
        END LOOP;
        sql_str := sql_str || '              , '', '''     || CHR (10)
                                || '              )'          || CHR (10)
                     || 'FROM  "' || in_owner_name
                     || '"."' || in_table_name
                     || '" a'                    || CHR (10)
                     || 'JOIN  "' || in_owner_name
                     || '"."' || in_table_name
                     || '" b ON a.ROWID < b.ROWID';
        -- dbms_output.put_line (sql_str);     -- for debugging
        EXECUTE IMMEDIATE   sql_str  INTO  return_str;
        RETURN  return_str;
    END  different_columns;
    SHOW ERRORSYou can call it in SQL like this:
    SELECT     different_columns ('RHIT_TABLE_X')  AS dc
    FROM     dual
    ;Using PL/SQL, we might not need RTRIM, at least not in the query. I'll leave that as an exercise.

  • Dynamic Table UI Element with different data type for each cell

    Hi Experts,
    I have a problem with a dynamic Table UI Element in Web Dynpro ABAP. I have the following coding:
    METHOD set_col_row .
      TYPE-POOLS: icon.
      DATA:
        lv_node         TYPE REF TO if_wd_context_node,
        lv_node_info    TYPE REF TO if_wd_context_node_info,
        lv_element      TYPE REF TO if_wd_context_element,
        lt_attributes   TYPE wdr_context_attr_info_map,
        lv_table        TYPE REF TO cl_wd_table,
        lv_table_column TYPE REF TO cl_wd_table_column,
        lv_text_view    TYPE REF TO cl_wd_text_view,
        lv_image TYPE REF TO cl_wd_image,
        lv_text_edit TYPE REF TO cl_wd_text_edit,
        lv_header       TYPE REF TO cl_wd_caption,
        attribute       LIKE LINE OF lt_attributes,
        lv_index       TYPE string,
        lv_cur_row         TYPE i,
        path            TYPE string,
        lv_value           TYPE string,
        attr_name       TYPE string,
        l_trc_point_id  TYPE string,
        l_num_cols      TYPE string,
        l_num_rows      TYPE string,
        lv_text         TYPE string,
        lv_index2 TYPE i,
        lr_ress_selections TYPE REF TO /its/di_2_cpr_ress_selections,
        lt_comp_tab TYPE cl_abap_structdescr=>component_table,
        ls_comp_tab LIKE LINE OF lt_comp_tab,
        lv_count TYPE i,
        lv_col_count TYPE i,
        lv_col_count_read TYPE i,
        lv_index_read TYPE i,
        lv_num_cols_minus_1 TYPE i,
        lv_bind_lv_value TYPE string,
        wd_standard_cell TYPE REF TO cl_wd_table_standard_cell,
        lv_data_count TYPE i,
        lv_data_count_str TYPE string,
        wd_table_column TYPE REF TO cl_wd_table_column,
        lv_column_id TYPE string.
      FIELD-SYMBOLS:
         TYPE ANY.
    Instanz der Klasse /ITS/DI_2_CPR_RESS_SELECTIONS
      lr_ress_selections = /its/di_2_cpr_ress_selections=>factory( ).
      ASSIGN lr_ress_selections->gr_table->* TO gt_comp_tab.
      ls_comp_tab-name = 'SUMME'.
    APPEND ls_comp_tab TO lt_comp_tab.
    ls_comp_tab-name = 'CELL_VARIANT'.
      APPEND ls_comp_tab TO lt_comp_tab.
      CLEAR ls_comp_tab.
      l_num_rows = num_rows + 1.
      CONDENSE l_num_rows.
      l_num_cols = num_columns + 1.
      CONDENSE l_num_cols.
    UI-Element 'TABLE'
      lv_table ?= wd_this->m_view->get_element( 'TBL_TABLE' ).
      lv_table->remove_all_columns( ).
    Kontext-Knoten 'TABLE'
      lv_node = wd_context->get_child_node( 'TABLE' ).
      lv_node_info = lv_node->get_node_info( ).
      lv_node_info->remove_dynamic_attributes( ).
      attribute-type_name = 'STRING'.
      lv_num_cols_minus_1 = num_columns - 1.
    Für jede Spalte einmal tun
      DO lv_num_cols_minus_1 TIMES.
        lv_index = sy-index + 1.
        CONDENSE lv_index.
        lv_table_column = cl_wd_table_column=>new_table_column( ).
        lv_column_id = lv_table_column->id.
    Spaltenüberschriften setzen
        IF lv_index EQ 1. "Beim ersten Durchlauf --> erste Spalte = "Ressourcen"
          lv_text = text-010.
          sy-index = 0.
        ELSE. "Danach für jede weitere Spalte eine Zeile aus der gt_comp_tab nehmen
          lv_index_read = lv_index - 1.
          READ TABLE lt_comp_tab INDEX lv_index_read INTO ls_comp_tab.
          lv_text = ls_comp_tab-name.
          lv_header = cl_wd_caption=>new_caption( text = lv_text ).
          lv_table_column->set_header( lv_header ).
        ENDIF.
        CONCATENATE 'TABLE.A' lv_index INTO path.
        lv_text_view = cl_wd_text_view=>new_text_view( bind_text = path ).
        lv_table_column->set_table_cell_editor( lv_text_view ).
        lv_table_column->bind_selected_cell_variant( 'TABLE.CELL_VARIANT' ).
        lv_table->add_column( lv_table_column ).
        wd_table_column ?= wd_this->m_view->get_element( lv_column_id ).
    *****************Test Cell Variant*************************************************
        IF lv_index GT 1.
          LOOP AT .
              IF sy-tabix EQ lv_cur_row.
              Name zuweisen
                ASSIGN COMPONENT 'NAME' OF STRUCTURE .
              Zuweisen ob Blatt oder nicht
                lv_element->set_attribute( name = 'NAME' value = lv_value ).
                ASSIGN COMPONENT 'IS_LEAF' OF STRUCTURE set_attribute( name = attr_name value = lv_value ).
              ENDIF.
        ENDLOOP.
    Now my problem is, that I need for every ROW of my table UI Element a different cell editor. I know how to change it for the column. But is not my issue. I want to have images (traffic lights red and green) in some rows. The other rows should have numbers. The coding works, so that I have all the data at the right place in my table, only the images are shown as a string, because the cells of these rows have the cell editor Text_View. I tried something with cell variants (with cl_wd_table_standard_cell), but it was not possible for me to get a cell variant "image" in these cells/rows were I need it. 
    I hope you understand my problem and now what to do here.
    Thanks a lot in advance.
    Best Regards,
    Ingmar

    Hi Experts, I have a problem with a dynamic Table UI Element in Web Dynpro ABAP. I have the following coding: METHOD set_col_row . TYPE-POOLS: icon. DATA: lv_node TYPE REF TO if_wd_context_node, lv_node_info TYPE REF TO if_wd_context_node_info, lv_element TYPE REF TO if_wd_context_element, lt_attributes TYPE wdr_context_attr_info_map, lv_table TYPE REF TO cl_wd_table, lv_table_column TYPE REF TO cl_wd_table_column, lv_text_view TYPE REF TO cl_wd_text_view, lv_image TYPE REF TO cl_wd_image, lv_text_edit TYPE REF TO cl_wd_text_edit, lv_header TYPE REF TO cl_wd_caption, attribute LIKE LINE OF lt_attributes, lv_index TYPE string, lv_cur_row TYPE i, path TYPE string, lv_value TYPE string, attr_name TYPE string, l_trc_point_id TYPE string, l_num_cols TYPE string, l_num_rows TYPE string, lv_text TYPE string, lv_index2 TYPE i, lr_ress_selections TYPE REF TO /its/di_2_cpr_ress_selections, lt_comp_tab TYPE cl_abap_structdescr=>component_table, ls_comp_tab LIKE LINE OF lt_comp_tab, lv_count TYPE i, lv_col_count TYPE i, lv_col_count_read TYPE i, lv_index_read TYPE i, lv_num_cols_minus_1 TYPE i, lv_bind_lv_value TYPE string, wd_standard_cell TYPE REF TO cl_wd_table_standard_cell, lv_data_count TYPE i, lv_data_count_str TYPE string, wd_table_column TYPE REF TO cl_wd_table_column, lv_column_id TYPE string. FIELD-SYMBOLS:  LIKE LINE OF lt_attributes,  TYPE ANY TABLE,  TYPE ANY,  TYPE ANY,  TYPE ANY. * Instanz der Klasse /ITS/DI_2_CPR_RESS_SELECTIONS lr_ress_selections = /its/di_2_cpr_ress_selections=>factory( ). ASSIGN lr_ress_selections->gr_table->* TO . lt_comp_tab = lr_ress_selections->gt_comp_tab. ls_comp_tab-name = 'SUMME'. * APPEND ls_comp_tab TO lt_comp_tab. * ls_comp_tab-name = 'CELL_VARIANT'. APPEND ls_comp_tab TO lt_comp_tab. CLEAR ls_comp_tab. l_num_rows = num_rows + 1. CONDENSE l_num_rows. l_num_cols = num_columns + 1. CONDENSE l_num_cols. * UI-Element 'TABLE' lv_table ?= wd_this->m_view->get_element( 'TBL_TABLE' ). lv_table->remove_all_columns( ). * Kontext-Knoten 'TABLE' lv_node = wd_context->get_child_node( 'TABLE' ). lv_node_info = lv_node->get_node_info( ). lv_node_info->remove_dynamic_attributes( ). attribute-type_name = 'STRING'. lv_num_cols_minus_1 = num_columns - 1. * Für jede Spalte einmal tun DO lv_num_cols_minus_1 TIMES. lv_index = sy-index + 1. CONDENSE lv_index. lv_table_column = cl_wd_table_column=>new_table_column( ). lv_column_id = lv_table_column->id. * Spaltenüberschriften setzen IF lv_index EQ 1. "Beim ersten Durchlauf --> erste Spalte = "Ressourcen" lv_text = text-010. sy-index = 0. ELSE. "Danach für jede weitere Spalte eine Zeile aus der gt_comp_tab nehmen lv_index_read = lv_index - 1. READ TABLE lt_comp_tab INDEX lv_index_read INTO ls_comp_tab. lv_text = ls_comp_tab-name. lv_header = cl_wd_caption=>new_caption( text = lv_text ). lv_table_column->set_header( lv_header ). ENDIF. CONCATENATE 'TABLE.A' lv_index INTO path. lv_text_view = cl_wd_text_view=>new_text_view( bind_text = path ). lv_table_column->set_table_cell_editor( lv_text_view ). lv_table_column->bind_selected_cell_variant( 'TABLE.CELL_VARIANT' ). lv_table->add_column( lv_table_column ). wd_table_column ?= wd_this->m_view->get_element( lv_column_id ). ******************Test Cell Variant************************************************** IF lv_index GT 1. LOOP AT  ASSIGNING . ASSIGN COMPONENT 'TYPE' OF STRUCTURE  TO . ADD 1 TO lv_data_count. lv_data_count_str = lv_data_count. CONCATENATE 'A' lv_index lv_data_count_str INTO path. wd_standard_cell = cl_wd_table_standard_cell=>new_table_standard_cell( view = wd_this->m_view variant_key = 'FLDATE' ). IF  = '01' OR  = '04'. lv_image = cl_wd_image=>new_image( bind_source = path view = wd_this->m_view ). wd_standard_cell->set_editor( lv_image ). wd_standard_cell->set_cell_design( '01' ). ELSE. lv_text_view = cl_wd_text_view=>new_text_view( bind_text = path view = wd_this->m_view ). wd_standard_cell->set_editor( lv_text_view ). wd_standard_cell->set_cell_design( '02' ). ENDIF. wd_table_column->add_cell_variant( wd_standard_cell ). ENDLOOP. ENDIF. ************************************************************************************* CONCATENATE 'A' lv_index INTO attribute-name. lv_node_info->add_attribute( attribute ). ENDDO. DO num_rows TIMES." Für jede Zeile einmal tun lv_cur_row = sy-index. lv_element = lv_node->create_element( ). lv_node->bind_element( new_item = lv_element set_initial_elements = abap_false ). DO l_num_cols TIMES. ADD 1 TO lv_col_count. IF lv_count LT 1. LOOP AT  ASSIGNING . IF sy-tabix EQ lv_cur_row. * Name zuweisen ASSIGN COMPONENT 'NAME' OF STRUCTURE  TO . "NAME lv_value = . * Zuweisen ob Blatt oder nicht lv_element->set_attribute( name = 'NAME' value = lv_value ). ASSIGN COMPONENT 'IS_LEAF' OF STRUCTURE  TO . "NAME lv_value = . lv_element->set_attribute( name = 'IS_LEAF' value = lv_value ). ENDIF. ENDLOOP. ENDIF. IF lv_count GT 0. lv_col_count_read = lv_col_count - 1. lv_index = sy-index. LOOP AT  ASSIGNING . IF sy-tabix EQ lv_cur_row. CLEAR ls_comp_tab. READ TABLE lt_comp_tab INDEX lv_col_count_read INTO ls_comp_tab. ASSIGN COMPONENT ls_comp_tab-name OF STRUCTURE  TO . lv_value = . CONDENSE lv_index. CONCATENATE 'A' lv_index INTO attr_name. lv_element->set_attribute( name = attr_name value = lv_value ). ENDIF. ENDLOOP. ENDIF. lv_count = lv_count + 1. ENDDO. CLEAR lv_col_count. CLEAR lv_count. ENDDO. ENDMETHOD. I definied my table in Layout Tab of the View and create here in thos method dynamicly my columns. lv_table_column = cl_wd_table_column=>new_table_column( ). . . lv_table->add_column( lv_table_column ). In  I have my data that should be shown later in my table. So I create for each row in this fieldsymbol in a loop: lv_element = lv_node->create_element( ). lv_node->bind_element( new_item = lv_element set_initial_elements = abap_false ). Later I fill every cell in my table with a different value with this loop: LOOP AT  ASSIGNING . IF sy-tabix EQ lv_cur_row. CLEAR ls_comp_tab. READ TABLE lt_comp_tab INDEX lv_col_count_read INTO ls_comp_tab. ASSIGN COMPONENT ls_comp_tab-name OF STRUCTURE  TO . lv_value = . CONDENSE lv_index. CONCATENATE 'A' lv_index INTO attr_name. lv_element->set_attribute( name = attr_name value = lv_value ). ENDIF. ENDLOOP. Now my problem is, that I need for every ROW of my table UI Element a different cell editor. I know how to change it for the column. But is not my issue. I want to have images (traffic lights red and green) in some rows. The other rows should have numbers. The coding works, so that I have all the data at the right place in my table, only the images are shown as a string, because the cells of these rows have the cell editor Text_View. I tried something with cell variants (with cl_wd_table_standard_cell), but it was not possible for me to get a cell variant "image" in these cells/rows were I need it. I hope you understand my problem and now what to do here. Thanks a lot in advance. Best Regards, Ingmar

  • Insertion a record in a table having columns of different charsets using OLEDB

    My development environment -
    Database -> Microsoft SQL Server
    2008 R2
    OS -> Windows Server
    2008 R2
    Database Charset -> Chinese_PRC_CI_AS (Windows
    936)
    Operating System Charset -> Chinese
    Below table is having varchar fields with different charsets.
    create
    table dbo.tcolcs1 (
        c1 int
    not
    null
    primary
    key,
        c2 varchar(30)
    collate SQL_Latin1_General_Cp1_CI_AS ,
        c3 varchar(30)
    collate Chinese_PRC_CI_AS
    I want to insert below record using OLEDB APIs provided by Microsoft. Just for information, character '0x00C4' does not
    belong to Windows 936 codepage.
    insert
    into dbo.tcolcs1
    values (10,
    NCHAR(0x00C4), NCHAR(0x4EBC))
    Code snippet -
    DBPARAMBINDINFO bind_info
    memset(&bind_info,
    0, sizeof(DBPARAMBINDINFO));
    bind_info.pwszDataSourceType = L"DBTYPE_VARCHAR";
    bind_info.wType = DBTYPE_STR;
    I have bound the varchar field with DBTYPE_STR. I can see that my code is not inserting Latin1 character (0x00C4) correctly
    into the table. The code always inserts a blank character into Latin1 column (c2) and 0x4EBC into Chinese column (c3).
    Later, I changed the binding from DBTYPE_STR to DBTYPE_BYTES as below -
    bind_info.pwszDataSourceType = L"DBTYPE_BINARY";
    bind_info.ulParamSize =
    0;              
    bind_info.wType = DBTYPE_BYTES;
    With the above change, I observed that OLEDB is converting hex value to string. It is inserting 0x00C4 as 'C4' and 0x4EBC
    as '4EBC'. I also tried with adding 'AutoTranslate=no' in driver connection string, but it did not help. How can I insert above record with OLEDB in the above table ?
    Thanks in advance.

    Did you try making fields as unicode?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • 2 SDO_GEOM columns with different coord systems

    Hi
    I have an intersection (traffic lights, etc.) that when shown on the map is a point and its position is stored as Lat/Long. However, when I zoom in on this intersection I need to be able to bring up a schematic (detailed plan) which will be in some cartesian coords.
    My thought is to store the schematic data as a geometry collection in the same table as the rest of the data.
    Is this possible?
    And, are there any traps I should be looking for?

    You are free to mix geometries with different coordinate systems in a table, as long as all the geometries in a given column of the table have the same coordinate system. This should support what you are trying to do with expanded levels of detail in your point features.

  • Uix table with multiple lines per row

    Hi,
    how can I design a table that has multiple lines for one row.
    It should look like this
    row1-cell1 row1-cell2
    row1-cell3 row1-cell4
    row2-cell1 row2-cell2
    row2-cell3 row2-cell4
    Thanks a lot.
    Christian

    Christian,
    I'll scribble down a quick example off the top of my head...
    <table data:tableData="${mydata}">
    <column>
    <stackLayout>
    <link text="cell1"/>
    <link text="cell3"/>
    </stackLayout>
    </column>
    <column>
    <stackLayout>
    <link text="cell2"/>
    <link text="cell4"/>
    </stackLayout>
    </column>
    </table>
    I recommend you just play around with UIX XML, and you'll find something that works.
    Hope this helps,
    Ryan

  • Download Internal table to Excel with different Tabs -  ole2_object

    Hi All,
    I am using  ole2_object to download the data from internal table to Excel file. As per different values in sorting key, data will be downloading in different tab in same Excel file.
    In my internal table one field is of character type and some times contains number as value.
    e.g.  itab-code = ‘000002’.
    While downloading to Excel, Excel consider this value as numeric and remove the leading zero.
    Any suggestions for how to set format property as ‘Text’ for this cell, will highly appreciated.
    Sample  code -
       data: gs_excel type ole2_object,
             gs_wbooklist type ole2_object,
             gs_application type ole2_object,
             gs_wbook type ole2_object,
             gs_activesheet type ole2_object,
             gs_sheets type ole2_object,
             gs_newsheet type ole2_object,
             gs_cell type ole2_object.
       create object gs_excel 'EXCEL.APPLICATION'.
       get property of gs_excel 'workbooks' = gs_wbooklist.
       get property of gs_wbooklist 'Application' = gs_application.
       set property of gs_application 'SheetsInNewWorkbook' = 1.
       call method of gs_wbooklist 'Add' = gs_wbook.
       get property of gs_application 'ActiveSheet' = gs_activesheet.
       set property of gs_activesheet 'Name' = datasheet_name.
      call method of gs_excel 'Cells' = gs_cell exporting #1 = v_row           
                                              #2 = v_col.
      set property of gs_cell 'value' = <f>.
    GET PROPERTY OF gs_cell 'Font' = gs_Font.
    SET PROPERTY OF gs_Font 'Bold' = 1 .
    Thanks.
    Regards,
    Meenakshi.

    Hello,
    Just concatenate ' infont of the fields, which you want to treat as a text.
    Like,
    itab-code = '00002'.
    concatenate '''' itab-code  into itab-code.
    modify itab.
    You can also set the text properties of the cell by,
      SET PROPERTY OF gs_cell 'NumberFormat' = '@' .
    but, it will remove the leading zeros and set the format as text.
    Regards,
    Naimesh

  • How to show the contents of a dropdown list with different colors

    Hi,
    I have a drop downlist on my dialog. I want to show each of its text attribute and its back ground with different color.
    Suppose I am showing 4 strings in the dropdown like Name1, Name2, Name3 and Name4, then how to change the color of each name and its background.
    Please let me know if it is possible.

    If the above asked is not possibe can we have an alternative as mentioned below :-
    A dropdown similar to the one shown in "Edit->Preferences->Grids->Colors" having our own text names instead of the default color names.
    So that I can show some color symbol and a text name along with it in my dropdown.
    One more query, is it possible to show the images/giff/png files in dropdown ?

  • How to update a column with different values but all other row values r sam

    Hi,
    I have a table like this.
    Col1 col2 col3 col4
    10 20 30
    10 20 30
    10 20 30
    i need to update col4 with different values coming from other table like this
    Col1 col2 col3 col4
    10 20 30 xxxx
    10 20 30 yyyy
    10 20 30 zzzz
    how can i update the table. pls let me know how to use the where condition in the update stmt.
    thanks,
    jay
    Edited by: user2558790 on Nov 20, 2009 12:26 PM

    what is the logic for this kind of update...????
    Greetings,
    Sim

  • Finding duplicate values in a column with different values in a different c

    I'm finding duplicate values in a column of my table:
    select ba.CLAIM_NUMBER from bsi_auto_vw ba
    group by ba.CLAIM_NUMBER
    having count(*) > 1;
    How can I modify this query to find duplicate values in that column where I DON'T have duplicate values in a different specific column in that table (the column CLMT_NO in my case can't have duplicates.)?

    Well, you can use analytics assuming you don't mind full scanning the table.....
    select
       count(owner) over (partition by object_type),    
       count(object_type) over (partition by owner)
    from all_objects;You just need to intelligently (i didn't here) find your "window" (partition clause) to sort the data over, then make use of that (the analytics would be in a nested SQL and you'd then evaluate it in outside).
    Should be applicable if i understand what you're after.
    If you post some sample data we can mock up a SQL statement for you (if what i tried to convey wasn't understandable).

Maybe you are looking for

  • How to use the alter statement in Execute

    Hi All, Need your help to solve this issue. i want the call the alter statement in procedure to load data to the external table. As per our requirement location will be given as a input parameter. Created procedure as shown below CREATE OR REPLACE PR

  • Single email signature for multiple devices

    Hi, I want to use one email signature from my mac mail account - I want it to be the same from iPhone, iPad and desktop mac - ideally including my logo, phone number and website as a clickable link. Is this possible because I'm really struggling. Tha

  • Connecting 2 WAN clouds on the same IP address range.

    Hello, I have a problem connecting my office to two third party companies. I have two Cisco 1700 series WAN links to my office from these companies, Both routers are fully managed by their respective companies, both use static routing, and both are u

  • String getMimeType(String file)

    String getMimeType(String file) in that what is the file exactly,which file is that, is it in the exploded directroy or some thing else please help me

  • Creative vision:M taking time to mark

    i li've in UK and i tryied to get hold of Vision:M but no shop has it. Cant believe creative is that slow at marketing... and they are trying to compete with Ipod!(making it more expensi've then ipod is really gonnna help !) i really dont see that ha