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

Interactive report events

santosh_dv
Explorer
0 Likes
1,550

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,441

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

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,442

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

Read only

Former Member
0 Likes
1,441

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

Read only

Former Member
0 Likes
1,441

AT USER COMMAND and AT PF-STATUS'

is mutualy exclusive

you can use either of them not both at same time

Read only

former_member229729
Active Participant
0 Likes
1,441

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

Read only

Former Member
0 Likes
1,441

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.

Read only

Former Member
0 Likes
1,441

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

Read only

Former Member
0 Likes
1,441

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

Read only

Former Member
0 Likes
1,441

Hi,

yes its possible in a single report ,it depence on the particular requirment.

Regards,

Madhu

Read only

santosh_dv
Explorer
0 Likes
1,441

Thanks for your replies