PF-Status FAQs
1. How to set pf-status
2. How to set pf-status excluding/including single menu items
3. How to set pf-status excluding/including several menu items
4. Setting PF status to the (SAP) system default
5. How to check for pf-status
6. Use of SY-PFKEY
1. How to set pf-status
Ans) set pf-status 'ZZBILSTA'.
2. How to set pf-status excluding/including single menu items
Ans) You can exclude menus by using exclude:
set pf-status 'ZZBILSTA' excluding 'PST'.
Note: Can also be used with include instead of exclude
3. How to set pf-status excluding/including several menu items
Ans) You have to use an internal table to store the status you wan't to ex- or include:
DATA: BEGIN OF I_PF_STATUS_TAB OCCURS 10,
FCODE(4),
END OF I_PF_STATUS_TAB.
FORM SET_PF_STATUS_POSTER.
REFRESH I_PF_STATUS_TAB.
MOVE 'PST' TO I_PF_STATUS_TAB.
APPEND I_PF_STATUS_TAB.
MOVE 'ART' TO I_PF_STATUS_TAB.
APPEND I_PF_STATUS_TAB.
SET PF-STATUS 'ZZBILSTA' EXCLUDING I_PF_STATUS_TAB.
ENDFORM.
4. Setting PF status to the (SAP) system default
Ans) set pf-status 'BASIC'.
5. How to check for pf-status
Ans)
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'ART'.
PERFORM STYR_ARTSKONTI.
WHEN 'PST'.
PERFORM STYR_POSTER.
WHEN 'BIL'.
PERFORM VIS_BILAG.
ENDCASE.
Read more here SAP ABAP Interview Questions
6. Use of SY-PFKEY
Ans) You can use the system variable sy-pfkey to retrieve the name of the current pf status