Read select line in the table

hi,
can any one tell me how we code to get the selected line in the display table
thanks.

Hi ,
1.Just select a row of table and click on button to read the value of selected row.
2. In the OnAction of button, just read the context node binded to the table using Code wizard(Control + F7).
3. below menttioned code will be automatically genearated and selected value's content will be stored in ls_cn_flight :
DATA lo_nd_cn_flight TYPE REF TO if_wd_context_node.
  DATA lo_el_cn_flight TYPE REF TO if_wd_context_element.
  DATA ls_cn_flight TYPE wd_this->element_cn_flight.
* navigate from <CONTEXT> to <CN_FLIGHT> via lead selection
  lo_nd_cn_flight = wd_context->get_child_node( name = wd_this->wdctx_cn_flight ).
* get element via lead selection
  lo_el_cn_flight = lo_nd_cn_flight->get_element(  ).
* get all declared attributes
  lo_el_cn_flight->get_static_attributes(
    IMPORTING
      static_attributes = ls_cn_flight ).
CN_FLIGHT is the node binded with table.

Similar Messages

  • How to find out the selected line in the table control

    Hi Guys,
    i have a requirement like this. i have table control and the internal table for that table control as IT_CASE. this internal table i declared as CHECKBX, MATNR, QUANTITY. but when i am enter the values in the table control i am getting the values in MATNR and QUANTITY in the that internal table IT_CASE. but when iam selecting that that line iam not getting CHECKBOX as 'X' in that internal table IT_CASE. i declared the table control as CAS_CONTROL and in that i have given the "w/selcolum" property as IT_CASE-CHECKBOX. now i want to fill that CHECKBOX as 'X' inthat internal table IT_CASE whatever the lines we are selecting only for those lines i want to fill up as 'X' in that internal table.
    Can you please suggest any one reg this.
    Thanks in advance
    Rahul

    Hello body,
    You can give a name such as 'SEL' in  w/selcol and declare SEL as char1. Then follow the coading.
    in TOP.
    data: sel type c.
    PROCESS AFTER INPUT.
    user_command_0011.
    loop at <Your internal table>.
    module get_data.
    endloop.
    Inside Module get_data.
        if sy-ucomm = <Your Fcode>
        if sel = 'X'.
           <Your internal table>-<Field for checkbox> = 'X'.
          append <Your internal table>.
        endif.
      endif.
    I think your issue is resolved.
    Regards.
    S Mahanta.

  • Copy selected lines in the table control

    Hi friends,
    I Have a screen 200 in which i have a button COPY and table control.
    In my table control i have 6 lines of data.
    now my requirement is when i select any lines  ie :  let us say i ahve selected 1 , 3 , 5 lines of my table control and when i click on the button COPY of that screen. i need those 3 selected lines 1 , 3 , 5 to be copied again in the table control
    example  :
    line 1         selected
    line2
    line3          selected
    line4
    line5          selected .
    line6
    now my table control should be
    line1
    line2
    line3
    line4
    line5
    line6
    line1
    line3
    line5
    How can i do that
    Regards
    Priyanka.

    I have similar issue...i need help how to accomplish automatic addition on every line.  example (see below)
    this is how it looks right now
    DATE    EMPLOYEE       DEPT JOB     LOT     OPER#     LX_HRS     OP_SETUP     LX_TYPE     COMPLETE
    2/23/2009     M.Paquiao   NB         1960     001     10             1.50                14.00                     S                      NO
    2/24/2009                                                      1.00             14.00                  S                        NO
    2/25/2009                                                      4.50                14.00                  S                    NO
    2/27/2009                                                      3.00             14.00                  S                        NO
    2/28/2009                                                      1.50             14.00                  R                       YES
    3/1/2009                                                      2.00             14.00                  R                  YES
    this what I need it to do when I meant automatic addition of each line:
    DATE   EMPLOYEE     DEPT     JOB     LOT     OPER#     LX_HRS     OP_SETUP     LX_TYPE     COMPLETE
    2/23/2009     M.Paquiao      NB        1960     001     10             1.50        14.00               S         NO
    2/24/2009                                                      2.50             14.00                  S             NO
    2/25/2009                                                      7.00        14.00                  S             NO
    2/27/2009                                                      10.00     14.00               S             NO
    2/28/2009                                                      11.50     14.00               R             YES
    3/1/2009                                                      13.50     14.00               R             YES
    As you can see everything is the same but on column LX_HRS, the first example one is not doing anything addition but on the second example is now doing addition.  This additions were done manually, how can I tell crystal to add each line, in the example above, the
    first example                                              second example: (addition is involved)
    date                lx_hrs                                  date                  lx_hrs
    2/23/09           1.50                                     2/23/09              1.50
    2/24/09           1.00                                     2/24/09              2.50 (sum of : 1.50 + 1.00 was added)
    2/25/09           4.50                                     2/25/09              7.00 (sum of 2.50 (on date 2/24/09 &  4.50 from date 2/25/09 of the first example).

  • Reading selected data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hi
    If your table control has a check box, your internal table should have a field for it. Its value will be X if the checkbox is setted else it'll be SPACE.
    So in the PAI u should read only the records where that flag is X:
    LOOP AT ITAB WHERE MARK = 'X'.
    ENDLOOP.
    Max

  • How can we delete a line from the table control .

    hi all
    how can we delete a line from the table control .
    situation is.
    created table control in se51 which will display the data of a table.
    how could i select a line from the table control ?
    how could i delete the selected lines form the table.
    thanks in advance

    Change the Table Control attributes such that user can only select a single record(row).
    <u>Tip to delete a selected record</u>
    1) write a module 'Mark' in the PAI as below
    PROCESS AFTER INPUT.
    MODULE cancel AT EXIT-COMMAND.
    LOOP WITH CONTROL table_view.
    MODULE read_table_control.
    FIELD flag MODULE mark ON INPUT.
    ENDLOOP.
    MODULE user_command_0100.
    2) Module Mark is below.
    MODULE mark INPUT.
    CHECK flag = 'X'.
    x = table_view-top_line + sy-stepl - 1.
    Delete itab INDEX x.
    ENDMODULE. " mark INPUT
    Table_view is the TableControl Name.
    'flag' is of type char(1) available in the Internal table which was assigned to the select option in the table control.
    <u>award if uesful</u>
    Regards,
    Sudheer

  • Read the first line of the table.

    Hi,
    Can you pls let me know as to how I read the first line of the table.
    Thx.

    hi check this.
    data: begin of itab occurs 0,
            matnr like mara-matnr ,
            meins like mara-meins,
            end of itab.
    select-options: s_matnr for mara-matnr .
    select matnr
             meins
             from mara
             into table itab
             where matnr in s_matnr .
    read table itab index 1 .
    loop at itab .
    write:/ itab-matnr .
    endloop .
    regards,
    venkat.

  • How to find the current line in the table control in module pool ?

    How to find the current line in the table control in module pool ?
    This is an urgent requirement? please do help me.

    refer to this example
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX<b> flights-current_line.</b>
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.

  • Copy more lines in the Table Control

    Hi ,
    I have created a table control in one of my mod pool programs,
    I have to paste lines from Excel (for instance) to this table control, but it copies only to the lines in the table control which I see in the screen. if I have more lines to copy than the lines which I see in the screen, it doesn't copy it.
    plz help me in this regard.......
    Thanx
    SHOAIB REHMAN

    Hi, Shoaib
    I think you have to Program for this in Special Button like in Select-Option's (EXTENSION) Button Window you have an Button Upload from Clipboard (Shift + F12) just left side of the Cancel button.
    For Copy data from Clipboard Check the Bellow Sample Code. (Copy data and Run the Bellow Code)
    TYPES:  BEGIN OF ty_char256,
            line TYPE c LENGTH 256,
            END OF ty_char256.
    DATA: it_data TYPE STANDARD TABLE OF ty_char256,
          wa_data LIKE LINE OF it_data,
          length TYPE i.
    CALL METHOD cl_gui_frontend_services=>clipboard_import
      IMPORTING
        data                 = it_data[]
        length               = length
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 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.
    LOOP AT it_data INTO wa_data.
      write: wa_data-line.
    ENDLOOP.
    Please Reply if any Confusion.
    Thanks and Regards,
    Faisal

  • FS that updates several lines in the table-part

    Hi!
    I use 2005A B1..
    Can i make FS that updates several lines in the table-part of the marketing doc? For example, i press Shift+F2 in the "Tax Code" cell of the 1st row of the doc, the rest of the lines in the table will have "Tax Code" also updated?
    Regards,
    David

    Hi,
    You can do this using formatted searches.  Please try the following:
    1.  Create a UDF on the 'Marketing Document - Title' called 'VATCODE'
    2.  Add a FS to the UDF with the following query
    SELECT T0.\[Code\] FROM OVTG T0
    3.  Add the formatted search to the Tax Code field in the lines with the following query
    SELECT $\[ORDR.U_VATCODE\]
    The key thing is when setting up the FS at line level you need to set it so that it Auto Refreshes 'When Field Changes' and not 'When Exiting Altered Column'.  The column will be the VATCODE UDF you set up earlier.
    Now if you add a few lines to your order and then select the VAT Code in your UDF by pressing Shift F2 then it will copy down to all the lines.  The only issue is that it will not automatically copy down to any lines added after you have selected the VATCODE UDF.
    I hope this helps.
    Regards,
    Adrian

  • Multiple row selection capability in the table

    Hi
    I have a group with table layout style and I want to set the rowSelection property of the generated table to "multiple" but it seems that there is no way to do that from JHs unless using the group as LOV, which is not desired for me. Here is the code which sets this property in tableGroup.vm :
    #if (! ($JHS.current.group.useAsLov && $JHS.current.group.multiSelect))
    selectionListener="#{#BINDINGS_TABLE().collectionModel.makeCurrent}"
    rowSelection="single"
    #if( ! $JHS.current.group.useAsLov )
    selectedRowKeys="#{#TABLE_BEAN().selectedRow}"
    #end
    #else
    rowSelection="multiple"
    selectedRowKeys="#{#LOV_PAGE_BEAN().selectedRowKeySet}"
    selectionListener="#{#LOV_PAGE_BEAN().selectionListener}"
    #end
    Is there any reason to not allowing to have multiple row selection capability in the table when it is not in LOV mode?
    Thanks
    Ferez

    Ferez,
    No, but if you want to have multiple selection, there is typical a custom action you want to apply to the selected rows, which cannot be defined in the Jheadstart Application Definition editor.
    However, it is perfectly fine to use a custom tableGroup.vm template and enable multi-selection.
    Steven Davelaar,
    JHeadstart team.

  • When iam selecting row of the table i got the exception

    Hi ,
    When iam selecting row in the table at that time iam getting below exceptions
    <21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /InventoryPropertiesViewTF/InventoryPropertiesView URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff actual-URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
    <21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /PropertyDisplayTF/PropertyDisplay URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff actual-URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
         at com.sun.el.parser.AstValue.getTarget(Unknown Source)
    Please Let me know why its getting this type exception only some time interemitten issue,
    Please provide me any solution for these,
    jdeveloper 1.1.1.4

    Check your page code for an EL that uses 'BracketSuffix'. This is the point of error as the 'BracketSuffix' can't be evaluated at the given point.
    Timo

  • How To delete the Chosen line from the Table Control

    Hi Friends,
      i am new to Module Pool Programming , i developed a Table Control in input mode and i am getting data also into that table control. my requirement is that i want to delete the current chosen line from that table control. please help me out.

    HI
    GOOD
    GO THROUGH THIS REPORT
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.
    CHANGE THE CODE AS PER THIS LIGIC.
    THANKS
    MRUTYUN

  • Selecting data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hello Line,
    As gopi has suggested do the following..
    for the table control properties u have an option called W/SelColumn.
    Give in some name (ROW_SEL)to that and also include a field CHK in the internal which is being passed to the table control.
    and in the PAI of the table control module wirte like this...
    Then in your code..
    PROCESS BEFORE OUTPUT.
    PBO FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    LOOP AT lt_final
    INTO lw_final
    WITH CONTROL tabcontrol
    CURSOR tabcontrol-current_line.
    MODULE tabcontrol_get_lines.
    MODULE TABCONTROL_CHANGE_FIELD_ATTR
    ENDLOOP.
    MODULE status_0101.
    PROCESS AFTER INPUT.
    PAI FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    LOOP AT lt_final.
    MODULE read_data.
    MODULE tabcontrol_user_command.
    ENDLOOP.
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    MODULE user_command_0101.
    MODULE tabcontrol_user_command input.
    if lt_final-chek = 'X'.
    *put your logic here something like
    move corresponding lt_final to gt_final.
    *now you have selcted rows data in gt_final.
    endif.
    endmodule.
    Regards

  • How to read selected item of the dropdown listbox in dialog prgmming

    hello to all,
    i need one help.In dialog programming how to read the selected value of the dropdown listbox created in se51. the values are appering in listbox by using FM 'VRM_SET_VALUES' .and function code is also assigned to lisbox .but how to read that one particular value selected by user form the dropdown list.
    thanks.

    hello mate
    Try this following  logic and code  u will getting the answer
    Here this example  :  
                      Let Name of the LIST BOX BE  :  LT
    Code :
    Data Declaration :
      I_NATIO TYPE VRM_VALUES,
      W_NATIO LIKE LINE OF I_NATIO
    data: begin of itab occurs 0,
    LT(10)  type c,    
    end of itab.
    **This query to data retrival
    select  x1 x2 into table itab form tbl .
    loop at itab.
    w_natio-key = itab-LT.
    w_natio-text = itab-LT.
    append w_natio into i_natio.
    clear w_natio.
    endloop.
    **This code  for setting values in the list box
    CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID     = 'LT'
          VALUES = I_NATIO.
    **This code getting the valu form the list box
      CALL FUNCTION 'VRM_GET_VALUES'
        EXPORTING
          ID     = 'LT'
        IMPORTING
          VALUES = I_NATIO.
    **simply to print the values selected
    write : i_natio-lt.
    I hope this will help u out.
    Anand

  • How to make the lines of the table and the template same

    Hello Abapers,
                        I have a requirement, I have made a table in which i have displayed all the values in it, and under that i have taken a template and diplayed the total of it but the lines drawn to the table and the template is different, the table line is dark and the line of the template is lite, how can i make the line of the template dark, i mean the same as the table line. i hope u understand my problem.can u  please help me in solving my problem as the requirement is very urgent.
    HOPE U UNDERSTAND MY PROBLEM
    Thank u in advance  .

    HI,
    Adjust the line width option for template and table,its there under pattern.

Maybe you are looking for