2007 Apr 19 10:35 AM
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
2007 Apr 19 10:37 AM
PL check this <a href="https://forums.sdn.sap.com/click.jspa?searchID=2177902&messageID=2985720">Thread</a>.
~Suresh
2007 Apr 19 10:40 AM
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
2007 May 07 11:13 AM
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
2007 May 07 1:32 PM
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.
2007 May 07 1:43 PM
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.
2007 May 07 1:49 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |