Pf status and user-command

hi
can any one explain me about pf-status and user-command?  what is the difference between this two and how to display icons in it.
max reward points for good answer
thanks
alka

Hi alka ritu  ,
Check the following websites for good documentation o n pf status and user-command
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba99935c111d1829f0000e829fbfe/content.htm
1. How to set pf-status
set pf-status ‘ZZBILSTA’.
2. How to set pf-status excluding/including single menu items
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
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,
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
set pf-status ‘BASIC’.
5. How to check for pf-status
AT USER-COMMAND.
CASE SY-UCOMM. WHEN ‘ART’. PERFORM STYR_ARTSKONTI. WHEN ‘PST’. PERFORM STYR_POSTER. WHEN ‘BIL’. PERFORM VIS_BILAG. ENDCASE.
6. Use of SY-PFKEY
You can use the system variable sy-pfkey to retrieve the name of the current pf status
USER-COMMAND:
If the user chooses a function code during list processing that is neither processed by the system, or PICK or PFnn, the system triggers the event AT USER-COMMAND. For this event, you must define your own GUI status for a list. To react to your own function codes in a program, you must define the following event block:
AT USER-COMMAND.
  statements.
In this event block, you can use an IF or CASE structure to differentiate between the function codes. They are available in the system field sy-ucomm. There are further system fields that are filled in list events, such as sy-lsind and sy-pfkey, that allow you to make further case distinctions.
Triggering a List Event from the Program
You can trigger a list event from the program as follows:
SET USER-COMMAND fc.
This statement takes effect after the current list is completed. Before the list is displayed, the event assigned to function code fc is triggered, regardless of the dialog status you are using.
The effect is the same as when the user chooses the function. In other words, predefined list function codes are trapped and processed by the runtime environment, the function codes PICK and PFnn trigger the AT LINE-SELECTION and AT PFnnevents, and user-defined function codes trigger the AT USER-COMMAND event block.
Function code PICK triggers an event only if the cursor is located on a list line.
Using this statement in conjunction with the function codes reserved for system functions, you can call the system functions from the program. For example, you can use SET USER-COMMAND '%SC' to call the Find dialog box directly, or to position the list correctly before it is displayed.
If you use several SET USER-COMMAND statements while creating a list, the system executes only the last one.
Example of AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
  WRITE: 'Basic List',
       / 'sy-lsind:', sy-lsind.
TOP-OF-PAGE.
  WRITE 'Top-of-Page'.
  ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
  CASE sy-pfkey.
    WHEN 'TEST'.
      WRITE 'Self-defined GUI for Function Codes'.
      ULINE.
  ENDCASE.
AT LINE-SELECTION.
  SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
  PERFORM out.
  sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'FC1'.
      PERFORM out.
      WRITE / 'Button FUN 1 was pressed'.
    WHEN 'FC2'.
      PERFORM out.
      WRITE / 'Button FUN 2 was pressed'.
    WHEN 'FC3'.
      PERFORM out.
      WRITE / 'Button FUN 3 was pressed'.
    WHEN 'FC4'.
      PERFORM out.
      WRITE / 'Button FUN 4 was pressed'.
    WHEN 'FC5'.
      PERFORM out.
      WRITE / 'Button FUN 5 was pressed'.
  ENDCASE.
  sy-lsind = sy-lsind - 1.
FORM out.
  WRITE: 'Secondary List',
       / 'sy-lsind:', sy-lsind,
       / 'sy-pfkey:', sy-pfkey.
ENDFORM.
Example of AT USER-COMMAND.
REPORT demo_list_set_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
  SET USER-COMMAND 'MYCO'.
  WRITE 'Basic List'.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'MYCO'.
      WRITE 'Secondary List from USER-COMMAND,'.
      WRITE: 'sy-lsind', sy-lsind.
      SET USER-COMMAND 'PF05'.
  ENDCASE.
AT pf05.
  WRITE 'Secondary List from PF05,'.
  WRITE: 'sy-lsind', sy-lsind.
  SET CURSOR LINE 1.
  SET USER-COMMAND 'PICK'.
AT LINE-SELECTION.
  WRITE 'Secondary List from LINE-SELECTION,'.
  WRITE: 'sy-lsind', sy-lsind.
  SET USER-COMMAND '%SC'.
http://maxdb.sap.com/currentdoc/94/90ee41c334c717e10000000a155106/content.htm
cheers!
gyanaraj
****Pls reward points if u find this helpful

Similar Messages

  • PF Status and User Command in CALL METHOD alv_grid_ob- set_table_for_first_

    Hi Can anyone please advice me how can we have PF Status in User Command in Object Oriented ALV Grid Display.
    * display alv grid
      CALL METHOD alv_grid_ob->set_table_for_first_display
        EXPORTING
    *    IS_VARIANT                    =
    *    I_SAVE                        =
          i_default                     = 'X'
          is_layout                     = t_lay
    *    IT_TOOLBAR_EXCLUDING          =
        CHANGING
          it_outtab                     =
          it_fieldcatalog               = t_field_catalog
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    Hi,
    you can directly handle that in PBO module of the screen....
    you can give a direct
    set PF-status statement in any of the module in PBO...
    and you can handle in PAI
    Regards,
    Siddarth

  • How to get system status and user status of service order

    Hi,
    I want to show user status and system status for service order in my report and i am using CRM_ORDER_READ function module to read the status, but it is returning lot of status records, could anyone please suggest how to get the system status and user status for service order.
    I did not find any clue for how to get user status, i can see the user status when i open the transaction using CRMD_ORDER.
    Regards,
    Kamesh Bathla

    Hi,
      Go to CRM_JEST table give your service order guid and get the status, pass this status into TJ02. You will get the status of your order.
    Regards
    Srinu

  • Fetching the sales order data using both system status and user status

    Hi,
    Could any one tell me how to fetch sales orders using both system status and user status.
    My requirement is to fetch sales order data in a report where the user enters the system status and user status in the selection screen fields.
    For example i need sales orders where the system status is I1002 i.e. OPEN and user status is E0002 (status profile CMSCON0) that is In Process
    Early replies are appreciated.
    Thanks
    Tanveer

    Hi,
    The system status and user status are stored in CRM_JCDS & CRM_JEST tables you can get the all the order GUID on particular status further pass the order GUID in table CRMD_ORDERADM_H to get transaction ID.
    Regards,
    Dipesh.

  • System status and user status Priority

    Hi All,
    We have system status and user status for the production order, I would like to know which has higher priority.
    E.g In system status some business activity are not allowed but at the same time for user status those activites are active, then which status has high priority.
    Regards,
    Ranjan

    Hi,
    As per my understanding both the status work together. If User status forbids a business transaction and system status allows it, then also the business transaction cannot be carried out.
    Also if system status forbids a business txn and user status allows that, then also you wont be able to carry out the txn.
    Both work with "AND" condition.
    Regards,
    Rohit.
    Added: you can try it by creating a User status profile. Allow Goods Movement to CRTD status. Now dont release the production order, only save it. Then try issuing goods (261), the system will block you.
    Now, other way round, forbid GR without confirmation. Though System Status allows GR without CNF or PCNF status, but the user status will forbid the transaction.
    Hope the example helps.
    Regards,
    Edited by: Rohit Chauhan on Jun 5, 2009 9:09 AM

  • System status and user status in Line Item Reports

    Dear PS-friends,
    I have to extend the CI CI_PROJ with some new fields. These fields should be shown in diverse Line Item Reports (CJI3 u2026).
    I know how to get these customer fields into the field catalog for the reports (maintain include table CI_RKPOS, EXIT_SAPLKAEP_001 and ViewCluster V_TKALV).
    Now our customer wishes that 2 of the new fields are: system status and user status. The status should be shown in CJI3 as a concatenated field as you see it in CJ20N.
    In CN42 there is the column system status as a standard column. But I cannot find the structure CNJ_STAT included in V_TKALV for Line Item Report Object=PD.
    Has anybody an idea how it works to show the system status and user status in Line Item Reports.
    Thanks in advance!

    Problem is solved.
    I wrote a function module using FM 'STATUS_TEXT_EDIT' and concatenated line and user_line.

  • How to get system status and user status ?

    how to get system status and user status for the given production order?
    In which PP table we can
    find these?
    Thanks&Regards
    Satish

    Hi Ram,
    Use the FM "STATUS_READ" to read both the system and user statuses for an Order.
    Alternatively, the following tables store the user and system status info:
    JSTO- Status object information
    JEST- Individual Object Status
    Hope this helps.
    Let me know if u need further information.
    Regards,
    Sonal

  • How to fetch service order with partucular system status and user status

    Hello All,
    How to fetch service orders with specific system status and user status.
    thanks

    I want tables or views from where I can fetch service orders. I have to design ALV report based on this.
    I want to fetch released service orders with status INIT and RENT.
    Here, SYSTEM Status = Released and
             USER Status     = INIT
                                        RENT
    So is there any function module available for the same.....

  • IO system status and user status

    Hi all,
    Could you please tell me where the link between IO sys and user status.
    Thank you.

    Hi
    System status and User status:
    System Status
    o        The system sets a system status informing the user that the system has executed a certain business transaction for an object.
    o        You can only influence this status by executing a business transaction that changes the system status.
    o        If you release an internal order, the system automatically sets the Released system status.
    User Status
    o        You can set a user status in addition to the existing system status.
    o        You specify the user status in a status profile, which you create for each order type in Customizing.
    o        You can specify and activate any number of user statuses.
    o        In a production order you can simultaneously
    The system status and the user status influence the business transactions in the same way.
    The status profile allows you to:
    o        Define the user status and document its functions with a corresponding long text.
    o        Assign a status number that specifies the order in which the system reaches the user statuses.
    o        Define an initial status, which is then automatically set when an object is created.
    o        Determine that a user status is automatically set when you execute a business transaction.
    o        Permit or forbid specified transactions, if a status is active.
    VVR

  • Difference between system status and user status.

    Can someone explain to me the difference between system status and user status in details

    Hi,
    As you mentioned there are 2 status can be maintained for documents like Equipment Master, Notification, Maintenance Order & other important business documents.
    In case, client feels that system status is not enough to capture the details of the object, then user status can be used.
    System statuses will be updated automatically based on business transactions which will be done on SAP.
    For example, once the equipment is created, System status would CRTD (Created). If you install the same to some superior equipment or FL, then status would be INST (Installed).
    If you keeping that equipment in Spare, then for that, you have to maintain separate User Status like AVLB (Available in Stock / Spare) so that through IH08, by using User status, you can the report which is available as spare.
    These user status as per the name, should be updated by the user manually.
    Regards,
    Maheswaran.

  • Gui status (AT USER-COMMAND) trigger at first

    Hello all,
    I wrote a basic list  shown below.
    In it , AT USER-COMMAND and AT LINE-SELECTION events are used all.
    when i double click on line in the list, I think the at line-selection should be trigger at first. but  in fact ,the AT USER-COMMAND trigger.
    and the sy-ucomm get the first button value in the GUI-STATUS BAR(There's only one button on it).
    how can i solve it .
    any answers should be appreciated.
    START-OF-SELECTION.
      SET PF-STATUS 'ZSATMM24F1'.
      write :  \ 'aaaaaaaaaaaa'
      write :  \ 'aaaaaaaaaaaa'
      write :  \ 'aaaaaaaaaaaa'
      write :  \ 'aaaaaaaaaaaa'
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'TO_a'.
          PERFORM to_a.
      ENDCASE.
    AT LINE-SELECTION.
      write : 'test'.
    best regards,
    daniel.

    Please make sure to add the fcode PICK to the F2 function code in your gui status and try again.
    Regards,
    Rich Heilman

  • At line-selection and user command

    hi,
    is it possible to use both at line selecion and at user command at a time.

    Hi Kiran,
      Yes, it is possible to use both at line selecion and at
      user command at a time.
    AT LINE-SELECTION.
    Event in interactive reporting
    This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.
    The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.
    AT USER-COMMAND.
    Event in interactive reporting
    This event is executed whenever the user presses a function key in the list or makes an entry in the command field.
    DATA: NUMBER1 TYPE I VALUE 20,
          NUMBER2 TYPE I VALUE  5,
          RESULT  TYPE I.
    START-OF-SELECTION.
      WRITE: / NUMBER1, '?', NUMBER2.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'ADD'.
          RESULT = NUMBER1 + NUMBER2.
        WHEN 'SUBT'.
          RESULT = NUMBER1 - NUMBER2.
        WHEN 'MULT'.
          RESULT = NUMBER1 * NUMBER2.
        WHEN 'DIVI'.
          RESULT = NUMBER1 / NUMBER2.
        WHEN OTHERS.
          WRITE 'Unknown function code'.
          EXIT.
      ENDCASE.
      WRITE: / 'Result:', RESULT.
    After entry of a function code, the appropriate processing is performed under the event AT USER-COMMAND and the result is displayed in the details list.
    Reward points if helpful,
    Rgds,
    Sumana

  • 'PICK' and User commands in reports

    I'm a bit confused about 'PICK' in PF_STATUS.
    I fI define it, does that mean It can only be recognised in LINE-SELECTION , and not in AT USER-COMMAND.
    I've defined a small program and thats what seems to be happening?

    You can see here that the function code PICK is automatically fired when a hotspot is involved and hence the AT LINE-SELECTION event is fired to handle it.
    report zrich_0001.
    data: itstc type table of tstc with header line.
    select-options : s_tcode for itstc-tcode.
    at line-selection.
      check sy-ucomm = 'PICK'.
      call transaction itstc-tcode.
    start-of-selection.
      select * into corresponding fields of table itstc
                 from tstc
                      where tcode in s_tcode.
      loop at itstc.
        format hotspot on.
        write:/ itstc-tcode.
        hide itstc-tcode.
        format hotspot off.
      endloop.
    Regards
    Rich Heilman

  • Method of fetching Account status and user locked date in Portal.

    Hi,
    Can anyone suggest me the method name  in UME API in Sap Ep for fetching User Account Status and Last User Locked Date. Or suggest a related code for it.
    user database is LDAP.
    Thanks

    Hi Abhai,
    The class (actually Interface) you're looking for is IUserAccount. You can get this from the IUser by using the method getUserAccounts().
    The IUserAccount provides all sort of methods like lockDate(), isLocked(), getLockReason().
    See more in https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/ep/_d-f/ep%206.0%20sp2%20usermanagement%20public%20api
    Best regards,
    Amit

  • System status and user status for ECR

    Hello,
    As per our requirement, we have defined some 7 user statuses. We need to link system status with user status
    How to link the user status with system status or is user status needs to be selected manually in every status of ecr
    Thanks.
    Anirudh,

    The user statuses are
    unassigned - workflow is not initiated,
    pending - change is not submitted to analyst who reroute it to change board,
    cancelled - change is cancelled,
    submitted - subimitted to analyst for routing to change board,
    hold,
    released,
    implemented - ECO complete
    We change only Document through ECR.
    We want to link system status to these above user status.
    The user tracks ECR by means of  user status and not system status.
    Anirudh,

Maybe you are looking for

  • 11.5.10.2 concurrent requests

    Hi All, OAM application Dashboard request is ending with phase completed and status Error,below is the log file of the same. Application Object Library: Version : 11.5.0 Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved. FNDOAMCOL mod

  • Where can I buy the original earphone that go with my Ipod ???

    I lost my earphone ... Now i want to buy a original earphone that go with my Ipod gen 4, I see some product on Amazon but the feedback says they're so bad ... And i don't know if Apple sold this earphone ... Help Me !!!

  • Conditional Flow using ODI Procedures

    Hello Experts, I want to implement if else conditional flow in my ODI procedure. Is it possible to implement this? Please help. Thanks in Advance -- Harshad

  • Unity 7 and IMAP Configurations

    Recently some customers seem interested in using IMAP with VM only Unity deployments... mind you NOT Unity Connection. Beyond statements saying that Cisco Supports this configuration I have not found any details. I am particualarly interested in lear

  • Please Address issue with

    Hello All, I have purchased a MuVo TX FM and have great things to say about it! The MediaSource software on the other hand has an issue i would like to see addressed. While using the "smart fit" option the software creates a temp folder in the root o