To color selected cells in dynamically created table in ALV.

Hi,
       The requirement is to display a table (whose columns are dynamic) using ALV n to color few cells of the table based on some condition.
For creating the table dynamically i have used the method cl_alv_table_create=>create_dynamic_table.
Now for coloring the cells i tried to use the field EMPHASIZE .
But when I try this method the whole column is getting colored.
So any suggestions on how to color only particular cells.

Hi,
Try this one...
DATA: gs_layout TYPE slis_layout_alv, "Define layout
gt_color TYPE lvc_t_scol WITH HEADER LINE. "Define Internal Table for Cell Colouring
Use below Sample Code after building a Field Catalog:
gs_layout-coltab_fieldname = 'COLINFO'.
" 'it' is the final internal table which contain positive & negative value of Field 'MENGE'
LOOP AT it.
REFRESH gt_color.
CLEAR gt_color.
IF it-menge GE 0.
CLEAR gt_color.
gt_color-fname = 'MENGE'.
gt_color-color-col = cl_gui_resources=>list_col_positive.
gt_color-color-int = 0.
APPEND gt_color.
ELSEIF it-menge LE 0.
CLEAR gt_color.
gt_color-fname = 'MENGE'.
gt_color-color-col = cl_gui_resources=>list_col_negative.
gt_color-color-int = 0.
APPEND gt_color.
ENDIF.
it-colinfo[] = gt_color[].
MODIFY it.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = ct_fieldcat
i_save = 'A'
TABLES
t_outtab = it
EXCEPTIONS
program_error = 1
OTHERS = 2.
Hope this solves your problem.
Regards,
Tarun

