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

reports

Former Member
0 Likes
738

when wil we use 'at pf'. event

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
712

Hi Venu,

Suppose user requirement like based on function key some perform will be process then at that moment we will use at Pfn event.

Regards,

Kumar.

5 REPLIES 5
Read only

Former Member
0 Likes
713

Hi Venu,

Suppose user requirement like based on function key some perform will be process then at that moment we will use at Pfn event.

Regards,

Kumar.

Read only

0 Likes
712

hi !

whenever we press any function keys on the key board this EVENT is gets Triggered.

the actual use is to provide user define function keys.

all function keys of the keyboard F<nn> that are not used for predefined system functions (like F3..., etc),

are set to the function codes PF<nn>,

where <nn> is a number between 1 to 24.

during the list processing the function codes pf<nn> are linked to the events AT PF<nn>.

this event can be repeated.!

Reward if useful..,

Cheers,

Rajesh

Read only

Former Member
0 Likes
712

Hi

PF-STATUS is used to set the GUI Status of a screen, ie you can control the options on your menu bar, application toolbar, the function keys assigned to various options etc.

Implementing the status for a screen can be done in 2 ways:

1) Create the GUI status using the object list of the program or by using the transaction SE41. Then, assign it to the screen using SET PF-STATUS statement.

2) Create the GUI status by means of forward navigation, ie, use the SET PF-STATUS 'XXX' statement where 'XXX' is the name of the GUI status and double click on it to create it.

Status names can have a maximum of 20 characters.

After assigning a GUI status to a screen, this is inherited to all subsequent screens. In order to have a different status for each of the subsequent screens, you have to set a separate status for each screen.

In transaction SE41,

1) Give the program name and the status name and click on the Create button.

2) Go to 'Function keys' and expand.

3) On top of the save icon type SAVE, on top of the back icon type BACK, on top the the exit icon type EXIT etc ie on top of all the icons that you want to use, type the respective names that you want to give.

Whatever you have typed now becomes the function codes of these icons and can be used in your program.

Sets a GUI (Graphical User Interface) status pfstat which can be up to 8 characters long. There are many of these statuses in the GUI of a program. Each one describes which functions are available and how you can select these via menus and menu bars or by pressing function keys or pushbuttons. For further information about this, refer to the Menu Painter documentation.

Setting a status makes the functions contained therein selectable.

This method allows you to vary the available functions according to the current screen, list level and/or previous program flow.

The current status is stored in the system field SY-PFKEY .

A status remains valid until reset.

Example

Event in program:

START-OF-SELECTION.

SET PF-STATUS 'MAIN'.

WRITE SY-PFKEY.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'F001'.

SET PF-STATUS '0001'.

WRITE SY-PFKEY.

...

ENDCASE.

Produces a list (contents MAIN ) with a GUI framework which allows you to select functions assigned to the the status MAIN . If you choose the function code F001 (e.g. from the menu or by pressing a pushbutton), you trigger the event AT USER-COMMAND . This generates a details list (contents 0000) with a GUI framework which allows you to select functions assigned to the status 0001 . On returning from the details list to the basic list the status MAIN is reactivated.

Notes

If no GUI is defined in the list processing (or it is deactivated with SET PF-STATUS SPACE ), the system supplies a standard user interface.

This statement converts the contents of the field pfstat to type C. The converted value is used to search for the desired status. Since the conversion employs the standard conversion rules as for MOVE , you should use a field similar to type C (e.g. type C or N) for pfstat to avoid unwanted conversions. In this case, a field of type I with a value of 12 would give the key ' 12 '.

Read only

Former Member
0 Likes
712

Hi,

Check

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/set_pf_s.htm

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
712

AT PFn.

Effect

Event in interactive reporting

Here, n stands for a numeric value between 0 and 99.

This event is executed whenever the user presses a function key that contains the function code PFn in the interface definition. The default status for lists contains some of these functions.

Otherwise, the effect is as for the variant AT LINE-SELECTION . The cursor can be on any line.

Notes

To ensure that the chosen function is executed only for valid lines, you can check the current HIDE information. This variant should be used only for test or prototyping purposes, since the default status is not normally used. Instead, you should set a program-specific status with SET PF-STATUS . This should not contain any function codes beginning with " PF ".

Example



    DATA NUMBER LIKE SY-INDEX.

    START-OF-SELECTION.
      DO 9 TIMES.
        WRITE: / 'Row', (2) SY-INDEX.
        NUMBER = SY-INDEX.
        HIDE NUMBER.
      ENDDO.

    AT PF8.
      CHECK NOT NUMBER IS INITIAL.
      WRITE: / 'Cursor was in row', (2) NUMBER.
      CLEAR NUMBER.