Set cursor position within table control while scrolling

hi,
Anybody can guide me how to set the cursor with in table control while scrolling down,normally it is going to first input filed.
Thanks and Regards,
palani.

Hi Palani,
Could you please share with me what all you have done regarding get and set cursor. I am facing similar problem where
I have made a Z Table Control where i have given vertical and horizontal scrolling . Now when I scroll and try to select a row, then ZTABLE_CONTROL-CURRENT_LINE fetches line number not from the top, it fetches from the current top of ztablecontrol.
It is onlyy changing the value on scrolling, if i do not scroll table control then value is coming correct.
My requirement is whenever i select any row of ZTABLE CONTROL i need to get the curent line number from top. Please guide me what should i do.
Early reply will be rewarded.
Thanks.

Similar Messages

  • To handle cursor position in table control while using insert initial line

    hi,
          I have a requirement to handle cursor position in my table control in which i am using insert initial line by incrementing the index. Now i am handling the cursor position by using set cursor but after 14 records it is going to the first field of the screen. My table control length is 14 records.
          How to handle this, please reply me if anyone know.
    thanks & regards,
        sekhar.

    hi,
             I need to page down the page and then want to set cursor position but for this system command i am getting space for every command. Page down and cursor down or enter every thing it is taking as space. So for this how can i handle it.
    thanks & regards,
        sekhar.

  • Cursor positioning in table control: marking content of a field

    Hello everybody,
    I use a table-control for data input. For fast data input, my customers need dynamic positioning of the cursor. I'm using the set cursor field ... line ... statement and it works fine, except for one problem with a large text-field:
    Is it possible to set the cursor in a field plus mark all the content of the field? The behaviour, i'm looking for is that any input in the field will replace the existing content. Is there any other option?
    Thank you for any suggestions, regards, Kathrin!

    So you want dynamic cursor positioning within a table control. Take a look at FM SCROLLING_IN_TABLE and demo program DEMO_DYNPRO_TABCONT_LOOP. If this does not address your requirements the you can do it manually as follows:
    For example, your internal table has 30 rows, your table control displays 10 rows (value of sy-loopc) at one time. The value of <tabctrl>-top_line contains 11, meaning you are at the second page of table control. Your cursor is at 12th row and now on pressing ENTER, you want the cursor to be positioned at 13th row.
    In your PAI, issue the statement GET CURSOR LINE <lineno>. This will give you the current cursor position in the table control with reference to the top row currently displayed. So the value of <linno> will be 2.
    In your PBO, calculate the next line no to position your cursor into. This can be done by the formula:
      next_line = <tabctrl>-TOP_LINE + <linno> - 1.
    Then issue the statement SET CURSOR FIELD <field_name> LINE <next_line>.
    Hope this helps.
    Regards
    Message was edited by: Shehryar Khan

  • Getting Cursor for Table control while scrolling

    Hi Experts,
    I am displaying 3 pages of records using table controls,
    and when i double click on the record, i have to display some pop up based on the values present in the particular record,
    this is done by getting the line number of the record using GET CURSOR LINE and reading the internal table with the index obtained from GET CURSOR LINE
    This is working fine for one page. I am getting problem for more than one pages
    i.e. if i have to validate for the 23rd record, it will be the second record in the second page, so i will get line number as 2nd instead of 23rd (using GET CURSOR LINE) and i will read the 2nd record in the internal table instead of reading the 23rd record.
    This will lead to improper pop up messages.
    So please let me know how can i catch/get the line number of particular record irrespective of number of pages.
    Thanks,
    Kavya

    declare two variables to get line count and line index
    data: wrk_linecnt(10),
    wrk_lineindx(10).
    get cursor line wrk_linecnt.
    wrk_lineindx = <table control name>-top_line + wrk_linecnt - 1.

  • How can we get a Scrolling in Table Control while data uploading?.

    Can anybody suggest me the way to put a scrolling in a table control while uploading the data?

    Hello,
    I dont think it is possible, anyways dont do it. It will make the program perfomance very bad. There is an indicator (little watch on the left hand side), that you can use, but it is better to dont do it. As I have told you the perfomance will be very bad.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          percentage = 20
          text       = 'Uploading data'.
    THAT IS THE FM. Use it after and before the upload.
    Hope this helps
    Gabriel

  • Setting Cursor position

    Pls help me for the following query:
    how to set cursor position at the beginning of text field(JTextField) after setting text inside it.

    RTFM
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/JTextComponent.html#setCaretPosition(int)

  • How to handle the table control While working with LSMW?

    How to handle the table control While working with LSMW?

    its possible in lsmw,
    Hi,
    LSMW will have a Indicator for headr and itam, i do not remember the correct field, but it will have an indicator, check the fields, there will be a single charecter lenght field, that should be the indicator, and using that we can write the logic.
    check that single charecter field, it that is X that means the header record is processed, and do the items.
    and, this is another way, try this out also
    YOu can do this in "Define Source Structures" step,
    the HEADER is defined first,
    then the DETAIL below the HEADER.
    add the fields to the structures.
    Both should have some common key field
    Please take care that the name of the common field is the same.
    Once you do this it is linked. The you have a header and item corresponding to that header. then run the LSMW as you would.
    Thanks

  • How can i extend the table control while transfering the data

    hi
    how can i extend the table control while transfering the data.

    Hi,
    For table control we have to handle the page down (P+, or what ever function codes are assigned to that activity) activity with our coding.
    Just check out this code:
    This is the bdc to update the XK01 transaction code (Vendor Creation).
    Here we will use table controls for bankings. Here Iam sending the coding and text files.
    Coding
    REPORT zprataptable2
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 0,
    i1 TYPE i,
    lifnr LIKE rf02k-lifnr,
    bukrs LIKE rf02k-bukrs,
    ekorg LIKE rf02k-ekorg,
    ktokk LIKE rf02k-ktokk,
    anred LIKE lfa1-anred,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    land1 LIKE lfa1-land1,
    akont LIKE lfb1-akont,
    fdgrv LIKE lfb1-fdgrv,
    waers LIKE lfm1-waers,
    END OF itab.
    DATA : BEGIN OF jtab OCCURS 0,
    j1 TYPE i,
    banks LIKE lfbk-banks,
    bankl LIKE lfbk-bankl,
    bankn LIKE lfbk-bankn,
    END OF jtab.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    DATA : c TYPE i.
    INCLUDE bdcrecx1.
    START-OF-SELECTION.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = 'C:\first1.txt'
    filetype = 'DAT'
    TABLES
    data_tab = itab.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = 'C:\second.txt'
    filetype = 'DAT'
    TABLES
    data_tab = jtab.
    LOOP AT itab.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RF02K-KTOKK'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RF02K-LIFNR'
    itab-lifnr.
    PERFORM bdc_field USING 'RF02K-BUKRS'
    itab-bukrs.
    PERFORM bdc_field USING 'RF02K-EKORG'
    itab-ekorg.
    PERFORM bdc_field USING 'RF02K-KTOKK'
    itab-ktokk.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFA1-LAND1'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFA1-ANRED'
    itab-anred.
    PERFORM bdc_field USING 'LFA1-NAME1'
    itab-name1.
    PERFORM bdc_field USING 'LFA1-SORTL'
    itab-sortl.
    PERFORM bdc_field USING 'LFA1-LAND1'
    itab-land1.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFA1-KUNNR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKN(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    cnt = 0.
    LOOP AT jtab WHERE j1 = itab-i1.
    cnt = cnt + 1.
    CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-banks.
    CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-bankl.
    CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-bankn.
    IF cnt = 5.
    cnt = 0.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKS(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.  " Page down activity
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKN(02)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    ENDIF.
    ENDLOOP.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKS(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB1-FDGRV'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFB1-AKONT'
    itab-akont.
    PERFORM bdc_field USING 'LFB1-FDGRV'
    itab-fdgrv.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB1-ZTERM'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB5-MAHNA'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFM1-WAERS'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFM1-WAERS'
    itab-waers.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RF02K-LIFNR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=YES'.
    PERFORM bdc_transaction USING 'XK01'.
    ENDLOOP.
    PERFORM close_group.
    **Flat files for the above code***
    Intial screen data file.
    1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
    2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
    Table control Data:
    1 in sb 11000
    1 in sb 12000
    1 in sb 13000
    1 in sb 14000
    1 in sb 15000
    1 in sb 16000
    1 in sb 17000
    1 in sb 18000
    1 in sb 19000
    1 in sb 20000
    1 in sb 21000
    1 in sb 22000
    2 in sb 21000
    2 in sb 22000
    Regards,
    Kumar.

  • Set cursor position in console

    Hello,
    I would like to set the position of the cursor in the console (command prompt).
    Is ther a way to do this ?
    public void printChar(int x, int y, char ch) {
         <set cursor position>(x,y);
             System.out.println(ch);
        }Thanks

    Ymas wrote:
    Do i have to add something like import java.???
    No, nothing starting with "java.*" will help you. There is no way you can do that using only what Java provides itself, you will need to use external libraries.
    Chances are, you don't want to do this right now and forget about it, just write one line after another.
    If it s not too long could you write me the code for <*set cursor position*>(x,y);Find, download, learn to use JCurses or a similar library and write it. If that sounds like a lot of work for such a "simple" functionality then yes: that is a lot of work for such a little thing.
    It's generally not worth doing.

  • [ADF Faces] set cursor position to the first column input text in ADF table

    How do i set the cursor position to the first column input text when i Insert a blank row?
    My idea is to implement using javascript. document.setfocus() but how do i do it from the backing bean code? or how do i install custom js to call document.setfocus()?
    any ideas?
    Message was edited by:
    user450391

    Did you try by iterating the selected row?
    Bind the table with the managed bean and then try with below code:
    RichTable empTable;
    RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();   
    Iterator selectedEmpIter = selectedEmps.iterator();
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter = bindings.findIteratorBinding("EmpView1Iterator");
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    while(selectedEmpIter.hasNext()){
       Key key = (Key)((List)selectedEmpIter.next()).get(0);
       Row currentRow = empRSIter.getRow(key);
       System.out.println(currentRow.getAttribute("Ename"));

  • Can not deselect edit position in table control

    A table control has a property called editpos.  This property returns the cell cordinates for the cell that the use is editing and is writeable.  The property correctly returns -1 and -2 values depending if a header is selected or nothing is selected, however, if a -1 or -2 is written to the property it just selects cell 0,0.  Is this behavior a bug?
    I wanted to input -2,-2 to deselect the current cell that is being edited.  Anyone have another idea on how to achieve this?

    Thank you for the reply.  Actually, I am not interested in the table data.  I am only interested in the current edit position within the table control.  The table property editpos states
    Edit Position Property
    Property of Table.
    The row-column pair index of the current text entry. Values of (0,0) indicate the top-left text entry. A value of –1 indicates the row or column header. Values of (–2, –2) indicate that no edits are being made to the text of the control. This property does not set text focus on a control that does not already have text focus.
    Since the property returns cordinates for selected column headers (-1,x), row headers (x,-1) or no selection (-2,-2).  I was surprised if I tried to write a value of -1 or -2 to either the row or colum it would act as if I had typed a 0.  For example, (-2,-2) would select cell (0,0) and (-1,4) would select cell (0,4).  This behavior seemed like a bug to me or should at least be noted in the property help file.
    I did manage to find a solution for my particular problem however.  Since I am not trying to move to the header row or column and just wanted to deselect the current edit position I just set KeyFocus to false.

  • Programatically bring the cursor to a numerical control while VI running

    Does anyone know how to programatically move the cursor to a particular numerical control while a VI is running?
    I have a VI that polls the user for information, and at one point, the user has to repeatedly type numbers into the same numerical control and press enter. For a number of reasons, it is awkward to be messing with the mouse during this particular test. Each time the user presses a paricular button to send data a to file (which I have linked to the Return key on the keyboard by means of 'key navigation'), I would like the cursor to jump to the relevant numerical control ready for the next number to be entered on the keyboard. Does anyone have any ideas how to do this?
    I have set up a separate key navigation for thenumerical control in question, so if the user presses the Esc key, this control becomes active and the cursor is in place, but I would like to move the cursor there without this extra user button press if at all possible. 
    Regards,
    Will

    Will
     I'm not sure if this is what you are looking for but it might do what you need.
    On the block diagram right click the control in question >>create>>property node>>key focus. Now right click the property node and select Change to write. Wire a boolean true constant to it and place this snippit in the appropriate place(s) in your code depending upon your architecture.
    Hope this helps.
    Using LabVIEW 2010SP1 and TestStand 4.5

  • How to set column attributes in table control?

    I have the following requirement to build a table by using table control:
    if content of col 1 = 'Y', enable input for col 2 for that line only.
    if content of col 1 = 'N', disable input for col 2 for that line only.
    So the input attribute for col 2 in each line can be different.
    How can I achieve this?
    I have tried using loop at screen or loop at tablecontrol-cols into wa_cols statements,
    but these will change the entire column attributes to either on or off, and not on individual line.
    Instead of changing the COLUMN attributes, I think I should change the CELL attributes. 
    What is the syntax for that, is there something like tablecontrol-field?
    Thanks for any help in advance.

    I still not able to get the field attributes set on individual lines.
    These are my codes, can you help again.
    PROCESS BEFORE OUTPUT.
      MODULE pbo_0200.
      MODULE zitem_change_tc_attr.
      LOOP AT   lt_asset_item
           INTO ls_asset_item
           WITH CONTROL zitem
           CURSOR zitem-current_line.
        MODULE ZITEM_CHANGE_FIELD_ATTR.
        MODULE zitem_get_lines.
      ENDLOOP.
    MODULE zitem_change_field_attr OUTPUT.
    loop at screen.
      if ls_asset_item-replace_asset = 'X'.
         if screen-group1 EQ 'FR4'.        "these are the columns I want to turn input ON or OFF.
          screen-input = '1'.
          modify screen.
         endif.
      endif.
    endloop.
    Endmodule.
    At debug mode, the screen-input did change to '1'.  Can I check the return code of the MODIFY SCREEN statement?
    I tried to initialize the colums to be output only at screen definition, but it still doesn't help.
    I don't think I have to do anything at the PAI event.
    PROCESS AFTER INPUT.
    MODULE save_cursor_position.
      LOOP AT lt_asset_item.
       FIELD ls_asset_item-replace_asset
         MODULE get_replace_asset ON REQUEST.
        CHAIN.
         FIELD LS_ASSET_ITEM-REPLACE_ASSET.
         FIELD ls_asset_item-replace_cost.
          MODULE zitem_modify ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD ls_asset_item-mark
          MODULE zitem_mark ON REQUEST.
      ENDLOOP.
      MODULE zitem_user_command.
    Thanks again.

  • CSS positioning within table cells

    Maybe I've just been staring at this too long but I'm stumped. I want to  position a table (could be a list) within a table by setting the parent  element to relative and the position of the child element to absolute.  The only problem is that I can't get my table cells to act as parent  elements so the smaller table (or list) positions itself relative to the  wrapper div which is also set to relative. Do I have to create divs  within the table cells? If so it sort of defeats the purpose of the  table. How can I do this using appropriate markup?
    Hope this makes sense. I think my brain has gone numb.
    Here's the page I'm trying to fix:
    http://www.kirstencassidy.com/_miniprints2.html
    Thanks in advance for your help.

    Lon Winters wrote:
    What I see is a table with red borders that contain images left justified. What do you want to position - the images? I think you could do all this in CSS without any tables.
    I think what the OP is trying to do is position some text to the right of the images?
    Obvious answer as the OP has used tables is to insert another 2 column table into each existing table cell, one for the image an one for the text.
    Alternative is to use css to float the images left, give the image a right margin and then the text will appear to the right of it in the table cell. Then just style the text with some css?

  • Problem when setting cursor position property

    I'm trying to use property nodes to set the cursor position programmatically, following an arrow keypress.  When my actual data file plotted, the position assignment doesn't work properly.  If I clear the data from the graph (right click, clear graph), then the cursor responds properly.  I've attached a zipped file with VI that demonstrates the problem.  Sorry the file is large--I had to include my data file to properly demonstrate the problem.
    Thanks for any advice that help me clear this up,
    Allan
    Solved!
    Go to Solution.
    Attachments:
    My Source Distribution.zip ‏541 KB

    bracker wrote:
    I'm trying to use property nodes to set the cursor position programmatically, following an arrow keypress.  When my actual data file plotted, the position assignment doesn't work properly.  If I clear the data from the graph (right click, clear graph), then the cursor responds properly.  I've attached a zipped file with VI that demonstrates the problem.  Sorry the file is large--I had to include my data file to properly demonstrate the problem.
    Thanks for any advice that help me clear this up,
    Allan
    Include this code in 'Initialize' state.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

Maybe you are looking for