‎2007 Jan 18 9:38 AM
Hai friends,
Can any explain clearly the purpose of get cursor value with an simple example.
‎2007 Jan 18 9:42 AM
get cursor value writes the contents of the screen field as a string to the variable.
regds,
kiran
‎2007 Jan 18 9:43 AM
‎2007 Jan 18 9:43 AM
Hi
Check out this....
DATA: HOTSPOT(10) VALUE 'Click me!',
F(10), OFF TYPE I, LIN TYPE I, VAL(40), LEN TYPE I.
FIELD-SYMBOLS <FS>.
ASSIGN HOTSPOT TO <FS>.
WRITE 'Demonstration of GET CURSOR statement'.
SKIP TO LINE 4.
POSITION 20.
WRITE <FS> HOTSPOT COLOR 5 INVERSE ON.
AT LINE-SELECTION.
WINDOW STARTING AT 5 6 ENDING AT 45 20.
GET CURSOR FIELD F OFFSET OFF
LINE LIN VALUE VAL LENGTH LEN.
WRITE: 'Result of GET CURSOR FIELD: '.
ULINE AT /(28).
WRITE: / 'Field: ', F,
/ 'Offset:', OFF,
/ 'Line: ', LIN,
/ 'Value: ', (10) VAL,
/ 'Length:', LEN.
SKIP.
GET CURSOR LINE LIN OFFSET OFF VALUE VAL LENGTH LEN.
WRITE: 'Result of GET CURSOR LINE: '.
ULINE AT /(27).
WRITE: / 'Offset:', OFF,
/ 'Value: ', VAL,
/ 'Length:', LEN.
Regards
Su
‎2007 Jan 18 9:44 AM
get cursor is giving the field name , field value etc. where your cursor is currently located.
generally we are using for interactive reporting.
in at line-selection.
get cursor field v_field value v_value.
here if you are dbl clicking on a perticular field v_field will contain the field name and v_value will contain the value of that field on that position.
regards
shiba dutta
‎2007 Jan 18 9:46 AM
for eg in interactive reporting, when ever u click on matnr field and the same value need to be passed to mm01 matnr then get cursor need to be used for this
‎2007 Jan 18 9:46 AM
refer this demo code and click on the any one field value of the output ..
it wil take u to secondary list -
tables pa0001.
data: cursorfield(20).
data: begin of itab occurs 0.
include structure pa0001.
data end of itab.
start-of-selection.
select * from pa0001 up to 2 rows into table itab.
loop at itab.
write:/ itab-pernr.
endloop.
AT LINE-SELECTION.
GET CURSOR FIELD CURSORFIELD.
case cursorfield.
when 'ITAB-PERNR' .
read table itab with key pernr = itab-pernr.
write:/ itab-plans.
endcase.
‎2007 Jan 18 9:53 AM
Hi Vighnesh,
GET CURSOR is used to uniquely identify the field where your cursor is clicked.
In contrast HIDE will hide the whole row and supply for further processing.
Regards,
Venkat.
‎2007 Jan 18 9:56 AM
hi,
check this,
This statement transfers the name of the screen element on which the cursor is positioned during a user action to the variable f. If the cursor is on a screen element, sy-subrc is set to 0. Otherwise it is set to 4.
The addition:
· OFFSET writes the cursor position within the screen element to the variable off.
· LINE writes the line number of the table to the variable lin if the cursor is positioned in a table control. If the cursor is not in a table control, lin is set to zero.
· VALUE writes the contents of the screen field in display format that is, with all of its formatting characters as a string to the variable val.
· LENGTH writes the display length of the screen field to the variable len.
reward if helpful.