How to set Cursor position in ALV
Hi,
i have an issue that how can i set cursor in alv grid.
i am using alv function modules.
if user enters wrong info (i have one input enabled filed) then i must show this row as first row and place the cursor in that wrong entry column.
does anybody worked on this kind of issue..?if so,plz send me the example code
Thanks
I think that you have to use OO ALV and use
CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
EXPORTING
IS_ROW_ID = <structure of type LVC_S_ROW > ( obsolete )
IS_COLUMN_ID = <structure of type LVC_S_COL >
IS_ROW_NO = <structure of type LVC_S_ROID >.
Hopefully, you can find the object reference of you REUSE ALV by using FM 'GET_GLOBALS_FROM_SLVC_FULLSCR'
(But i never try it)
Regards.
Similar Messages
-
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) -
Hi,
How can control cursor posiotion in alv grid,
plz help me.
Regards,
venkat.hiiii
you can use SET or GET cursor statement of ABAP.that will help you to get cursor position & to set cursor position also
regards
twinkal -
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);
}ThanksYmas 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. -
Alv grid: how to set cursor to the next field
Hi Abapers,
When I input the data in first cell and do a tab for coming to next cell to give the input it is coming back to my first cell in the ALV grid.
Any idea's on how do I deal with this.
Many Thanks,
Jagan.Hi Group,
Finally I got the solution for this, here is the stuff we need to do:
***********04/03/2010
*----Get the current cell
CALL METHOD wa_grid->get_current_cell
IMPORTING
es_col_id = li_col
es_row_no = li_rows.
**--Get Scroll Position
CALL METHOD wa_grid->get_scroll_info_via_id
IMPORTING
es_col_info = ls_col
es_row_no = ls_num.
***********04/03/2010
CALL METHOD wa_grid->refresh_table_display.
CLEAR: wa_profile1. ", wa_pro_new.
********04/03/2010
*--Set Scroll Position
CALL METHOD wa_grid->set_scroll_info_via_id
EXPORTING
is_col_info = ls_col
is_row_no = ls_num.
*----Set the cell information
ls_row-index = li_rows-row_id.
CALL METHOD wa_grid->set_current_cell_via_id
EXPORTING
is_row_id = ls_row
is_column_id = li_col
is_row_no = li_rows.
********04/03/2010
Hope this info might be useful to anyone facing the similar issue.
Cheers,
Jagan. -
How can I set cursor position inside TextInput or TextArea
Hallo.. I can't find the way for changing che cursor position inside a String in the TextInput or TextArea Component.. I hope you can help me..
Thx
MaxsetSelection(index, index);
-
[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:
user450391Did 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")); -
How to set cursor at the first line in a table control?
Hi,
I have a customized infotype screen where a table control is being used to input new values.The tab control has 30 lines.Now, the problem is that when the screen is displayed, the cursor always starts at 8th or 4th line.The behaviour is not very consistent.I tried the following statement in the PBO, but no effect.
SET CURSOR FIELD P9417-ZCOUNTRY LINE 1. ( P9417-ZCOUNTRY is the name of the tab control field where i want to set the cursor ).This is the last statement in the PBO.
Can someone please tell me why still I am not able to set the cursor at the first line? I have infact noticed that , in the debugging mode , sometimes the cursor starts at the first line.Please help. ThanksI have got a new requirement on this now. If the table control does not have any records , then the cursor position should be on the first row.Otherwise, if it already has some records, then the cursor should be at the first empty row.I wrote the code like below.
if sy-ucomm = 'INSERT'.
set cursor 'P9714-ZCOUNTRY' line 1.
else if sy-ucomm eq 'CHANGE'.
describe table itab lines fill.
fill = fill + 1.
set cursor 'P9714-ZCOUNTRY' line fill.
endif.
I am facing a strange problem now.The table control has some 10 rows when you see the screen for the first time.If the number of records already present is less than 10, I am able to position the cursor on the first empty row.But if the number is say 15, then the cursor position goes to eighth or fourth line or sometimes the first line.
Is there any way to display the last few records , ie, if there are 15 records , is there any way to display the last five rows when I see the screen for the first time, rather than showing the first 10 records?How can I position the cursor at the first empty row, when there are more records?
Thanks in advance..good answers will be rewarded.
Mahesh -
How to set the position in SAP Script
Hi Professionals,
Can anyone tell me that How can I set the position of an bitmap Image (after inserting) in SAP Script ?
by default position is in Left, I need to align it in center or somewhere else.
Anybody knows, kindly reply!
Thanks
DevinderHi,
But Can we assign a window under another window. Because I want to insert a bmp picture on particular position.
example:- there is a digital signature and wanted to insert upon a name.
So, there is a text (which is customer name) and digital signature (in bmp picture format) upon it.
Thanks
Devinder -
How to set cursor in table control?
I have a table control (Screen 300) to display invoice number and amount. For some checks we have around 200 invoices to be displayed. When user enters the invoice number in invoice text box and click on OK, it should highlight the invoice number and amount row or set the cursor position.
I have another problem.
Screen 300 is being called from Screen 200. When the user clicks on OK in 300, 300 is getting closed. Acutally it should be displayed with Cusor position or highlighted row.
I appreaciate your help ... ThanksI believe that you can use the SET CURSOR statement to do the first part of your requirement. Something like this should work:
SET CURSOR FIELD w_field LINE w_line.
Here's the info from SAP help:
Effect
: The cursor is positioned on the screen element whose name is contained in upper case in field. The data object field must be character-type and flat. The screen layout or a table control is scrolled in the display so that the screen element on which the cursor is positioned is visible. If the specified screen element is not found, the statement is ignored.
If the specified screen element is part of a table control or a step loop, the line of the table control or group of the step loop in which the cursor is positioned on the specified screen element must be specified using the addition LINE. For the data object line, the type i is expected. If there is no line or group for the value of line, or the addition LINE is not specified, the statement is ignored. The statement is also ignored if the addition LINE is specified and the screen element is not part of a table control or step loop.
I hope this helps.
- April King -
How to set cursor in perticular field Table Maintence generator?
Hi
All
I have created a table with 2 fields Start_date and End_date. Now my requirement is i have to validate the both date field as Start_Date must be LESS than or EQUAL to End_Date. In table maintenance maintenance generator i have created a event VALIDATE_DATE in event 21. Its validating perfectly. The issue is after the ERROR message the Cursor is going to the key field. I want to set the cursor at End_Date field.
I used
data:ly_pos type i.
IF NOT start_date LE end_date.
SET CURSOR FIELD 'TABLE_NAME-END_DATE' LINE sy-linno OFFSET lv_pos.
MESSAGE exxx(MsgClass).
ENDIF.
Its working for the FIRST time i am entering the new data. Next time the cursor going to the KEY field. I have been asked not to write code in SE80. Anyhow i have to set the cursor in table maintenance maintenance generator event.
Can anybody help?Hi Sourav,
Please follow the below method:
Go to Maintainance Screen (where you want the cursor setting). Goto Status - > Remember the screen name -> Double click on Program name.. Open Object list and expant Screen Tree -> double click on the same screen Number -> Go to its first tab attributs -> Change Mode -> Do F4 on Cursor Position field -> Choose the field where you want the cursor.
But this way will always set the cursor at the HardCoded Field Name.
Thanks,
Preyansh -
How to set cursor to text field from message box in swing
I am working Text Field validations in a swing application. when incorrect information is entred in text field a Message is displayed. When I click on OK button on message box I want to set the cursor position to that particular text field for which thet message is displayed.
theOffendingTextfield.requestFocusInWindow();may need to be wrapped in a Swingutilities.invokeLater,
and if you want the text highlighted (so you can just type in new text)
theOffendingTextfield.requestFocusInWindow();
theOffendingTextfield.selectAll(); -
How to set cursor in a component by default
Hi all,
Does anybody know how to set the cursor inside a textArea? or at any particular component of a frame?
Thanks in advance.textAreaObj.requestFocus() doesn't do it?
If that doesn't do it, then try textAreaObj.setSelectionStart(0).
You may have to force a repaint(), possibly, as well. -
Resolved:how to set default LAYOUT for ALV list display
hey guys,
In my alv report there are 20 cloumns.
after display i usualy choose 12 of them from CHOOSE LAYOUT option and then give it to print...
how to set this LAYOUT as default
sorry guys i figured it out..
but can we give it programiticlay?
Edited by: kumar gaurav on May 27, 2008 8:15 AMhi,
you can do it.
after declaring the catlog table you will give as
wa_catlog-seltext_l = 'material'.
wa_catlog-datatype = 'char'.
wa_catlog-outputlen = 18.
wa_catlog-fieldname = 'matnr'.
append wa_catlog to i_catlog.
clear wa_catlog.
wa_catlog-seltext_l = 'plantl'.
wa_catlog-datatype = 'char'.
wa_catlog-outputlen = 4.
wa_catlog-fieldname = 'werks'.
append wa_catlog to i_catlog.
clear wa_catlog.
similarly what sequence you give here i.e. material , plant etc. you get the output in the same oder you can even give only the fields you want in the output.
rewards points if useful.
siri -
How to set cursor property from "snap-to-plot" to free?
dear all,
is there any one know how to set a cursor property from "snap-to-plot" to "free"?
this cursor is in a XY graphy
i couldn't find coresponding property in the XY graph property node
thank you
JackIt looks like there are different property names depending on your labview version.
You need to select the ActCrsr and then use the Cursor.Lockstyle property in LV7.1
You need to select the ActCrsr and then use the Cursor.CursorMode property in LV8.2.
Maybe you are looking for
-
Sometimes after deleting the library from the iPhone the library pairs with the Remote app but will not open the Windows 8.1 PC's iTunes library. It'll do nothing once added and then state that an error occurred.
-
Cannot get 16 X 9 aspect ratio on NTSC monitor
Just installed a Radeon 9800 pro Mac edition to replace the original GeForce 5200 that came with the computer. The new card is great and gives 30 fps on the main LaCie electron blue 19" monitor when "Full screen" mode is selected. Problem is ... when
-
Is there a backdoor to filevault 2 or possible way to regain access after a lost password?
Is there a backdoor to filevault 2 or possible way to regain access after a lost password?
-
XL Reporter Error (667)
Hi, Iam getting an error when when I try to launch a report, the error is as follows; An error occurred during th eprocess "Report Initialize". Description (667) MetaInfo.xml not found! (Please contact the administrator to fix the repository connecti
-
Hi Guys When I create or modify a customer in CRM to ERP is not replicated, in the outbound queue indicates CRM SYSFAIL error that says:" Gruping is not assigned and account group in IS-M". Please help my! Thank you winston