Application Development 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: 

AT Line-Selection

Former Member
0 Kudos

Hi,

what is AT Line-Selection ? What is criteria of using this event?

Please help me.

1 ACCEPTED SOLUTION

Former Member

AT Line-Selection

This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.

The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.

regards,

srinivas

<b>*reward for useful answers*</b>

10 REPLIES 10

Former Member
0 Kudos

HI,

Syntax

AT LINE-SELECTION.

This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list - provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.

Note

If the function key F2 is linked with a function code different than PICK, each double click will trigger its even, usually AT USER-COMMAND, and not AT LINE-SELECTION.

Example

This program works with the standard list status. A line selection with the left mouse key causes the event AT LINE-SELECTION and creates details lists.

REPORT demo_at_line_selection.

START-OF-SELECTION.

WRITE 'Click me!' COLOR = 5 HOTSPOT.

AT LINE-SELECTION.

WRITE: / 'You clicked list', sy-listi,

/ 'You are on list', sy-lsind.

IF sy-lsind < 20.

SKIP.

WRITE: 'More ...' COLOR = 5 HOTSPOT.

ENDIF.

**********please reward points if the information is helpful to you**********

Former Member
0 Kudos

Hi,

at line-selection : evey time user dbl-clicks(F2) on the list data this event will trigger.

If you want to trigger the secondary list based on the values from the primary list you can use this event.

Reward if helpful.

Former Member
0 Kudos

AT LINE-SELECTION

Syntax

AT LINE-SELECTION.

Effect

This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list - provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.

Note

If the function key F2 is linked with a function code different than PICK, each double click will trigger its even, usually AT USER-COMMAND, and not AT LINE-SELECTION.

Example

This program works with the standard list status. A line selection with the left mouse key causes the event AT LINE-SELECTION and creates details lists.

REPORT demo_at_line_selection.

START-OF-SELECTION.

WRITE 'Click me!' COLOR = 5 HOTSPOT.

AT LINE-SELECTION.

WRITE: / 'You clicked list', sy-listi,

/ 'You are on list', sy-lsind.

IF sy-lsind < 20.

SKIP.

WRITE: 'More ...' COLOR = 5 HOTSPOT.

ENDIF.

Regards,

Pavan

Former Member
0 Kudos

Hi Joshi,

This command is used in interactive reporting.

If you would like to capture a value from a line of the report then we use this AT LINE-SELECTION and then use the captured value to perform any other operation based on that.

<b>Reward points if this info helps,</b>

Kiran

Former Member
0 Kudos

Hi

It is the one of the Interactive event in Interactive report programming

When you double click on a field in the basic list then if you wants to go to a secondary list related to that field this is used.

We handle the number of secondary reports using the system variable SY-LSIND.

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi,

AT LINE-SELECTION event is used in interactive reports.

when ever you select a specific record (ie select a specific line)

this event gets triggered. and you can store the details of that record using

HIDE statement.for any other details refer to interactive reports.

Regards,

Srinivas

Former Member
0 Kudos

hi

AT LINE-SELECTION.

<b>Effect

Event in interactive reporting</b>

This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.

The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.

In most cases, the information from the selected line is used to retrieve more comprehensive information by direct reading. When displaying the original list, you store the key terms needed for this in the HIDE area of the output line.

<b>

Note</b>

You can choose a line and start new processing even in the details lists.

The following system fields are useful for orientation purposes, since their values change with each interactive event executed.

SY-LSIND

Index of list created by current event (basic list = 0, 1st details list = 1, ...)

SY-PFKEY

Status of displayed list (SET PF-STATUS)

SY-LISEL

Contents of selected line

SY-LILLI

Absolute number of this line in the displayed list

SY-LISTI

Index of this list - usually SY-LSIND - 1 (READ LINE)

SY-CUROW

Last cursor position: Line in window

SY-CUCOL

Last cursor position: Column in window (GET CURSOR)

SY-CPAGE

1st displayed page of displayed list

SY-STARO

1st displayed line of this page of displayed list

SY-STACO

1st displayed column of displayed list (SCROLL LIST)

The system field SY-LSIND defines the line selection level (basic list: SY-LSIND = 0).

System field for interactive reporting are also contained in the System Fields for Lists documentation.

<b>Example</b>

DATA TEXT(20).

START-OF-SELECTION.

PERFORM WRITE_AND_HIDE USING SPACE SPACE.

AT LINE-SELECTION.

CASE TEXT.

WHEN 'List index'.

PERFORM WRITE_AND_HIDE USING 'X' SPACE.

WHEN 'User command'.

PERFORM WRITE_AND_HIDE USING SPACE 'X'.

WHEN OTHERS.

SUBTRACT 2 FROM SY-LSIND.

PERFORM WRITE_AND_HIDE USING SPACE SPACE.

ENDCASE.

CLEAR TEXT.

FORM WRITE_AND_HIDE USING P_FLAG_LSIND P_FLAG_UCOMM.

WRITE / 'SY-LSIND:'.

PERFORM WRITE_WITH_COLOR USING SY-LSIND P_FLAG_LSIND.

TEXT = 'List index'.

HIDE TEXT.

WRITE / 'SY-UCOMM:'.

PERFORM WRITE_WITH_COLOR USING SY-UCOMM P_FLAG_UCOMM.

TEXT = 'User command'.

HIDE TEXT.

IF SY-LSIND > 0.

WRITE / 'PICK here to go back one list level'.

ENDIF.

ENDFORM.

FORM WRITE_WITH_COLOR USING P_VALUE

P_FLAG_POSITIVE.

IF P_FLAG_POSITIVE = SPACE.

WRITE P_VALUE COLOR COL_NORMAL.

ELSE.

WRITE P_VALUE COLOR COL_POSITIVE.

ENDIF.

ENDFORM.

<b>reward points for helpful ans</b>

Regards

Ankit

Former Member
0 Kudos

hi,

go to the followig thread

surely help u

<b>plz reward if useful</b>swati

Former Member
0 Kudos

hi,

at line-selection : evey time user dbl-clicks(F2) on the list data this event will trigger.

If you want to trigger the secondary list based on the values from the primary list you can use this event.

i.e after outputting basic list to user when a user clicks on an item which may have some sub items to drill down to that sub items list we use this AT LINE-SELECTION event.

AT LINE-SELECTION event usually provides a the user to have a full detailed information about the items.

if helpful reward some points.

with regards,

Suresh Aluri.

Former Member

AT Line-Selection

This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.

The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.

regards,

srinivas

<b>*reward for useful answers*</b>