Similar Messages

  • Setting a Filter on a dynamically created Table

    Hi All,
    I am currently working on a Database to automatize some process. Quick explanation:
    The User can import a CSV (Text) File via a DialogBox, which gets imported into a Table. After this, the content has to be filtered, setting conditions on 4 different rows. The new Table gets exported into a new CSV (It has to be CSV, since it later gets imported
    into SAP)
    I am having some trouble with filters though:
    How can I set a Filter on a dynamically created Table (using VBA)?
    Best case would be to save the filter into my Import spec, but Access doesn't seem to have this option (?)
    Can somebody help?
    Thanks in advance
    Regards
    Alex

    Thanks for the fast reply! Sorry, I am not really proficient at Access. How do I do a query on a dynamically created Table? Do I have to save the Table into a Variable. Or what's the way to import it?
    Hi Alex,
    I never use the Import functionality, nor DoCmd.TransferText.
    To import data from a csv-file I made my own Import functionality. In fact it is just reading an external file, line by line, and each line field by field using the field separator. In my opinion that is far more versatile than the standard functionality.
    But you can use the standard functionality of Access to import a csv-file into a table.
    Having the data in a table, you can generate the appropriate query for the output in a VBA procedure:
            sql_string = "SELECT Field1, Field2, ... FROM MyTable WHERE Field1 = ... AND Field2 = ... ORDER BY Field3"
    and make a recordset of it:
            Set cur_set = CurrentDb(sql_string)
    The output csv-file is then filled by opening a file for Write, loop through all the records, concatenate for each record all the wanted fields using the field separator, and write the result line to the csv-file.
    Most important is to understand this process. After that it should be possible to build it. And if you have further questions, just ask.
    Imb.

  • Coloring an ALV Cell with DYNAMIC INTERNAL TABLES

    Hello Gurus,
    I need your help regarding coloring of a cell in my ALV Grid report with DYNAMIC tables.
    I have used the call method in calling my ALV. (CALL METHOD gr_alvgrid->set_table_for_first_display).
    Now my problem is, I can not bring out the cellcolor succesfully, I always ended up to dump (GETWA_NOT_ASSIGNED = You attempted to access an unassigned field symbol     
    (data segment 32807).                                  
    What I have done:
    I've created 2 internal tables:
    *1st table
    *After appended all of my columns to  gt_fieldcat
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = gt_fieldcat
        IMPORTING
          ep_table        = gp_both.
      ASSIGN gp_both->* TO <i_xtab1>.
    *2nd table
    Appended these column for CellColor
      CLEAR wa_gtfldcat.
      wa_gtfldcat-fieldname = 'CELLCOLOR'.
      wa_gtfldcat-ref_table = 'CALENDAR_TYPE'.
      wa_gtfldcat-ref_field = 'COLTAB'.
      APPEND wa_gtfldcat TO gt_fieldcat.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = gt_fieldcat
        IMPORTING
          ep_table        = gp_alvgrid.
      ASSIGN gp_alvgrid->* TO <i_xtab2>.
    *Work Areas for tab1 and tab2
    CREATE DATA dref1 LIKE LINE OF <i_xtab1>.
      ASSIGN dref1->* TO <wa_xtab1>.
      CREATE DATA dref2 LIKE LINE OF <i_xtab2>.
      ASSIGN dref2->* TO <wa_xtab2>.
    *Move contents of table1 to table2 and modify cellcolor column
    LOOP AT <i_xtab1> ASSIGNING <wa_xtab1>.
    *-----Cell color assignment
        DESCRIBE TABLE gt_fieldcat.
        DO sy-tfill TIMES.
          READ TABLE gt_fieldcat INTO wa_gtfldcat INDEX sy-index.
          ASSIGN COMPONENT wa_gtfldcat-fieldname
            OF STRUCTURE <wa_xtab1> TO <fs4>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          ASSIGN COMPONENT wa_gtfldcat-fieldname
            OF STRUCTURE <wa_xtab2> TO <fs3>.
          IF sy-subrc NE 0. EXIT .ENDIF.
            <fs3> = <fs4>.
        ENDDO.
        ASSIGN COMPONENT 'CELLCOLOR' OF STRUCTURE <wa_xtab2> TO <fs3>.
        IF sy-subrc = 0.
          PERFORM modify_cell_color USING 'ZZMATNR' <fs3>.
        ENDIF.
        APPEND <wa_xtab1> TO <i_xtab2>.
    ENDLOOP.
    *Call ALV
    gs_layout-ctab_fname = 'COLORCELL'
        CALL METHOD gr_alvgrid->set_table_for_first_display
          EXPORTING
            is_layout                     = gs_layout
          CHANGING
            it_outtab                     = <i_xtab2d>[]
            it_fieldcatalog               = gt_fieldcat
            it_sort                       = lt_sort
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
    *--->Exception handling
        ENDIF.
    FORM modify_cell_color  USING p_fieldname   TYPE lvc_fname
                                  pt_cellcolor  TYPE table.
      DATA l_cellcolor TYPE lvc_s_scol.
      CLEAR l_cellcolor.
      l_cellcolor-fname = p_fieldname.
      l_cellcolor-color-col = 6.       " Red.
      l_cellcolor-color-int = 0.
      l_cellcolor-color-inv = 0.
      INSERT l_cellcolor INTO TABLE pt_cellcolor.
    ENDFORM.                    " MODIFY_CELL_COLOR

    Hi,
    The internal tabl which you are using to display the output should have one column in the end.
    The cell in this column will contain an internal table of type 'lvc_s_scol'.
    The contents of this internal table will be the field names of all other columns of your main internal table in the field FNAME and the required color in the field COLOR.
    Please note that the field COLOR will have a hex value for different colors.
    In the stucture is_layout  whihc you pass to the method 'set_table_for_first_display'
    the name of this last column should be given to the field 'ctab_fname'.
    This will help you to give the colors to each cell.
    for example
    I have my data table as follows:-
    ITAB1
    MATNR  MAKTX        COLOR_TAB
    1           ABC            FNAME  COLOR  NOKEYCOL
                                    MATNR 8000
                                    MAKTX 8000
    2          XYZ             MATNR 10000
                                  MAKTX  10000
    So my internal table ITAB1 had 3 columns MATNR MAKTX and COLOR_TAB.
    And COLOR_TAB will contain an internal table with 3 columns FNAME COLOR and NOKEYCOL.
    The value to importing parameter IS_LAYOUT-CTAB_FNAME will be COLOR_TAB.
    This will help you to assign various colors to the cell of the internal table ITAB.
    When you have to change any color, then you will have to just change the entries in cell COLOR_TAB for the particular row and cell.
    Regards,
    Ankur Parab

  • Need help on selection of records in dynamically created table

    hi,
    Ia m able to bind the onleadSelect event to the dynamially created table .
    But i was not able to select the table records.
    default first record was only selected.
    can u help me out to find the way.
    i am pasting the code for reference.
    can u suggest me the right direction.
    i want the selected record in the table to be dispalyed in another view thru this action event.
    but only the forst record is now getting selected by default.
    here the code.
    IWDNode node =wdContext.currentContextElement().node().getChildNode(nodename,0);
    for (int l = 0; l < node.size(); l++) {
    int ele = node.getLeadSelection();
    IWDNodeElement element= node.getElementAt(ele);
    table.setOnLeadSelect(wdThis.wdGetObjectSelectedAction());

    Hi,
      <a href="/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess's</a> how to create a dynamic table, though I think you have already done this.
      Do look at the comment that Armin Reichert has put in. Now in the source code that he has provided, the last line should be
    table.setOnLeadSelect(wdThis.wdGetLeadSelectAction());
    Have you done something similar to this?
    Have you set the initializeLeadSelect property of the datasource node to true?
    Regards,
    Satyajit.
    Message was edited by: Satyajit Chakraborty

  • How to create table field inside the dynamically created table?

    Hi, All!
    I have created dynamic internal table (using field catalog and CALL METHOD cl_alv_table_create=>create_dynamic_table )
    and put this table  into FM REUSE_ALV_GRID_DISPLAY. ALV grid work. Now I need to color rows of my ALV, therefore  I have to insert new column with name "COLORS" and type lvc_t_scol. I  see three ways to do it , but all ones are unsuccessful:
    1. Insert column into field catalog. FM REUSE_ALV_FIELDCATALOG_MERGE does not return info about "COLORS" I guess because COLORS is a table.
    2. Insert column into field catalog manually. It provides a short dump during dynamic table creating or during call of REUSE_ALV_GRID_DISPLAY.
    3. Create dyn table first, then add new field . I could not find a way how to do it :(((((((
    Can somebody help me?
    Tatiana

    Hi,
    Here is the solution for this problem, Sample code:
    *& Report  ZCHA_ALV_GRID_CELL_COLOR                                    *
    REPORT  ZCHA_ALV_GRID_CELL_COLOR                .
    TABLES:MARA.
    DATA: W_CONTAINER         TYPE SCRFNAME VALUE 'ALV_CONTAINER',
          W_GRID              TYPE REF TO CL_GUI_ALV_GRID,
          W_CUSTOM_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
         W_EVENT_RECEIVER    TYPE REF TO LCL_EVENT_RECEIVER.
    *layout
    DATA: WA_LAYOUT           TYPE LVC_S_LAYO.
    *field catalog
    DATA: IT_FIELDCAT_WRT_OFF TYPE LVC_T_FCAT,
          WA_FIELDCAT_WRT_OFF TYPE LVC_S_FCAT.
    DATA:BEGIN OF IT_MARA OCCURS 0,
         MATNR LIKE MARA-MATNR,
         MAKTX LIKE MAKT-MAKTX,
         CELLCOLORS TYPE LVC_T_SCOL,
         END OF IT_MARA.
    SELECT P~MATNR
           Q~MAKTX
           INTO CORRESPONDING FIELDS OF TABLE IT_MARA
           FROM MARA AS P INNER JOIN
                MAKT AS Q ON
                PMATNR = QMATNR.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'xxx'.
      IF NOT W_CONTAINER IS INITIAL.
        CREATE OBJECT W_CUSTOM_CONTAINER
                 EXPORTING CONTAINER_NAME = W_CONTAINER.
        CREATE OBJECT W_GRID
                 EXPORTING I_PARENT = W_CUSTOM_CONTAINER.
      ENDIF.
      CLEAR IT_FIELDCAT_WRT_OFF.
      REFRESH IT_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MATNR'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '1'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '35'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material No'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '2'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '45'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material Desc'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      DATA LS_CELLCOLOR TYPE LVC_S_SCOL.
      READ TABLE IT_MARA INDEX 5 .
      LS_CELLCOLOR-FNAME = 'MATNR'.
      LS_CELLCOLOR-COLOR-COL = '3'.
      LS_CELLCOLOR-COLOR-INT = '1'.
      APPEND LS_CELLCOLOR TO IT_MARA-CELLCOLORS.
      MODIFY IT_MARA INDEX 5.
      WA_LAYOUT-CTAB_FNAME = 'CELLCOLORS'.
      CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = WA_LAYOUT
        CHANGING
          IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF
          IT_OUTTAB       = IT_MARA[].
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Try to assign appropriate points.
    Regards,
    Suman

  • How can i edit perticular row in dynamically created table

    Hi to All,
    Here my requirement is create table dynamically from existing XML and first column with radio buttons,column data and row wise data there on XML but i'm able to create table and displaying data then whenever i click on first column radio button that row editable and remaining rows in disable mode then i edit that row and click on save button that particular row data will be inserted to XML.Please tell me how can i achieve this requirement.
    Thanks and Regards,
    surya.

    Hi surya
    - Use RadioButtonGroupByIndex for the first column.
    - Disable automatic change of table's lead selection: selectionChangeBehaviour = manual, selectionMode = none.
    - In onSelect event handler of the RadioButtonGroupByIndex set new table's lead selection from the code to the row where the button is clicked.
    - Add calculated read-only attribute isRowEditable (boolean) to the table's node. Getter shall be like this:
    return (element.index() == element.node().getLeadSelection());
    - Bind the cell editors' enabled property to isRowEditable attribute.
    BR, Siarhei
    PS: this is my message #666 - do not trust it
    Edited by: Siarhei Pisarenka on Feb 23, 2010 2:29 PM

  • How to create Dynamic Internal table in ALV?

    Hi all,
    I have to create a ALV report based on dynamic internal table. The requirement is that when I enter the months in my selection screen I should get the data relevant to those many months only. For eg if in selection I have given January to March, I should get an ALV output with columns from January to March only.
    Please help me with the coding part as I find it a bit confusing.
    Please reply immediately.
    Regards,
    Bhavani.

    Hi BHAVANI,
    first you have to prapare a field catalog [(see this)|http://help.sap.com/saphelp_470/helpdata/en/52/5f060de02d11d2b47d006094192fe3/frameset.htm]
    and than you can use a Method cl_alv_table_create=>create_dynamic_table
    I hope that help a little.
    Regards Bogdan

  • Select count into versus create table as in functions/procedures

    I am working on a dynamic PL/SQL script that will count the number of records in a remote database
    based on certain criteria and then if the number is "acceptable" will create a table in the connecting
    database with those records.
    My where clauses are supposed to be the same but I am presented with the problem, when I run the
    first code ... select in to rowcount I get 122000 records, when I later do the create table as
    with the same whereclause code, I get 77 records. So now I am attempting to validate that the two
    where clauses are the same ... you'd think it would be obvious, but it's not.
    My first operation does a select count(*) into rowcount with the where clause behind it.
    The second operations creates a "sql command literal' that gets executed and returns the less value.
    I build it like testscript := 'create table '||tablename ||'as select * from '||remotetablename||'@'||linkname;
    testwhere := ' xxxxxxx'
    then I do an execute immediate teststring ||' ' testwhere; which works but gives me 77 rows in the table.
    Since I believe my where clause might be different, how can I run the first operation ... select count into rowcount
    as a normal SQL statement in the script...
    When I attempt to just run it I get -- PLS-00428: an into clause expected in this select statement......
    I will provide the source code in my next posting. Working to get it moved to this system.. Once you see it you'll understand
    why I don't think, it's the same, but I need a way to run them exactly as they are written to understand the different results.
    so How can I make the select count (*) into rowcount from .... work just like a normal select

    Here is first part of the procedure --- I get returned value of 122000 records ....
    SELECT COUNT (*)
                   INTO ROWCOUNT
                   FROM A_K_A_D_TBL@FCA08_INGRES
                   WHERE (( "a_" = '1' OR "a_" = '6' ) AND
                             ( "d_t" <> '3' OR "k_c_s" = 'Y' ) AND
                             "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE )OR
    (( "a_" = 4 OR "a_" = 7 ) AND
                             ( "d_t" <> '3' OR
    "k_c_s" = 'Y' OR
    "r_t" = '0' OR
                        "r_t" = '2' OR
                   "r_t" = '3' ) AND
                        "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE AND
                        "r_d" < DATECUTOFFDATE AND
                        "s_d" < DATECUTOFFDATE);
    then I attempt to duplicate it for string literals.... when this runs ... I get only 77 records. So that makes me think that my strings are not
    done properly.
    So I want to try to run the first sql itself ... but then I get the errors about needing select into ..... etc..
                   TESTWHERE := q'[WHERE (( "a_" = '1' OR "a_" = '6' ) AND ( "d_t" <> '3' OR "k_c_s" = 'Y' )]'||
              q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]'||
                             q'[ OR (( "a_" = 4 OR "a_" = 7 )]'||
                             q'[ AND ( "d_t" <> '3' OR "k_c_s" = 'Y' OR "r_t" = '0' OR "r_t" = '2' OR "r_t" = '3' )]'||
                             q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "r_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "s_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]';
                        TESTSTRING := 'CREATE TABLE '||UCASEXTABLENAMETEMP||' AS SELECT * FROM '||UCASEXTABLENAME||'@'||XLINKNAME;
                        DBMS_OUTPUT.PUT_LINE(TESTSTRING);
                        DBMS_OUTPUT.PUT_LINE(TESTWHERE);
                        EXECUTE IMMEDIATE TESTSTRING||' '||TESTWHERE;

  • Problem in color a cell for field symbol table.

    Hi guru's
    when i'm trying to color a cell based on condition, getting the following error.
    ERROR:   the data object  <line> has no structure and therefore no component called  "cell_colour" .
    providing my code here:
    DATA: wa_cellcolor TYPE lvc_s_scol,
             lv_index     TYPE sy-tabix.
       break satishkumarc.
       LOOP AT <table> ASSIGNING <line>.
         lv_index = sy-tabix.
         ASSIGN COMPONENT 'COMPLIANCE' OF STRUCTURE <line> TO <field>.
         IF <field> EQ 'YES'.
           wa_cellcolor-fname     = 'COMPLIANCE'.
           wa_cellcolor-color-col = col_positive.
           wa_cellcolor-color-int = 0.
           wa_cellcolor-color-inv = 0.
         ELSE.
           wa_cellcolor-fname     = 'COMPLIANCE'.
           wa_cellcolor-color-col = col_negative.
           wa_cellcolor-color-int = 0.
           wa_cellcolor-color-inv = 0.
         ENDIF.
         APPEND wa_cellcolor TO <line>-cell_colour.                                                     "   error line
         MODIFY <table> FROM <line>  INDEX lv_index TRANSPORTING cell_colour.      "  error line
         CLEAR: wa_cellcolor.
       ENDLOOP.
    actually i know  that  <line>-cell_colour  won't work. but i don't know how to achive this functionality .
    could anybody please help me out in this.
    Thanks in Advance.
    regards
    satish
    thank

    hi ashish,
    i'm using
    field-symbols: <line> type any.
    CREATE DATA  mydata  LIKE LINE OF <table>.
           ASSIGN mydata->* TO <line>.
    to make the structure. so i guess i cannot give the structure name while declaring <line>.
    Thanks & regards
    satish

  • Formatting value in the dynamically created table

    Hi,
    I have created table dynamically.
    In that, if the columns going to be number datatype,
    <af:convertNumber pattern="##########"/> , i want to apply this pattern,
    if the column going to be date,
    <af:convertDateTime pattern="DD/mm/yyyy" /> , i want to apply this pattern.
    Code Snippet for dynamically created UI table,
    <af:table rows="#{bindings.DynamicVO.rangeSize}"
    fetchSize="#{bindings.DynamicVO.rangeSize}"
    emptyText="#{bindings.DynamicVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.DynamicVO.collectionModel}"
    selectedRowKeys="#{bindings.DynamicVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.DynamicVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.DynamicVOIterator.attributeDefs}" var="def">
    <af:column headerText="#{def.name}" sortable="true" rendered="#{def.hints.displayHint!='Hide'}"
    sortProperty="#{def.name}" id="hisc1">
    <af:outputText value="#{row[def.name]}" id="othis1">
    </af:outputText>
    </af:column>
    </af:forEach>
    </af:table>
    How to apply the pattern for the ouput text dynammically depending on the data type.
    My Jdeveloper version is 11.1.1.3.0
    Reg,
    vini

    Any help on the above scenario?

  • Deleting selected record in Dynamic Internal table

    Hi Friends,
    I want to delete selected row from a dynamic internal table. The selected entry should be deleted from Adobe and as well as Webdynpro abap.
    Kindly help me how to solve this problem.
    Thanks in advance.
    Regards,
    Phani.

    Hi Matthias,
    Thanks a lot for responding.
    In my adobe i kept a check box to delete the record. It should delete the selected ones. But right now, its deleting one by one.
    I have coded following script for delete button:
    IT_TIME_SHEET --> is my internal table
    G_ROW_STATUS is the field to track the action performed.
    var tlength = xfa.resolveNodes("IT_TIME_SHEET.DATA[*]").length;
    for ( var i=0; i<tlength; i++
    if(xfa.resolveNode("IT_TIME_SHEET.DATA["i"].FLAG").rawValue ==
    1 )
    IT_TIME_SHEET.DATA.instanceManager.removeInstance(i);
    G_ROW_STATUS.rawValue = "DELETE";
    In the Webdynpro abap following code I wrote:
        row_count = 1.
        FIELD-SYMBOLS <wa> TYPE zshr_time_sheet_time.
        LOOP AT it_time_sheet ASSIGNING <wa>.
          <wa>-srl_no = row_count.
          row_count = row_count + 1.
        ENDLOOP.
        last_row = <wa>-srl_no.
          DELETE it_time_sheet WHERE srl_no EQ last_row.
    Suppose if two records checkboxes are selected I can loop at the internal table IT_TIME_SHEET in webdynpro and delete where checkbox is selected.
    But problem is once user deletes records, adobe is deleting only one record and if i delete two records from webdynpro it looks like something wrong for the user.
    Please help me how to solve this problem.
    Regards,
    Phani.

  • Select cell in MS-Word table

    How can I select a cell in the MS-Word through LabView when I'm using active-X? There should be a way to use the invoke and/or property node to select a cell in a word table directly. Which active-X class I have to use? Followed by..?
    Attached I have an example vi ready.
    Thanks for your help
                              Norick
    Attachments:
    test.vi ‏21 KB

    Just use the ActiveDocument property into the Tables property into the Index method into the Cell method.  This returns the reference to a single cell of the table.  See the modified vi.
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector
    Attachments:
    test_mod.vi ‏29 KB

  • Dynamically create Table partition

    Hi all,
    Anybody having script to add partition to a table using plsql.My requirment is to create partition for every month ( time_id , from time attribute table ) dynamically.
    Thanks in Advance
    Ramesh K C R

    Just build you SQL statement to create partition in a VARCHAR2 variable
    and use EXECUTE IMMEDIATE to run it.
    Take care to have been granted directly privileges to run CREATE TABLE, ALTER TABLE (not through a role) or create you code with AUTHID CURRENT_USER clause.

  • Passing dynamic internal table into ALV

    I have made one ALV report where i had created one button 'GENERATE'.  ON CLICKING THIS BUTTON the data in the ALV report is downloaded to excel file.
    i have used this:-
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = l_title
          default_extension    = 'XLS'
          initial_directory    = 'C:\'
        CHANGING
          filename             = filename
          path                 = path
          fullpath             = fullpath
          user_action          = user_action
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    Check which button is pressed
      IF user_action <> cl_gui_frontend_services=>action_ok.
        EXIT.
      ENDIF.
    Download error data collected from the internal table
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = fullpath
          filetype                = 'ASC'
          write_field_separator   = '#'
         codepage                = '4103'
         write_bom               = c_true
        CHANGING
          data_tab                = gi_final
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          not_supported_by_gui    = 22
          error_no_gui            = 23
          OTHERS                  = 24.
    If selection is successful
      IF sy-subrc EQ 0.
        MESSAGE s004 . " File  created successfully
      ELSE.
        MESSAGE i005 . " File is not created successfully
      ENDIF.
    In the table i have passed the internal table . this is working fine.
    <b>But,
    The problem is if i want to display the data in diferent layout based on selection screen criteria the data downloaded are same as default layout.
    how to pass a dynamic internal table in the
    CALL METHOD cl_gui_frontend_services=>gui_download</b>

    Hi    ,
    here is the Program for  Download  
    REPORT yrs_download_transport_request.
    PARAMETERS:
      p_reqest TYPE trkorr OBLIGATORY,
      p_folder(255) TYPE c LOWER CASE, p_sepr OBLIGATORY.
    DATA:
      folder TYPE string,
      retval LIKE TABLE OF ddshretval WITH HEADER LINE,
      fldvalue LIKE help_info-fldvalue,
      transdir TYPE text255,
      filename(255),
      trfile(20) TYPE c,
      datatab TYPE TABLE OF text8192 WITH HEADER LINE,
      len TYPE i,
      flen TYPE i.
    TYPE-POOLS: sabc, stms, trwbo.
    INITIALIZATION.
      CONCATENATE sy-sysid 'K*' INTO p_reqest.
      IF sy-opsys = 'Windows NT'.
        p_sepr = ''.
      ELSE.
        p_sepr = '/'.
      ENDIF.
    *  CALL FUNCTION 'WSAF_BUILD_SEPARATOR'
    *       IMPORTING
    *            separator                  = p_sepr
    *       EXCEPTIONS
    *            separator_not_maintained   = 1
    *            wrong_call                 = 2
    *            wsaf_config_not_maintained = 3
    *            OTHERS                     = 4.
    *  IF sy-subrc NE 0.
    *    MESSAGE s001(00)
    *      WITH
    *      'Unable to find out the separator symbol for the system.'(011).
    *  ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_reqest.
      DATA:
        tt_system TYPE TABLE OF tmscsys WITH HEADER LINE,
        es_selected_request TYPE trwbo_request_header,
        es_selected_task TYPE trwbo_request_header,
        iv_organizer_type TYPE trwbo_calling_organizer,
        is_selection TYPE trwbo_selection.
      iv_organizer_type = 'W'. is_selection-reqstatus = 'R'.
      CALL FUNCTION 'TR_PRESENT_REQUESTS_SEL_POPUP'
        EXPORTING
          iv_organizer_type   = iv_organizer_type
          is_selection        = is_selection
        IMPORTING
          es_selected_request = es_selected_request
          es_selected_task    = es_selected_task.
      p_reqest = es_selected_request-trkorr.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
      DATA: title TYPE string.
      title = 'Select target folder'(005).
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title    = title
        CHANGING
          selected_folder = folder
        EXCEPTIONS
          cntl_error      = 1
          error_no_gui    = 2
          OTHERS          = 3.
      CALL FUNCTION 'CONTROL_FLUSH'
        EXCEPTIONS
          cntl_system_error = 1
          cntl_error        = 2
          OTHERS            = 3.
      p_folder = folder.
    AT SELECTION-SCREEN ON p_reqest.
      DATA: request_info TYPE stms_wbo_request,
            request_infos TYPE stms_wbo_requests.
      REFRESH request_infos.
      CALL FUNCTION 'TMS_MGR_READ_TRANSPORT_REQUEST'
        EXPORTING
          iv_request                 = p_reqest
          iv_header_only             = 'X'
        IMPORTING
          et_request_infos           = request_infos
        EXCEPTIONS
          read_config_failed         = 1
          table_of_requests_is_empty = 2
          system_not_available       = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR request_info.
      READ TABLE request_infos INTO request_info INDEX 1.
      IF sy-subrc NE 0
      OR request_info-e070-trkorr IS INITIAL.
        MESSAGE e398(00) WITH 'Request'(006) p_reqest 'not found'(007).
      ELSEIF request_info-e070-trstatus NE 'R'.
        MESSAGE e398(00)
        WITH 'You must release request'(008)
             request_info-e070-trkorr
             'before downloading'(009).
      ENDIF.
    START-OF-SELECTION.
      folder = p_folder.
      CONCATENATE p_reqest+3(7) '.' p_reqest(3) INTO trfile.
      CALL FUNCTION 'RSPO_R_SAPGPARAM'
        EXPORTING
          name   = 'DIR_TRANS'
        IMPORTING
          value  = transdir
        EXCEPTIONS
          error  = 0
          OTHERS = 0.
      PERFORM copy_file USING 'cofiles' trfile.
      trfile(1) = 'R'.
      PERFORM copy_file USING 'data' trfile.
      trfile(1) = 'D'.
      PERFORM copy_file USING 'data' trfile.
    * FORM copy_file *
    * --> SUBDIR * * --> FNAME *
    FORM copy_file USING subdir fname.
      DATA:
        auth_filename TYPE authb-filename,
        gui_filename TYPE string.
      CONCATENATE transdir subdir fname
        INTO filename
        SEPARATED BY p_sepr.
      REFRESH datatab.
      CLEAR flen.
      auth_filename = filename.
      CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
        EXPORTING
          activity         = sabc_act_read
          filename         = auth_filename
        EXCEPTIONS
          no_authority     = 1
          activity_unknown = 2
          OTHERS           = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_NEGATIVE.
        WRITE: / 'Read access denied. File'(001),
                  filename.
        FORMAT COLOR OFF. EXIT.
      ENDIF.
      OPEN DATASET filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        FORMAT COLOR COL_TOTAL.
        WRITE: / 'File open error'(010), filename.
        FORMAT COLOR OFF. EXIT.
      ENDIF.
      DO.
        CLEAR len.
        READ DATASET filename INTO datatab LENGTH len.
        flen = flen + len.
        IF len > 0. APPEND datatab. ENDIF.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET filename.
      CONCATENATE p_folder '' fname INTO gui_filename.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          bin_filesize            = flen
          filename                = gui_filename
          filetype                = 'BIN'
        CHANGING
          data_tab                = datatab[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 24.
      IF sy-subrc = 0.
        WRITE: / 'File'(002), filename, 'downloaded. Length'(003), flen.
      ELSE.
        FORMAT COLOR COL_NEGATIVE.
        WRITE: / 'File download error. Filename:'(004), filename.
        FORMAT COLOR OFF.
      ENDIF.
    ENDFORM. "copy_file
    Reward  points if it is usefull....
    Girish

  • Dynamic internal table for ALV output

    Hi,
    I am looking for a simple & efficient sample code for an ALV report output with dynamic columns. Can someone please help!
    Thanks,
    JS

    Here is a small example. This is pretty old code, and it uses the FM approach.
    report zrich_0001.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: it_alvfc type slis_t_fieldcat_alv,
          wa_alvfc type slis_fieldcat_alv,
          it_fldcat type lvc_t_fcat,
          wa_fldcat type lvc_s_fcat.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_flds(5) type c.
    selection-screen end of block b1.
    start-of-selection.
    * build the dynamic internal table
      perform build_dyn_itab.
    * write 5 records to the alv grid
      do 5 times.
        perform build_report.
      enddo.
    * call the alv grid.
      perform call_alv.
    *  Build_dyn_itab
    form build_dyn_itab.
    * Create the dynamic internal table
      data: new_table type ref to data,
            new_line  type ref to data.
    * Create fields .
      do p_flds times.
        clear wa_fldcat.
        wa_fldcat-fieldname = sy-index.
        wa_fldcat-datatype  = 'CHAR'.
        wa_fldcat-intlen    = 5.
        append wa_fldcat to it_fldcat .
      enddo.
    * 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.
    Have to split this code into two postings to keep formatting.
    Regards,
    Rich Heilman
    Edited by: Rich Heilman on Jun 23, 2009 11:59 AM

Maybe you are looking for

  • Data not exist for member combination in web analysis report

    When I run the report in web analysis studio iam able to find the data for a particular member combination.When I try to run the same report in workspace iam not finding any data for same member combination.Can U please help me to resolve this issue

  • Restore Preview Button in Acrobat 9

    Using Acrobat 9 on Mac OS 10.6.8.      Previously when I opened a file in Acrobat and chose Add or Edit Fields it opened in the edit mode and at the top I had a button "Preview" to switch between Preview and Edit mode.      Now that Preview button ha

  • Multiple hide one 1 screen in an interactive report.

    Dear All, I wish to do Hide tab1-fld1. hide tab1-fld2. Now when the user clicks on the fld1 my program will pick up data from one table and display it and when the user clicks on fld2 my program will pick up data from 2nd table and display it. How do

  • Applet Rendezvous port error

    When I try to execute a client/server applet , unable to connect to the server (server is external, not in my subnet). Client applet throws the following error, Error message: Server port: 30000 MPStudent.ERROR: Can't open socket on rendezvous port 3

  • Talk Back

    I'm using Logic 9, an apogee ensemble and a headphone amp. Is there a way to set up talk back with the built in mic on my imac? or any other ways?