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 pf

Former Member
0 Likes
884

can i know the use of at pf event and how to write coding for functional keys

can i know the use of at pf event and how to write coding for functional keys

6 REPLIES 6
Read only

suresh_datti
Active Contributor
0 Likes
844

PL check this <a href="https://forums.sdn.sap.com/click.jspa?searchID=2177902&messageID=2985720">Thread</a>.

~Suresh

Read only

Former Member
0 Likes
844

Hi Kumar,

At pf Event is for Funstional Keys, it is actually : 'AT PF1' for functional key F1, 'AT PF2' for F2....

SO, U can use those events and write the code.

Regards,

Sudheer

Read only

0 Likes
844

Hi,

U have to <b>award points for useful answers</b> and if have to mention it as solved if ur question is solved. Dont forget.

Regards,

Sudheer

Read only

Former Member
0 Likes
844

hi,

pf keys r nothing but function keys like f1 f2 ......f12.....here we have to take function keys from f4 as f1 is for help, f2 is for checking errors, n f3 is used for activating the program....so we start from f4 onwards....

i shall expalin u with an example...

let us take thtree tables like mara, marc n mard.

define them like this...

***********************************************************************************

tables : mara, marc, mard.

data : itab like mara occurs 0 wit header line,

jtab like marc occurs 0 with header line,

ktab like mard occurs 0 with header line.

select-options matnr for mara-matnr.

initialization.

matnr-low = '00'.

matnr-high = '1000'.

matnr-sign = 'i'.

matnr-option = 'bt'.

append matnr.

start-of-selection.

write 😕 'menu bar creation'.

AT pf04.

select * from mara into table itab where matnr in matnr.

loop at itab.

write 😕 itab-matnr, itab-ernam, itab-ersda.

hide itab-matnr.

AT pf05.

select * from marc into table jtaqb where matnr = itab-matnr.

loop at jtab.

write 😕 jtab-matnr, jtab-werks, jtab-pstat.

hide itab-matnr.

hide jtab-werks.

endloop.

AT pf06.

select * from mard into table ktab where matnr = jtab-matnr and werks = jtab-werks.

loop at ktab.

write 😕 ktab-matnr, ktab-werks, ktab-lgort.

endloop.

AT pf07.

do 10 times.

write 😕 'hi'.

AT pf08.

write 😕 'u pressed enter.

end-of-selection.

write 😕 'program ended'.

just check it out n let me know if this has solved ur problem....if yes then dont forget to reward them with points../

with regards,

madhuri.

Read only

Former Member
0 Likes
844

Hi Rakkasi,

At pf Event is used for Functional Keys.

'AT PF1' for functional key F1,

'AT PF2' for F2....

you can use those events, and can write the code on paticular function key..

at 'pf1'.

write:/ 'hello'.

at 'pf2'.

write:/ I_tab-matnr , i_tab-mtart.

Reward points if helpful.

Regards,

Hemant.

Read only

Former Member
0 Likes
844

Hi,

When the user chooses a function code PF<nn> (<nn> can be between 01 and 24), the system always triggers the AT PF<nn> event. In the standard list status, the function keys F<nn> that are not reserved for predefined system functions all have the function code PF<nn> as long as a corresponding event block is defined in the program.

AT PF<nn>.

<statements>.

These event blocks are executed when the user chooses the corresponding function key. The position of the cursor in the list is irrelevant.

Ex:

Example for AT PF<nn>.

REPORT demo_list_at_pf.

START-OF-SELECTION.

WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.

AT pf5.

PERFORM out.

AT pf6.

PERFORM out.

AT pf7.

PERFORM out.

AT pf8.

PERFORM out.

FORM out.

WRITE: 'Secondary List by PF-Key Selection',

/ 'SY-LSIND =', sy-lsind,

/ 'SY-UCOMM =', sy-ucomm.

ENDFORM.

After executing the program, the system displays the basic list. The user can press the

function keys F5, F6, F7, and F8 to create secondary lists. If, for example, the 14th

key the user presses is F6, the output on the displayed secondary list looks as follows:

Secondary List by PF-Key Selection

SY-LSIND = 14

SY-UCOMM = PF06

Regards,

Bhaskar