2008 Apr 24 12:02 PM
Hi,
Can anyone tell me the use of 'AT Line Selection' event?Is it possible to set a break point in the code after 'At line selection ' event?
Regards,
Hema
Hi,
Can anyone tell me the use of 'AT Line Selection' event?Is it possible to set a break point in the code after 'At line selection ' event?
Regards,
Hema
2008 Apr 24 12:04 PM
Hi Hema,
this event is used during Interactive reports.
whenever u double click on the line in basic list, AT LINE-SELECTION event is trigetted.
Yes, it is possible to use breakpoint .
regards,
madhu
2008 Apr 24 12:06 PM
By using AT LINE-SELECTION event u can create one more list and after double clicking it u can get to the second list.
See the Example Program,Just Observe how to use AT LINE-SELECTION :
REPORT ZB13FA_REP_EVENTS MESSAGE-ID ZHNC LINE-COUNT 12(2).
INCLUDE ZB13FA_REP_EVENTS_TOP. " GLOBAL DATA
INCLUDE ZB13FA_REP_EVENTS_SEL. " SELECTION SCREEN
INCLUDE ZB13FA_REP_EVENTS_SUB. " SUBROUTINES
*EVENTS
INITIALIZATION.
P_VEND = 3730.
AT SELECTION-SCREEN.
PERFORM F_VAL_VEND USING P_VEND
changing SY-DBCNT.
IF SY-DBCNT = 0.
MESSAGE E000 WITH TEXT-E01.
ENDIF.
START-OF-SELECTION.
PERFORM F_PORDER USING P_VEND
CHANGING IT_VEND.
END-OF-SELECTION.
IF SY-SUBRC = 0.
ELSE.
MESSAGE I000 WITH TEXT-I01.
ENDIF.
PERFORM F_DISP USING IT_VEND
CHANGING WA_VEND.
WRITE : / ' LIST NO', SY-LSIND.
TOP-OF-PAGE.
WRITE : / TEXT-H01 , 12 TEXT-H02 .
TOP-OF-PAGE DURING LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
WRITE : / TEXT-H01, 12 TEXT-H05, 19 TEXT-H06, 41 TEXT-H07.
WHEN 2.
WRITE : / TEXT-H06,21 TEXT-H08, 35 TEXT-HO9,44 TEXT-HO4.
ENDCASE.
END-OF-PAGE.
WRITE :/ TEXT-H03, SY-PAGNO.
AT LINE-SELECTION.
SET PF-STATUS 'ZNEW'.
PERFORM F_GET_EKPO USING WA_VEND-EBELN
CHANGING IT_EKPO.
PERFORM F_DISPL_DL1 USING IT_EKPO
CHANGING WA_EKPO.
AT USER-COMMAND.
GET CURSOR FIELD W_FIELD .
CASE SY-UCOMM.
WHEN 'DISP'.
IF W_FIELD = 'WA_EKPO-EBELN'.
SET PARAMETER ID 'BES' FIELD WA_EKPO-EBELN.
CALL TRANSACTION 'ME23N'.
ELSE.
MESSAGE E000(ZHNC) WITH 'INVALID FIELD,PLZ SELECT CORRECT FIELD'.
ENDIF.
ENDCASE.
CASE SY-UCOMM.
WHEN 'MDIS'.
IF W_FIELD = 'WA_EKPO-MATNR'.
SET PARAMETER ID 'MAT' FIELD WA_EKPO-MATNR.
CALL TRANSACTION 'MM03'.
ELSE.
MESSAGE E000(ZHNC) WITH 'INVALID FIELD,PLZ SELECT CORRECT FIELD'.
ENDIF.
ENDCASE.
CASE SY-UCOMM.
WHEN 'SUM'.
SY-LSIND = SY-LSIND - 1.
PERFORM P_DISP_SUM USING IT_EKPO
CHANGING WA_EKPO.
SET PF-STATUS 'ZNEW' EXCLUDING 'SUM'.
ENDCASE.
CASE SY-UCOMM.
WHEN 'NEWV'.
LEAVE SCREEN.
WHEN 'EXIT1'.
LEAVE PROGRAM.
ENDCASE.
And yes you can use Break Point in this event.
2008 Apr 24 12:07 PM
When the user triggers the function code PICK, AT LINE-SELECTION is always triggered if the cursor is positioned on a list line. The function code PICK is, by default, always linked with function key F2 and hence with the mouse double-click. Consequently, if you have a simple program that does not react to any further user actions, you only need to write this event block.
AT LINE-SELECTION.
<statements>.
As described in the section Dialog Status for Lists, the function code PICK is always added to the standard list status when you have an AT LINE-SELECTION event in your program.
If you assign PICK to other function keys or menu entries, AT LINE-SELECTION is also triggered when the user chooses then. You should avoid this for the sake of the semantics.
Please have a look at below link.
[List Events in an ABAP Program |http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/frameset.htm]
I hope it helps.
Thanks,
Vibha
Please mark all the useful answers
2008 Apr 24 12:07 PM
Hi Hema,
At line selection event is triggered when you are clicking on a line in your classical report output.
Classical report means a report build on only write statements.
In that output, if you click on a line, At Line selection event will be executed. Based on the selection you can do further actions in that event. For example, your display has PO number as a column. When you click on a PO number, you want to display ME23n with that PO number. You can do that using this event.
Yes, you can set a break-point in the code written after that event. It will get executed when you are selecting a line in your report output.
Thanks and Regards,
Lakshmi.
2008 Apr 24 12:07 PM
Hi,
AT LINESELECTION : this event is generally used for interactive reports.
whenever you put cursor on a line and use this event Function PICK gets activated.
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.
Reward points if helpful.
Thanks and regards.
2008 Apr 24 12:09 PM
Hi,
AT LINE-SELECTION is a event for Interactive Reports events
This event works as when you select a line in Basic list depending on that line it will generates a another reports i.e. Interactive Report.
AT LINE-SELECTION event selects a line and as per your requirement you can write logic to generate a report.
Thanks
Ganesh
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |