Skip to Content
author's profile photo Former Member
Former Member

queries

what is the use of GET CURSOR.

whre we use GUI STATUS.

Difference between AT PF and AT USER-COMMAND.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:40 AM

    Hi,

    Please check this program:

    for GET Cursor

    DEMO_DYNPRO_GET_CURSOR

    for User Command

    DEMO_SEL_SCREEN_USER_COMMAND

    DEMO_LIST_AT_USER_COMMAND

    for At PF.

    DEMO_LIST_AT_PF

    GUI STATUS - is used to create Application tool bar

    GUI STATUS can be used as such:

    SET PF STATUS 'XYZ'.

    AT PF<nn>

    When the user triggers the predefined function code PF<nn>

    AT USER-COMMAND

    When the user triggers a function code defined in the program

    Get Cursor:

    Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.

    GUI status:

    As with normal screens, you can define your own GUI status for lists and attach it to a list level using the SET PF-STATUS statement. If you do not set a particular GUI status, the system sets a default list status for the list screen in an executable program. In other programs, for example, when you call a list from screen processing, you must set this status explicitly using the statement:

    SET PF-STATUS space.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:42 AM

    Hello,

    1. GET CURSOR FIELD f. 
    2. GET CURSOR LINE line. 
    
    
    
    Variant 1 
    GET CURSOR FIELD f. 
    
    
    Additions: 
    
    1. ... OFFSET off 
    2. ... LINE line 
    3. ... VALUE g 
    4. ... LENGTH len 
    5. ... AREA 
    
    
    
    Effect 
    Transfers the name of the field at the cursor position to the field f. 
    
    The return code is set as follows: 
    
    
    
    SY-SUBRC = 0: 
    Cursor was positioned on a field. 
    SY-SUBRC = 4: 
    Cursor was not positioned on a field. 
    
    
    Note 
    Unlike screen processing, list processing allows you to output literals, field symbols, parameters and local variables of subroutines. Literals, local variables and VALUE parameters of subroutines are treated like fields without names (field name SPACE, return value 0). 
    Otherwise, GET CURSOR FIELD returns only names of global fields, regardless of whether they are addressed directly (i.e. by "WRITE"), by field symbols or by reference parameters. 
    
    
    
    Example
    DATA: CURSORFIELD(20), 
          GLOB_FIELD(20)    VALUE 'global field', 
          REF_PARAMETER(30) VALUE 'parameter by reference', 
          VAL_PARAMETER(30) VALUE 'parameter by value', 
          FIELD_SYMBOL(20)  VALUE 'field symbol'. 
    FIELD-SYMBOLS: <F> TYPE ANY. 
    PERFORM WRITE_LIST USING REF_PARAMETER VAL_PARAMETER. 
    ASSIGN GLOB_FIELD TO <F>. 
    
    AT LINE-SELECTION. 
      GET CURSOR FIELD CURSORFIELD. 
      WRITE: /   CURSORFIELD, SY-SUBRC. 
    
    FORM WRITE_LIST USING RP VALUE(VP). 
      DATA: LOK_FIELD(20)  VALUE 'local field'. 
      ASSIGN FIELD_SYMBOL TO <F>. 
      WRITE: /  GLOB_FIELD,  /  LOC_FIELD, 
             /  RP,          /  VP, 
             /  'literal',   /  FIELD_SYMBOL. 
    ENDFORM. 
    
    
    
    When you double-click the word " global field", CURSORFIELD contains the field name GLOB_FIELD, on "parameter by reference" the field name REF_PARAMETER, on " field symbol" the field name FIELD_SYMBOL, and on "local field", "parameter by value" and "literal" the value SPACE. 
    
    2.GUI STATUS is used to give the menu bar for a screen:
    
    SET PF STATUS 'XXX'.
    
    3. 
    
    AT PFN ---- triggered when function key is clicked
    AT USER-COMMAND ---  triggered when push button is clicked
    
    
    
    

    If useful reward.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:42 AM

    Hi Vamsi,

    1)When we use Get cursor statement, we get the contents of line (clicked by user).

    Based on our requirement, we can get offset of the contents captured in sy-lisel.

    EX: to get matnr on a line..

    v_matnr = sy-lisel+0(18).

    As we are making use of offset, we need to know the position of the field displayed on the output screen.

    2)

    https://forums.sdn.sap.com/click.jspa?searchID=462269&messageID=1492865

    https://forums.sdn.sap.com/click.jspa?searchID=462269&messageID=186225

    3)AT USER-COMMAND event is for handling user defined function.Say for eg when the user clicks the Pushbutton in the list you can do further processing for this action in AT USER-COMMAND event.

    AT PF-STATUS is outdated/obsolete so dont think/worry about it.But it is used for handling function keys in the list.

    Sample Programs for the above events can be found in the transaction ABAPDOCU.

    Regards,

    Priyanka.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:44 AM

    Hi,

    check this link for get cursor.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba42335c111d1829f0000e829fbfe/content.htm

    An interactive report starts with basic list where condensed information is stored on basic list and detailed information is stored on secondary list. To implement this kind of reporting, you need to provide the user with things like menu, icons, function keys. You also need to write code, which must react, to the user’s action.

    For this, you need to create the interface, which interacts with the user.

    The user interface is independent of the program or list or screen. However both interface and list can be associated by means of GUI status. A GUI status groups together the interface components.

    • Menu bar

    • Application tool bar

    • Function keys

    • Title bar

    The last element of the user interface is independent of the GUI status i.e., titlebar.

    To assign status to your list the statement SET PR-STATUS.

    Some facts about GUI status are:

    • A program can have multiple GUI status and titles for different lists.

    • Multiple lists can be assigned to same GUI status.

    • Normally both GUI status and title go together.

    AT USER-COMMAND

    When the user selects the menu item or presses any function key, the event that is triggered is AT USER-COMMAND, and can be handled in the program by writing code for the same. The system variable SY-UCOMM stores the function code for the clicked menu item or for the function key and the same can be checked in the program. Sample code would look like

    AT USER-COMMAND.

    Case sy-ucomm.

    When ‘DISP’.

    Select * from sflight.

    Write sflight-carrid, sflight-connid.

    Endselect.

    When ‘EXIT’.

    LEAVE.

    If GUI status, suppose you have set menu bar for two items and the function code is ‘DISP’ and ‘EXIT’ respectively. If the user clicks the menu item ‘DISPLAY’, then function code ‘DISP’ is stored in the sy-ucomm and whatever is written under the when ‘DISP’, gets executed. This is applicable for EXIT as well.

    Regards,

    Sruthi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:44 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:45 AM

    Hi,

    AT USER-COMMAND - will trigger only one particular event.

    AT PF - it trigger only particular function key like pushbutton.

    GUI STATUS - is used to create Application tool bar

    GET CURSOR - is used to display the secondary list.

    Regards,

    Bhaskar

    pl reward me if satisfy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:46 AM

    Get Cursor:

    Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.

    GUI status:

    As with normal screens, you can define your own GUI status for lists and attach it to a list level using the SET PF-STATUS statement. If you do not set a particular GUI status, the system sets a default list status for the list screen in an executable program. In other programs, for example, when you call a list from screen processing, you must set this status explicitly using the statement:

    SET PF-STATUS space.

    AT PF<nn> (obsolete)

    All function keys of the keyboard F<nn> that are not used for predefined system functions, are set to the function codes PF<nn>, where <nn> is a number between 01 and 24. During list processing, the function codes PF<nn> are linked to the events AT PF<nn>. Choosing PF<nn> always triggers AT PF<nn>. You should no longer use event blocks for PF<nn>.

    AT User-command:

    All other function codes are either intercepted by the runtime environment or trigger the event AT USER-COMMAND. Function codes that trigger AT USER-COMMAND must be defined in your own GUI status. The easiest way to do this is to use the standard list status and add extra functions of your own to it.

    The runtime environment directly queries and processes all function codes of the above tables, except PICK and PF<nn>. These function codes do not trigger events, and you cannot use them for the AT USER-COMMAND event.

    The function code PICK triggers the AT LINE-SELECTION event, whenever the cursor is positioned on a list line. The function codes PF<nn> always trigger the AT PF<nn> event. Therefore, you cannot use them for the AT USER-COMMAND event either.

    To trigger AT USER-COMMAND, you can define any number of function codes yourself. If they do not have a function code listed in the above table, they will trigger AT USER-COMMAND.

    regards,

    madhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 11:09 AM

    1]

    GET CURSOR

    In screen programming, this gives you the position of cursor.

    If cursor is on any field it returns name of that field,

    Command : GET CURSOR FIELD cur_field.

    This will return name of the field in cur_field.

    In list programming in addition to above option you can also use

    GET CURSOR LINE cur_line.

    which returns line no. at which cursor is in variable cur_line.

    2]

    PF-STATUS defines Menubar and buttons you want on the screen.

    You can also define your command and their function code , ie combination of available function keys (F1 to F12) with ctrl and shift key.

    (ofcource you have to code it for it to work as you desire)

    3]

    AT PF you code for what to do when any event specified in PF STATUS occurs (Using Function key and their Combination with ctrl and shift key).

    While at user command means what to do when user do specific things like pressing Enter after inserting value or on F4 or to change value of one field depending on values in other field which user has to fill.

    Regards

    Kaushal N. Shah

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.