Set cursor in specific position
Hi everyone,
I have a simple report which display people's name that are arrange alphabetically using the WRITE statement. The names are separated according to the starting letter group and are displayed in a separate page.
I also have push buttons (GUI Status) above the report display
Example:
[ A - C ] [ D - F ] <b> [ G - I ]</b> and so on.. <----
These are push buttons
Group A-C Page 1 of 3
Alvin
Aaron
Barry
Calvin
.. and so on...
Group D-F Page 2 of 3
Dionne
Evans
Elliot
Franky
Francis
.. and so on...
<b>Group G-I</b> Page 3 of 3
Gerald
Harold
Irving
.. and so on...
My question is: How will my cursor go to the title 'Group G-I' when I press the push button [ G - I ]?
There are hundreds of names being displayed and you cannot see the title 'Group G-I' in the screen the moment I run the program unless you press page down. It is in the 3rd page. The problem is the cursor does not go to this title in page 3 when I press the push button.
Thank you in advance!
use this
at user-conmmand.
case sy-ucomm.
when 'FIRST'.
SCROLL LIST TO PAGE 1.
endcase.
regards
shiba dutta
Similar Messages
-
How to Place the Cursor at Specific Position with-in a Char Field ?
Forms 4.5 ver.
Sun Solaris / Citrix env.
Char Field - Length 65434
How Can I Place the Cursor at "Specific Location"
with in a Field ?
with GO_ITEM('field Name') I can place the Cursor at Specific Field.
But, How Can I achieve to Place the Cursor at Specific
Position within that Field ?
I know, the starting position, length of string I want to hightlight with the Cursor.
tried using :
go_item('substr(field_name,position,length)') ;
but didn't work !
Is it possible ?
Thanks, PeriThe only cursor postion behavior that can be controled is the item property "Keep Position".
The following is the text from the on-line help for item property "Keep Position"
KEEP_POSITION Specifies whether the Keep Position property should be True or False. When Keep Position is True, the cursor returns to the same position it was in when it left the text item. When Keep Position is False, the cursor returns to the default position in the text item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE. -
Setting cursor on specific TEB
Hi
I have a slide with 6 TEB's and I need the cursor to be in the first TEB every time the slide loads up. At the moment it's very random. The cursor is never in the same TEB when loading.
I am using Captivate 6.
cheers
JulieHi,
use the message display this way.....
message 'warning message' type 'S' display like 'W'.
Thanks,
Sid -
Set cursor in a specific view of transaction MM01/MM02
Hi,
We have to check a condition in the user-exit EXIT_SAPLMGMU_001, for transaction MM01/MM02, and if the condition fails the client wants to set the cursor in a specific field from a specific view. Is it possible? I tried to use the sentence SET CURSOR referenced to a remote program but it doesn't work.
Does anybody knows how to solve this problem?
Thanks in advance
Regards
MaribelHi
I hope, you have read the documetation attached with this Standard Enhancement - MGA00001.
EXIT_SAPLMGMU_001
Where Is the Customer Exit - EXIT_SAPLMGMU_001 called?
The customer exit is in function module MATERIAL_UPDATE_ALL. The
function module checks the data for errors (logical relationships,
foreign keys, fixed domain values, and so on) when the material master
is updated.
Use
o New fields
You can make checks possible for new fields of your own. These
checks must be identical to the checks that you carry out for your
new fields in online maintenance.
o Existing fields
For existing fields, you can extend and intensify the checks.
You can also change data for descriptions and general material data
(MARA). For example, the descriptions can be generated from attributes
of the material.
Limitations
You cannot bypass existing checks.
Interface to Application
The respective data of the current logical transaction is contained in
the structures, for example, in structure WMARA for MARA. Nonrelevant
structures are transferred with their initial values.
General material data that can be changed (CMARA) has the structure
MARU. This MARA view contains fewer internal fields than MARA itself. If
WMARA is filled, CMARA is also filled when accessed.
The customer exit contains the exception APPLICATION_ERROR for your
self-defined error situations.
Using the language element MESSAGE .. RAISING APPLICATION_ERROR, you can
terminate the current (logical) transaction and display your message in
the log.
Also, I guess, have you put some code in the Includes available with the EXITS and then activated the Project in CMOD.
<b>Reward points</b>
Regards -
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 gurus,
In the transaction COIB (creation of serialized assemblies).I need to do the following... Program name (SAPLCOIB - Standard program in module pool)
After i give the material no and serial no (in serialized assembly) by a barcode scanner, when i press enter i have to call EXPLODE in Application toolbar and my cursor position should come to serial no(in Assigned serialized components).
After i give all the serial no by a bar code scanner i have to call TRANSFER button.
After that my cursor should come to serial no ( in Serialized assembly).
can you help me regarding this requirement....
Urgent please...
Thanks in Advance,
Navaneeth.You can set the codes below :-
1. SET CURSOR FIELD f. ---> It will set the cursor at the begining of the field f
You can use the additions :- OFFSET off
LINE lin (In step loop )
Regards
Srikanta Gope -
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. -
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. -
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
ThanksI 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. -
How to add a button in the view at a specific position
Hi Gurus,
We have a requirement :
To add a button or image at a specific position in the view which is like an indicator showing different color
based on another field .
Example :
Adding a button next to a drop down flield and changing the color of the button based on the name of the color choosen in the drop down .
or Adding an image which can be changed based on the dropdown value or the value entered in the input field .
Thanks ,
Naval Bhatt.Hi,
Create an Attribute ZINDICATOR , in the same context node in which the dropdown(picklist) attribute,exists.
Let it be a CHAR 1 field.
Implement GET_P and GET_ method.
Pull this field beside the dropdown fields in view configuration.
Now the code =>
Implement the Get_P_ZINDICATOR for this attribute as explained by Robert
Implement Get_ZINDICATOR method as follows
DATA:
lr_current TYPE REF TO if_bol_bo_property_access,
lr_entity TYPE REF TO cl_crm_bol_entity,
coll TYPE REF TO if_bol_entity_col.
lr_current ?= collection_wrapper->get_current( ).
IF lr_current IS NOT BOUND.
value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
RETURN.
ELSE.
dref = lr_current->get_property( 'ZINDICATOR' ) .
ENDIF.
IF dref IS NOT BOUND.
value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
RETURN.
ENDIF.
TRY.
value = if_bsp_model_util~convert_to_string( data_ref = dref
attribute_path = attribute_path
IF value IS INITIAL.
value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
* ELSEIF value EQ 'R'
* value = cl_thtmlb_util=>get_icon_url( 'check_overdue_status.gif' ). " gives RED LIGHT
ELSEIF value EQ 'Y' .
value = cl_thtmlb_util=>get_icon_url( 'check_due_status.gif' ). " gives YELLOW light
ELSEIF value EQ 'G'.
value = cl_thtmlb_util=>get_icon_url( 'check_nodue_status.gif' ). " gives GREEN light
ENDIF.
CATCH cx_bsp_conv_illegal_ref.
CLEAR value.
RETURN.
CATCH cx_root.
CLEAR value.
RETURN.
ENDTRY.
Generally check_overdue_status.gif and other images are std. and are present in all skins.
You need more colors then you have to add those images in the MIME repository in the images folder of the SAP SKIN folder.
You must implement the eventhandler for Dropdown field. For this in the GET_P method of dropdown, use
CASE iv_property
WHEN if_bsp_wd_model_setter_getter=>fp_server_event.
rv_value = 'COLOUR_SELECTED'.
ENDCASE.
and then implement the event handler EH_ONCOLOUR_SELECTED.
In this event handler, you must set the ZINDICATOR value as ' ' , 'R','G','Y' etc depending upon what is selected in dropdown.
This ensures that a server roundtrip is triggered and so the GET method of indicator field is called as soon as dropdown value
is selected.
Hope this helps.
Thanks & Regards
Suchita -
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 -
Set cursor alv grid (not using objects)
I got a question on ALV GRID (not using objects), please let me know if you have pointers. Thanks.
Output has 2 screens both has different contents. The output is generated using internal table1 and 2 and using FM 'REUSE_ALV_GRID_DISPLAY_LVC' (both screen use same FM).
First screen has multiple pages of output (say 10 pages). User scrolled page 5 and line 10 of first screen and then double clicked it takes to screen #2. After completion of screen #2, the back arrow should get back to page 5 and line 10 of screen #1. Currently the back arrow gets to screen#1 page 1 and line 1. How to remember the cursor position in alv grid and instruct the cursor to go there?
Appreciate the input.
Note: I tried "set cursor line n" with "Scroll" command but no luck. http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba47e35c111d1829f0000e829fbfe/content.htmThanks for the inputs.
FYI, I got it implemented using method CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
The method is called by 'REUSE_ALV_GRID_DISPLAY_LVC' form 'PF_STATUS_SET' when the ALV grid output is presented each time.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_bypassing_buffer = 'X'
i_callback_program = gc_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = lwa_layout
it_fieldcat_lvc = git_fc_lvc
i_default = ' '
TABLES
t_outtab = git_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM alv_event_pf_status_set USING rt_extab
TYPE slis_t_extab.
DATA lo_ref1 TYPE REF TO cl_gui_alv_grid.
*Get the reference to class "lo_ref1" for the ALV report
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_ref1.
*set the focus of cursor in ALV
CALL METHOD lo_ref1->set_current_cell_via_id
EXPORTING
is_row_no = gv_row. "row number where you want to focus the cursor
ENDFORM. -
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 -
Set-Cursor In TableControl Help Help Help
Hello Friends
Please HelpOut for Sure
i had an table control which is filled by internal Table itab_emp
i m applying condition on that internal table
its giving error message
i want that cursor should be placed to that position that gives errormessage
i m sending u code
Just tell me changes
LOOP AT ITAB_EMP WHERE MARK = 'X' .
IF SY-SUBRC = 0.
ITAB_TEST[] = ITAB_EMP[].
DELETE ADJACENT DUPLICATES FROM ITAB_TEST.
LOOP AT ITAB_TEST.
CLEAR SUM .
LOOP AT ITAB_EMP WHERE PERID = ITAB_TEST-PERID.
SUM = SUM + ITAB_EMP-OTIME.
IF SUM > '100000'.
MESSAGE E018.
<b>ELSEIF ITAB_EMP-OTIME > '010000'.
MESSAGE E017.
SET CURSOR FIELD ITAB_EMP-OTIME .</b> ELSE.
MOVE-CORRESPONDING ITAB_EMP TO ITAB_OTAPP .
ITAB_OTAPP-OBJID = 1.
ITAB_OTAPP-INACT = 'X'.
ITAB_OTAPP-TODTE = ZHR_PR_M_OTAPP-TODTE.
ITAB_OTAPP-FRDTE = ZHR_PR_M_OTAPP-FRDTE.
ITAB_OTAPP-IMMHD = ZHR_PR_M_OTAPP-IMMHD.
ITAB_OTAPP-CRETM = SY-UZEIT.
ITAB_OTAPP-CREON = SY-DATUM.
ITAB_OTAPP-CREBY = SY-UNAME.
APPEND ITAB_OTAPP.
ENDIF.
ENDLOOP.
ENDLOOP.
endif.
endloop.
LOOP AT ITAB_OTAPP INTO WA_ITAB_OTAPP.
MODIFY ZHR_PR_M_OTAPP FROM WA_ITAB_OTAPP.
ENDLOOP.
BOLD lines are the condition checking
if check all the lines and then if any of the line gives error it reflects now i want to place cursor on that field which is giving error
sy-tabix will work
BUT HOW?????
Hope this time any of the genius gotmy problem
With Best Regards
RubySome of the logic is a bit confusing (would be easier to read if you used the "Code" button in the SDN message editor)... for example:
LOOP AT ITAB_EMP WHERE MARK = 'X' .
IF SY-SUBRC = 0.
... the "IF SY-SUBRC" won't be reached unless there is at least one row where "mark = 'X'.''...
Anyhow, where is this code implemented currently?... the usual approach to validating a table control is to have a module called inside the "loop at table control" in the PAI of the screen flow... then the contents of each row on the screen will get passed into your logic a row at a time automatically and the "set cursor field" + "message e999(zz)" type code should work as it will refer to the current row being checked.
Jonathan -
Hi experts,
I want to position the cursor in a screen field.
I gave SET CURSOR FIELD GS_ASSEMBLY-SERNR in PAI.
But still the cursor is not in required position.
Pls help me to do this.
Thanks.Hi Murugan ....
in the screen example 100- > in <b>Attribute's tab</b> ( first tab ) there is Other Attriubutes block which is 3rd selection screen in the screen..
<b>Exactly below the <b>Next Screen</b> field that is the <b>Cursor position</b> .
<b>for setting the cursor on the screen</b>
<b>there do the F4</b> it will show the <b>list of the fields which are all declared in the screen by you ..</b>
<b>just select the field</b> ..... inwhich field you want to set the cursor .</b>then <b>activate</b> it ... execute and see ...
the cursor will be there on the cursor selected field .
reward points if it is usefull ...
Girish
Maybe you are looking for
-
Safari loading pages slowly / high latency
I have recently been asked by one of my clients to look at a problem with their 3 macs at their place of business. They are an iMac, a macbook and a macbook air. They have all started to exhibit the same problem of being slow to load web pages using
-
Hi everyone My previous laptop recently crashed and I know have a Windows laptop for which I would like to buy Elements (I had Photoshop for Mac which I can now no longer use). How do I go about creating a back up of the software if I buy the downloa
-
I go the n95 TV out and I was curious if I can use it on the n97 as I can see there is settings for the TV out on the nokia n97 but when I use it don't work, so what's the problem?
-
Blackberry Bold 9700 problem after upgrading software
i downloaded the 6.0 software on my blackberry and after that it wouldnt let me connect my email account to my phone. so inrder to do that i had to download this app, forgot the name, but once it downloaded the phone needed to be rebooted, after that
-
Hello all, I want the system not to allow the posting of invoice for an vendor account group if it exceeds particular amount. Please let me know if there is any config setting. Or else, do I need to created a Validation for that.