2009 May 13 7:24 AM
Is it possible to use the three interactive events i.e. 'AT-LINE SELECTION, AT USER COMMAND and AT PF-STATUS' in a single report.
2009 May 13 7:26 AM
Hi Santosh,
Yes, You can use the 3 together in a single report. Here is a sample code.
****************DATA DECLARATIONS*********************
SELECT carrid " Airline Code
connid " Flight Connection Number
airpfrom " Departure airport
airpto " Destination airport
deptime " Departure time
arrtime " Arrival time
FROM spfli
INTO TABLE t_flight.
DESCRIBE TABLE t_flight LINES w_lines .
*"--------------------------------------------------------------------*
* PF-Status *
*"--------------------------------------------------------------------*
SET PF-STATUS 'SELECT' .
*"--------------------------------------------------------------------*
* AT USER COMMAND EVENT *
*"--------------------------------------------------------------------*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELECT_ALL'.
w_check = 'X'.
*ADD 4 TO W_LINE.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line .
MODIFY LINE w_line FIELD VALUE w_check .
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
CLEAR w_line.
*"--------------------------------------------------------------------*
* AT LINE SELECTION EVENT *
*"--------------------------------------------------------------------*
AT LINE-SELECTION
LOOP AT t_flight INTO fs_flight.
WRITE :
/
w_check AS CHECKBOX,
w_mark,
fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002.
ENDLOOP.
This is just a sample code.You can use your own functionality and put them together.
Much Regards,
Amuktha
2009 May 13 7:26 AM
Hi Santosh,
Yes, You can use the 3 together in a single report. Here is a sample code.
****************DATA DECLARATIONS*********************
SELECT carrid " Airline Code
connid " Flight Connection Number
airpfrom " Departure airport
airpto " Destination airport
deptime " Departure time
arrtime " Arrival time
FROM spfli
INTO TABLE t_flight.
DESCRIBE TABLE t_flight LINES w_lines .
*"--------------------------------------------------------------------*
* PF-Status *
*"--------------------------------------------------------------------*
SET PF-STATUS 'SELECT' .
*"--------------------------------------------------------------------*
* AT USER COMMAND EVENT *
*"--------------------------------------------------------------------*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELECT_ALL'.
w_check = 'X'.
*ADD 4 TO W_LINE.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line .
MODIFY LINE w_line FIELD VALUE w_check .
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
CLEAR w_line.
*"--------------------------------------------------------------------*
* AT LINE SELECTION EVENT *
*"--------------------------------------------------------------------*
AT LINE-SELECTION
LOOP AT t_flight INTO fs_flight.
WRITE :
/
w_check AS CHECKBOX,
w_mark,
fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002.
ENDLOOP.
This is just a sample code.You can use your own functionality and put them together.
Much Regards,
Amuktha
2009 May 13 7:27 AM
Yes santhosh...But to make it work set pf-status at user command at a time u need to mention 'PICK' Command in F2 menu bar.
Regards
sas
2009 May 13 7:27 AM
AT USER COMMAND and AT PF-STATUS'
is mutualy exclusive
you can use either of them not both at same time
2009 May 13 7:55 AM
Hi,
Yes it is possible.
1. AT LINE-SELECTION:
With this event, we can get the Index of Current/Previous list can be obtained for controlling the List.
For eg:
Sy-title - Title of Report
Sy-linct - Total Line No. of Page
Sy-Linno - Current Line No
Sy-Lsind - Index of List Created
Sy-Listi - Index of Previous List
Sy-Lilly - Line No.of List
Sy-Lisel - Contents of Line Selected
Sy-Ucomm - Fn.Code of Clicked Menu Item
Sy-pfkey - Status of Displayed Item
Sy-Linsz - Line Sz. of Report
Sy-Colno - Cur. Col. No.
Sy-Pagno - Current Page No.
Sy-Scols - No. of Cols in Window
Sy-Srows - No. of Lines in Window
Sy-CPage - Cur. Page No.
Sy-CuCol - Cursor Position Col #
Sy-CuRow - Cursor Position Lin #
Sy-LStat - Sts.Info. for Each List Level
Sy-Msgli - Content of the Message Line
Sy-StaCo - No.of First Displayed Col.
Sy-StaRo - No. of First Displayed Row
Sy-RepId - Name of Cur. Report
2. AT USER-COMMAND
The Usage for availing the functionality of "At User-Command" is:
AT PF <n> where n = 1 to 12 can be used.
3. AT PF-Status.
PF Status can also be used, by setting the keyword 'PICK' in the Status Menu.
- Ramani N
2009 May 13 7:58 AM
Yes you can use it however AT LINE-SELECTION will get the highest priority.Like in case of PICK, at-line-selection pick will be triggered first.
With luck,
Pritam.
2009 May 13 8:03 AM
Dear
Yes it is possible to use the three interactive events i.e. 'AT-LINE SELECTION, AT USER COMMAND and AT PF-STATUS' in a single report.
Cheers
fareed
2009 May 13 8:53 AM
Hi ,
Before going these question , first of all you should aware about the events in interactive, what to do and how it's trigger .....
as per you question, YES, we can call three events at a particular report, that's depends upon your requirement. SAP provides commands like Sy-Lsind - Index of List Created and so on ....
use all events in a report...
AT line selection
At user command
At pf status
Thanks
Siva
2009 May 13 9:02 AM
Hi,
yes its possible in a single report ,it depence on the particular requirment.
Regards,
Madhu
2010 Aug 12 4:37 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |