Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get cursor value...

Former Member
0 Likes
2,670

Hai friends,

Can any explain clearly the purpose of get cursor value with an simple example.

8 REPLIES 8
Read only

Former Member
0 Likes
1,307

get cursor value writes the contents of the screen field as a string to the variable.

regds,

kiran

Read only

Former Member
0 Likes
1,307
Read only

Former Member
0 Likes
1,307

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

Read only

Former Member
0 Likes
1,307

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

Read only

Former Member
0 Likes
1,307

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

Read only

Former Member
0 Likes
1,307

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.

Read only

Former Member
0 Likes
1,307

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.

Read only

0 Likes
1,307

hi,

check this,

GET CURSOR FIELD f

.

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.