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

at line selection

Former Member
0 Likes
738

pls send cide for at line selction

pls send cide for at line selction

5 REPLIES 5
Read only

Former Member
0 Likes
711

Hi,

REPORT demo_list_interactive_3 .

START-OF-SELECTION.

WRITE 'Basic List'.

AT LINE-SELECTION.

WRITE 'Secondary List'.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE sy-lsind.

WHEN 1.

WRITE 'First Secondary List'.

WHEN 2.

WRITE 'Second Secondary List'.

WHEN OTHERS.

WRITE: 'Secondary List, Level:', sy-lsind.

ENDCASE.

ULINE.

Read only

Former Member
0 Likes
711

hi,

report zresh.

tables: trdir.

data: itrdir type table of trdir with header line.

select-options: s_name for trdir-name.

start-of-selection.

select * into table itrdir

from trdir

where name in s_name.

loop at itrdir.

format hotspot on.

write:/ itrdir-name.

hide itrdir-name.

format hotspot off.

endloop.

at line-selection.

editor-call for report itrdir-name display-mode.

Regards

Reshma

Read only

Former Member
0 Likes
711

Hi,

AT LINE-SELECTION.

Effect

Event in interactive reporting

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.

Note

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.

Example

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.

Regards,

Ram

Read only

Former Member
0 Likes
711

Hi Rajamahender,

Refer this code :

at line-selection.

get cursor field d_field value d_value.

case d_field.

when'D_MATERIAL_RECORD-MATNR'.

select maktx into d_material_record-maktx from makt where matnr = d_value and spras = sy-langu.

write:/ 'MATERIAL TYPE DESCRIPTION', 30 d_material_record-maktx.

endselect.

when'D_MATERIAL_RECORD-MTART'.

select mtbez into d_material_record-mtbez from t134t where mtart = d_value and spras = sy-langu.

write:/ 'TYPE DESCRIPTION', 30 d_material_record-mtbez.

endselect.

when others.

write:/'PLEASE DOUBLE CLICK ON A HIGHTLIGHTED RECORD'.

endcase.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
711

hi friend,

DATA: input_field(100) TYPE c,

line_num TYPE i.

START-OF-SELECTION.

WRITE 'Input text:'.

SET BLANK LINES ON.

FORMAT INPUT.

WRITE / input_field.

FORMAT INPUT OFF.

WRITE / '>>> OK <<<' COLOR 5 HOTSPOT.

AT LINE-SELECTION.

IF sy-lisel = '>>> OK <<<'.

line_num = sy-lilli - 1.

READ LINE line_num FIELD VALUE input_field.

WRITE: 'The input was:',

/ input_field.

ENDIF.

hope u ll get clear from this code

plz reward if its helpful,

thanks and regards

vijay