AT USER COMMAND event in interactive reports

hi experts,
Can anyone explain me about AT USER COMMAND event with one practical ex.
thanks in advance
R.vijai

Hi vijaya kumar,
    If the user chooses a function code during list processing that is neither processed by the system, or PICK or PF<nn>, 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 tell the function codes apart. 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.
REPORT Test_program.
START-OF-SELECTION.
  SET PF-STATUS 'TEST'.
  WRITE:  'Basic list, SY-LSIND =', sy-lsind.
AT LINE-SELECTION.
  WRITE:  'LINE-SELECTION, SY-LSIND =', sy-lsind.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'TEST'.
      WRITE:  'TEST, SY-LSIND =', sy-lsind.
  ENDCASE.
With this code double click on 'TEST' and define your own PF status and give user command as TEST and check out this useful programe.
All the very best to you.
Regards,
Mohan Vamsi Krishna.A

Similar Messages

  • What are the events in interactive reports?

    what are the events in interactive reports?
    could plz explain

    hi,
    First event -
    Initialization : triggered when the report is loaded in memory.
    At selection-screen output : triggered when the selection screen is loaded in memory before being displayed.
    At selection-screen : before leaving the selection screen.
    start-of-selection : the first event for displaying the report.
    This event keyword defines an event block whose event is triggered by the ABAP runtime environment
    when calling the executable program selection screen processing of a selection screen.
    In an executable program, all statements that are not declarations,
    and are listed before the first explicit processing block, are assigned to this event block.
    If the program does not contain an explicitly defined event block START-OF-SELECTION,
    these statements form the complete event block START-OF-SELECTION.
    If a program contains an explicitly defined event block START-OF-SELECTION,
    these statements are added to the beginning of the event block.
    If the program contains no explicitly defined event blocks,
    these statements form the entire event block START-OF-SELECTION.
    end-of-selection : after the start-of-selection is completed.
    classiscal report events.
    top-of-page : every time a new page is started in the list.
    end-of-page : every time the list data reaches the footer region of the page.
    interactive report events.
    top of page during line selection : top of page event for secondary list.
    at line-selection : evey time user dbl-clicks(F2) on the list data.
    at pF<key> : function key from F5 to F12 to perform interactive action on the list.
    at user-command
    <b>http://help.sap.com/saphelp_47x200/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm</b>
    Rgds
    Anver

  • At line-selection & at user-command event issue

    hi
    i am working on a interactive report,with at line & at user command event,on list 3 i have used a pf status,to trigger the at user command event,till that i was working with at line selection,which are working fine,but on list 3,i am able to see my pf status,but at user command event is not working properly,its still working like at line selection event,if i clk on record,it take to for nxt action,which i want to do through the action button of pf status.
    In debugging i checked that it coming to at user command,but the action in sy-user is 'PICK' & its doing the operation.
    WHEN '3'.
          IF itab4[] IS NOT INITIAL.
            SET PF-STATUS 'Z203'.
            LOOP AT itab4.
              AT FIRST.
                WRITE:/1 'Material' ,18 'Name'.
              ENDAT.
              WRITE:/1 itab4-matnr,8 itab4-maktx.
              HIDE:itab4-matnr.
            ENDLOOP.
          ELSE.
            WRITE:/ 'No Data Found'.
          ENDIF.
      ENDCASE.
      BREAK-POINT.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'CALL'.
          PERFORM bdc_mm02.
      ENDCASE.
    pls tel me how to use at line selection & at user command in same report to make both events working efficiently.
    regds
    vipin

    Check whether you have assigned Function Key F2 to your function code 'CALL'. If so change that function key. The function key F2 is always linked to function code 'PICK'.
    Regards
    Sathar

  • User Interface Template for Interactive Report Region

    In 3.2, where do we set the user interface template for Interactive Reports region?
    No matter what out of the box theme I switch to, the Interactive Reports region shows the same. What and where do I change the template so that alternating rows use two different colors?

    There is no template for Interactive Reports like for a "normal" report. You need to modify the CSS and supply your own for this to happen.
    I believe most things are tagged with #apexir - firebug with Firebox is invaluable. This thread may help:
    Re: changing the look and feel of interactive report.

  • Users Email Subscriptions of Interactive Reports, getting deleted

    Hi,
    We have apex 4.0.2 version instances installed in DEV, Test, Prod environments.
    We use the same app id across all the 3 environments
    eg: App no 200 is used in all the 3 environments.
    The users subscriptions for the interactive reports are getting deleted,
    when the App from Dev is moved to Test or Prod environments.
    Any ideas or suggestions ?
    Thnx

    Hi,
    I could able to get back the users subscriptions in the target environment with below procedure.
    In my scenariou i am moving the app 200 from Dev to Test environment.
    Step1: Export the app 200 from Test environment by selecting Export interactive Report Subscriptions to Yes in Export Preferences tab
    Step2: Extract carefully the wwv_flow_api.create_worksheet_notify code +(you will see more than 1 statements, if there are multiple users subscriptions)+ from the app 200.sql .
    Step3: Extract wwv_flow.g_flow_id and wwv_flow_api.g_id_offset initializer statements.
    Example below:
    In my scenariou i was testing with 1 interactive report user subscription
    begin
    wwv_flow.g_flow_id := nvl(wwv_flow_application_install.get_application_id,200);
    wwv_flow_api.g_id_offset := nvl(wwv_flow_application_install.get_offset,0);
    wwv_flow_api.create_worksheet_notify (
    p_id => 3351032625694541+wwv_flow_api.g_id_offset,
    p_flow_id => wwv_flow.g_flow_id,
    p_worksheet_id => 11045125897667191+wwv_flow_api.g_id_offset,
    p_report_id => 11046318922668871+wwv_flow_api.g_id_offset,
    p_owner => 'abc.def',
    p_email_subject => 'Primary Report test',
    p_email_address => '[email protected]',
    p_start_date => '2012.09.07.01:00:00',
    p_notify_interval => 'D');
    end;
    Step4: Import the app 200 from Development environment to Testing environment.
    Step5: Execute the above Example pl/sql in the Test environment sql prompt.
    Run the app in Test environment, You will see your interactive reports user subscription to the associated pages.
    Note: This procedure applies only when you have  app id same across all the enviornments

  • Events in Interactive reports

    hi gurus,
    i want detailed explanation each n every event of standard report...
    Regards
    baskar

    HI
    <b>INITIALIZATION</b>
    This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.
    When an executable program defines a standard selection screen, it is called again by the ABAP runtime environment after execution, which triggers the INITIALIZATION event again. In this case, initializing parameters or selection criteria of the selection screen has no effect, because they are automatically supplied with the preceding user inputs from the selection screen during the selection screen event AT SELECTION-SCREEN OUTPUT. To explicitly initialize the selection screen for each call, you must use the event AT SELECTION-SCREEN OUTPUT.
    <b>START-OF-SELECTION</b>
    This event keyword defines an event block whose event is triggered by the ABAP runtime environment when calling the executable program selection screen processing of a selection screen.
    In an executable program, all statements that are not declarations, and are listed before the first explicit processing block, are assigned to this event block. If the program does not contain an explicitly defined event block START-OF-SELECTION, these statements form the complete event block START-OF-SELECTION. If a program contains an explicitly defined event block START-OF-SELECTION, these statements are added to the beginning of the event block. If the program contains no explicitly defined event blocks, these statements form the entire event block START-OF-SELECTION.
    If the program is linked to a logical database, preparations can be made here before the logical database reads data. If the program is not linked to a logical database, this event block even displays a "main program" from which procedures or screen layouts are called.
    <b>GET node</b>
    Use GET to handle two types of events after submitting executable programs: Get events and events at the end of a hierarchy level of a logical database. If during a GET event a list is written, previously an automatic line feed is created.
    The event blocks after GET are implemented internally as procedures. Declarative statements in GET event blocks create local data.
    <b>END-OF-SELECTION</b>
    This statement defines an event block, whose event is raised by the ABAP-runtime environment during the calling of an executable program , if the logical database, with which the program is linked, has completely finished its work.
    In this event block, all data read by the logical data base , can be processed summarically. In an executable program without logical data base, there is no need to implement the event block END-OF-SELECTION.
    <b>LOAD-OF-PROGRAM</b>
    This event keyword defines an event block whose event is triggered by the ABAP-runtime environment when an executable program, a module pool, a function group or a sub-routine pool is loaded in the internal session.
    When calling a program through SUBMIT or through a transaction code, then, at every call, a new internal session is opened and the event block is executed once at every call. You can initialize global data objects of the program here.
    At the first call of an external Procedure (sub-program or function module), the framework program of the called procedure is loaded into the internal session of the caller, thus triggering the event LOAD-OF-PROGRAM. The event block is executed before the called procedure. At any further call of a procedure of the same framework program by a caller of the same internal session, the event LOAD-OF-PROGRAM is triggered no longer.
    The event LOAD-Of-PROGRAM should mainly be used to initialize global data when calling external procedures or Transactions. If you call executable programs with SUBMIT, we recommend that you use the event INITIALIZATION, as the Starting values for parameter and selection criteria are set after LOAD-OF-PROGRAM (see program flow after SUBMIT).
    <b>AT SELECTION-SCREEN</b>
    AT SELECTION-SCREEN selscreen_event.
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.
    <b>AT SELECTION-SCREEN OUTPUT</b> 
    This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.
    The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
    <b>AT SELECTION-SCREEN ON {para|selcrit}</b>
    This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
    <b>AT SELECTION-SCREEN ON END OF selcrit</b>
    This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked.
    <b>AT SELECTION-SCREEN ON BLOCK block</b>
    This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again.
    <b>AT SELECTION-SCREEN ON RADIOBUTTON GROUP radi</b>
    This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again.
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    <b>AT SELECTION-SCREEN { ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }</b>
    The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database.
    With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
    <b>AT LINE-SELECTION</b>
    This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list - provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.
    If the function key F2 is linked with a function code different than PICK, each double click will trigger its even, usually AT USER-COMMAND, and not AT LINE-SELECTION.
    <b>AT USER-COMMAND</b>
    This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.
    Self-defined function codes are all those that include character combinations, except for the following:
    The function codes PICK and PF## ("##" stands for 01 to 24) do not cause the event AT USER-COMMAND, but the events AT LINE-SELECTION and AT PF##.
    All function codes that start with the character "%" are interpreted as system functions and do not cause the event AT USER-COMMAND. The system functions for lists are listed in the following table 1.
    The function codes in the following table 2, likewise, do not cause the event AT USER-COMMAND, but are handled by the list processor.
    <b>AT PF##</b>
    This statemet defines an event block whose event is triggered by the ABAP runtime environment during list display - provided the screen cursor is on a list line and a function is selected using the function code PF##. Here ## stands for a number between 01 and 24. In the= standard list status, these function codes are assigned to the function keys of the input device.
    Instead of AT PF## , AT USER-COMMAND should always be used and special function codes should be assigned to the required function keys.
    <b>TOP-OF-PAGE</b>
    Effect
    This statement defines an event block whose event is triggered by the ABAP runtime environment during the creation of a list. This occurs when a new page is started - that is, immediately before the first line in a new page is to be output. All list outputs that take place in the event block are placed below the standard page header of the list. You cannot output more lines than are available in the page within the event block. The NEW-PAGE statement is ignored within this event block.
    The entire output written to the list in the event block belongs to the page header of the current list page. The top page header cannot be moved when you scroll vertically in a list displayed on the screen.
    <b>TOP-OF-PAGE DURING LINE-SELECTION</b>
    If you do not use an addition, an event block is triggered for event TOP-OF-PAGE during the creation of a basic list. If you use the addition DURING LINE-SELECTION, an event block is triggered for the corresponding events during the creation of details lists. You have to use system fields like sy-lsind to distinguish between the individual details lists.
    <b>END-OF-PAGE</b>
    This statement defines an event block that is raised by the ABAP-runtime during creation of a basic list, if there is a line reservation in the addition LINE-COUNT of the initiating statement for a page footer, which was reached while writing to this page. A list output that takes place in the event block, is placed in this area. Output statements that exceed the reserved area will be ignored.
    <b>Reward if usefull</b>

  • Catch the onClick event on Interactive Report to access columns content

    Hi,
    I am using Apex 4
    I would like to display some rows into an interactive report. I have define a dynamic action on that report in order to catch the Mouse OnClick Event.
    The Goal is to display the detail of the row in a form region in the sidebar.
    To do this, I would like to get the content of a column of the row clicked and then execute a pl/sql block to get the detail of my row.
    I am stuck to get the content of the column I have clicked within the dynamic action to pass it to execute the pl/sql block.
    Any idee?
    Many thanks
    jko
    Edited by: user617942 on 29-Jul-2010 04:19

    Hello,
    Did I ask something stupid :-)
    Jko
    Edited by: user617942 on 29-Jul-2010 04:19
    Edited by: user617942 on 29-Jul-2010 08:34

  • How to use 'AT PF' and 'AT USER-COMMAND' is used in reports...?

    HI,
    I AM SIVA,
    I AM NEW TO ABAP,
    I HAVE NOT CLARY ON 'AT PF' AND 'AT USER-COMMAND'....
    I DONT KNOW HOW AND WHEN TO USE ABOVE TWO EVENTS..
    SEND ME ANY SOURCE CODE OF USING ABOVE TWO EVENTS...
    IF U KNOW THE ANSWER...
    PLEASE SEND ME...
    REGUARS,
    SIVA.

    hi ,
    the on;y diference b/w At User-command and PF Status is that in At user-command we create a menu but in PF Ststus we define the f1 to f12 keys.
    eg; for at User Command.
    let us take tables such as mara, marc, mard.
    data : itab like mara occurs 0 with header line,
             jtab like marc occurs 0 with hl,
             ktab like mard occurs 0 with hl.
    select-options matnr for mara-matnr.
    initialization.
    matnr-low = '0'.
    amtnr-high = '1000'.
    matnr-sign = 'i'.
    matnr-option = 'bt'.
    append matnr.
    start-of-selection.
    write :/ 'menu bar creation'.
    set Pf Status 'MENU'.
    at user-command.
    case sy-ucomm.
    when 'mm01'.
    select * from mara into table itab where matnr in matnr.
    loop at itab.
    write :/ itab-matnr, itab-ernam, itab-ersda, itab-mbrsh.
    hide itab-matnr.
    endloop.
    when 'mm02'.
    select * from marc into table jtab where matnr = itab- matnr.
    loop at jtab.
    write :/ jtab-matnr, jtab-werks, itab-pstat.
    hide itab-matnr.
    hide jtab-werks.
    endloop.
    when 'mm03'.
    select * from mard into table ktab where matnr  = itab- matnr werks = jtab-werks.
    loop at ktab.
    write :/ ktab-matnr, ktab-werks, ktab-lgort.
    endloop.
    when 'mm04'.
    do 10 times.
    write :/ 'hi'.
    enddo.
    when 'mm05'.
    write "/ 'u pressed enter'.
    endcase.
    now go to set pf status 'menu' n double click on it.
    then press yes.
    then again yes.
    then u will find 6 tabstrips tht r blank in menu bar.
    now go to the first tabstrip n name it as table...then in the code give mm01 n text as mara.then again give code as mm02 n text same with mm03.
    then go to second tabstrip n give details n then i nt tht u give mm04 as code n text as hi.then mm05 as code n text....save check n activate,
    then go to function keys n thre u will find save back error tabstrips name them s,c,activate.
    then come back n activate.
    then same thing is wit pf but there is no menu bar creation for it n instead of when 'mm01' we will give at pf04, at pf05....
    one more thing we should always give pf keys from 04 as o1,o2,o3 r used help errors n activation.
    if  u found ur answer n if it is helpful to u then dont forget to reward with points,
    with regards,
    madhuri.

  • Use of at PF AND AT USER COMMAND EVENTS

    can i know the use of at pf and at usercommand

    hi,
    pf-status.
    for example : i am displaying ouput using function module 'REUSE_ALV_LIST_DISPLAY' when u see the output of this there u will find standarad pf status. if requirement is not necesary to display all these buttons means u will create ur own pf status and keep required buttons insideit.
    at user command :
    for example u have one button in ur pf status : select_all
    when u click this button necessary action has to perform. this code u will write under this command.
    hope u got the point.
    thanks,
    maheedhar.t

  • User command event is not working ........

    Hi ,
    class event_class definition.
      public section.
        methods:
           handle_user_command
               for event after_user_command of cl_gui_alv_grid
                   importing e_ucomm.
        methods:handle_hotspot
          for event  hotspot_click of cl_gui_alv_grid
               importing e_row_id.
    endclass.                    "event_class DEFINITION
    ******selection screen**************************
    call screen 100.
          CLASS event_class IMPLEMENTATION
    ********class implimentations********************
    class event_class implementation.
      method handle_user_command.
        case e_ucomm.
          when 'SAVE'.
       wa_default-checkbox = 'X'.
    ENDCASE.
      endmethod.            "handle_user_command
      method  handle_hotspot.
        wa_default-checkbox = 'X'.
        lv_layout-zebra = 'X'.
        lv_hotspot = lv_hotspot + 1.
        modify       lit_default
        index        e_row_id
        from         wa_default
        transporting checkbox.
        lv_id = e_row_id.
    *************refreshing tables************
        call method wa_alv->refresh_table_display
         EXPORTING
           is_stable      =
           i_soft_refresh =
         EXCEPTIONS
           finished       = 1
           others         = 2
        if sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endmethod.       
                "handle_user_command
    method user_command.
    *****some code i will write with help of e_ucomm**********(   control not comming here)
    endmethod.
    endclass.  
    Hi,Here i have one alv grid display if i click on grid checkbox method (hotspot) will triggers properly,,,,but if i select any button like save ,modify i have created on screen method user_command is not triggering ,control is going to pai of that screen.my question is it shold trigger usr_command right??????
    any help appriciated.
    Thanks

    Hi, Lingaraj.
    Check your events handlers is registered
    SET HANDLER go_event_receiver->handle_double_click FOR go_grid.
    SET HANDLER go_event_receiver->handle_toolbar      FOR go_grid.
    SET HANDLER go_event_receiver->handle_user_command FOR go_grid.
    SET HANDLER go_event_receiver->handle_menu_button  FOR go_grid.
    SET HANDLER go_event_receiver->handle_context_menu FOR go_grid.
    SET HANDLER go_event_receiver->on_f4               FOR go_grid.
    SET HANDLER go_event_receiver->handle_data_changed FOR go_grid.
    before calling an ALV:
    go_grid->set_table_for_first_display(
         EXPORTING  is_layout        = ls_layout
                    is_variant       = ls_variant
                    i_save           = 'A'
          CHANGING  it_outtab        = gt_outtab
                    it_fieldcatalog  = lt_fieldcat
    Hope it will be helpful for you.
    Best regards,
    George Shlyahov.

  • Wht's the Diff bet AT-USER command and AT-PF STATUS

    Can Anybody explain me the diffarence between At user command and At-pf status.
    Thanks,
    Srik

    Hi Srikanth,
    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 .
    Some functions are executed directly by the system and thus cannot be processed by programs. These include:
    PICK See variant AT LINE-SELECTION PFn See variant AT PFn /... System command %... System command PRI Print BACK Back RW Cancel P... Scroll function (e.g.: P+ , P- , PP+3 , PS-- etc.)
    Instead of this functions, you can use the SCROLL statement in programs.
    Since many of these system functions begin with "P", you should avoid using this letter to start your own function codes.
    Otherwise, the effect is as for AT LINE-SELECTION ; also, the current function code is stored in the system field SY-UCOMM .
    Example
    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.
    AT PFn - Event in interactive reporting
    Here, n stands for a numeric value between 0 and 99.
    This event is executed whenever the user presses a function key that contains the function code PFn in the interface definition. The default status for lists contains some of these functions.
    Otherwise, the effect is as for the variant AT LINE-SELECTION . The cursor can be on any line.
    To ensure that the chosen function is executed only for valid lines, you can check the current HIDE information. This variant should be used only for test or prototyping purposes, since the default status is not normally used. Instead, you should set a program-specific status with SET PF-STATUS . This should not contain any function codes beginning with " PF ".
    Example
    DATA NUMBER LIKE SY-INDEX.
    START-OF-SELECTION.
      DO 9 TIMES.
        WRITE: / 'Row', (2) SY-INDEX.
        NUMBER = SY-INDEX.
        HIDE NUMBER.
      ENDDO.
    AT PF8.
      CHECK NOT NUMBER IS INITIAL.
      WRITE: / 'Cursor was in row', (2) NUMBER.
      CLEAR NUMBER.

  • User command is not getting triggered in interactive ALV with LIST display

    Hi experts,
    I have developed an interactive ALV report with LIST display. Here, the issue is, when i double click a record in the primary ALV list, the control must go to the USER COMMAND event which i have written in my report. But the user command event is not getting triggered at all when i double click any record.
    It gives the following information instead.
    "Choose a valid function".
    (My user command name and its respective form name are same.)
    Here is my code..
    START-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_structure_name         = p_table
          i_callback_user_command  = 'TST1'
          i_callback_pf_status_set = 'SET_PF_STATUS'
        TABLES
          t_outtab                 = <dyn_table>
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      ENDIF.
    FORM tst1 USING r_ucomm LIKE sy-ucomm
                    rs_selfield TYPE slis_selfield.
    * Local data declaration
      DATA: li_tab TYPE REF TO data,
            l_line TYPE REF TO data.
    * Local field-symbols
      FIELD-SYMBOLS:<l_tab> TYPE table,
                    <l_wa>  TYPE ANY.
    * Create table
      CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN li_tab->* TO <l_tab>.
    * Create workarea
      CREATE DATA l_line LIKE LINE OF <l_tab>.
      ASSIGN l_line->* TO <l_wa>.  CASE r_ucomm.
    *   When a record is selected
        WHEN '&IC1'.
    *     Read the selected record
          READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
          rs_selfield-tabindex.      IF sy-subrc = 0.
    *       Store the record in an internal table
            APPEND <dyn_wa> TO <l_tab>.
    *       Fetch the field catalog info
            CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
              EXPORTING
                i_program_name         = 'Z_DEMO_PDF_JG'
                i_structure_name       = p_table
              CHANGING
                ct_fieldcat            = i_fieldcat
              EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
    Please advice what is the msitake i have done here..

    Read the following code:
    pass the  i_callback_user_command = g_user_command to the ALV function module and write the FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
    as shown below.
    thanx
    Data for ALV display
    DATA  : gt_fieldcat TYPE slis_t_fieldcat_alv,
            gt_events           TYPE slis_t_event,
            g_variant LIKE disvariant,
            g_user_command      TYPE slis_formname VALUE 'USER_COMMAND',
            g_status            TYPE slis_formname VALUE 'SET_PF_STATUS',
            gt_list_top_of_page TYPE slis_t_listheader,
            g_repid LIKE sy-repid,
            gf_pos TYPE i
    Data for ALV display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
               EXPORTING
              i_callback_program      = g_repid
                 i_callback_program      = sy-repid
                 it_fieldcat             = gt_fieldcat[]
           it_events               = gt_events[]
              i_callback_user_command = g_user_command
                 i_save                  = 'A'
                 is_variant              = g_variant
               TABLES
                 t_outtab                = it_print.
    FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          CASE selfield-sel_tab_field.
            WHEN '1-KUNNR'.
              READ TABLE it_print INTO wa_print INDEX selfield-tabindex.
              IF sy-subrc = 0.
                SET PARAMETER ID 'BPA' FIELD wa_print-kunnr.
                CALL TRANSACTION 'BP'.
              ENDIF.
            WHEN '1-MATNR'.
              READ TABLE it_print INTO wa_print INDEX selfield-tabindex.
              IF sy-subrc = 0.
                SET PARAMETER ID 'JP_ISS' FIELD wa_print-matnr.
                CALL TRANSACTION 'JP29' AND SKIP FIRST SCREEN..
               GET PARAMETER ID 'WRK' FIELD wa_zprint-werks.
               SET PARAMETER ID 'VKO' FIELD wa_zprint-vkorg.
               SET PARAMETER ID 'VTW' FIELD wa_zprint-vtweg.
               CALL TRANSACTION 'JP29' AND SKIP FIRST SCREEN.
              ENDIF.
    Endcase.
    Endform.

  • Interactive Report Events

    Hi Friends,
    Can any one give sample programs  of below Interactive Report Events ?
    AT PF<nn> (obsolete)
    AT LINE-SELECTION
    AT USER-COMMAND
    points for sure..
    Regards
    Vijaya

    Hi see the below program.
    Hope this helps you.
    But make sure that the Gui is also created and activated.
    To do this just double click at at pf-status <b>statusname.</b>
    REPORT  Z_EVENTS LINE-SIZE 250.
    Description : This Program accepts accept a range of Airline carrier *
                  ID and Flight connection numbers from the user and     *
                  display SPFLI data.Develop a user interface for the    *
                  basic list with two pushbuttons.It Sorts when the User *
                  clicks on the  sort and sort by push buttons           *
    TABLES:
      SPFLI.                               " Flight schedule
    "Selection screen elements............................................
    SELECTION-SCREEN BEGIN OF BLOCK
      CARR_CONN.
    SELECT-OPTIONS:
      S_CARRID FOR SPFLI-CARRID,           " Carrier Id
      S_CONNID FOR SPFLI-CONNID.           " Connection Id
    SELECTION-SCREEN END OF BLOCK
      CARR_CONN.
    Dat declaration of the structure to hold spfli data
    DATA:
      W_LINE_DATA(255) TYPE C.             " Line Content
    DATA:
      BEGIN OF FS_SPFLI,
        CARRID    LIKE SPFLI-CARRID,       " Carrier Id
        CONNID    LIKE SPFLI-CONNID,       " Connection Id
        CITYFROM  LIKE SPFLI-CITYFROM,     " Departur City
        CITYTO    LIKE SPFLI-CITYTO,       " Arrival City
        AIRPFROM  LIKE SPFLI-AIRPFROM,     " Departure Airport
        AIRPTO    LIKE SPFLI-AIRPTO,       " Arrival Airport
        COUNTRYFR LIKE SPFLI-COUNTRYFR,    " Departure Country
        COUNTRYTO LIKE SPFLI-COUNTRYTO,    " Arrival Country
      END OF FS_SPFLI.
    *Internal Table  to hold FLIGHT_DETAILS                                *
    DATA:
      T_SPFLI LIKE
    STANDARD TABLE                        " FS_SPFLI like Structure
           OF FS_SPFLI,
    W_FIELD(180) TYPE C.
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      W_BOX TYPE C.                        " Check Box in the window
                         START OF SELECTION EVENT                        *
    START-OF-SELECTION.
      PERFORM SELECT_DETAILS.
    Set PF-Status
      SET PF-STATUS 'BUTTON_SORT'.
                         AT USER COMMAND EVENT                           *
    AT USER-COMMAND.
      GET CURSOR FIELD W_FIELD.
      W_FIELD = W_FIELD+9(10).
      CASE SY-UCOMM.
        WHEN 'SORT'.
          SORT T_SPFLI STABLE BY (W_FIELD) ASCENDING.
          PERFORM DISPLAY_DETAILS.
        WHEN 'SORTDATABY'.
          PERFORM DISPLY_FIELDS.
        WHEN 'SORTASCEN'.
          PERFORM SORT_ASC_FIELD.
        WHEN 'SORTDESCEN'.
          PERFORM SORT_DES_FIELD.
        WHEN OTHERS.
          WRITE 'Invalid Command'(002).
      ENDCASE.                             " CASE SY-UCOMM.
                         END  OF SELECTION EVENT                         *
    END-OF-SELECTION.
      PERFORM DISPLAY_DETAILS.
    *&      Form  SELECT_DETAILS                                           *
      This Sub routine Retriebes the Details From SPFLI Table            *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SELECT_DETAILS .
      SELECT CARRID                        " Carrier Id
             CONNID                        " Connection Id
             CITYFROM                      " Departur City
             CITYTO                        " Arrival City
             AIRPFROM                      " Departure Airport
             AIRPTO                        " Arrival Airport
             COUNTRYFR                     " Departure Country
             COUNTRYTO                     " Arrival Country
        FROM SPFLI
        INTO TABLE T_SPFLI
      WHERE CARRID IN S_CARRID AND
        CONNID IN S_CONNID.
      IF SY-SUBRC NE 0.
        WRITE'No Records Available'(001).
      ENDIF.                               " IF SY-SUBRC NE 0.
    ENDFORM.                               " SELECT_DETAILS
    *&      Form  DISPLAY_DETAILS                                          *
    This subroutine displays the SPFLI data on the basic list            *
    There are no interface parameters to be passed to this subroutine.   *
    FORM DISPLAY_DETAILS .
      MOVE 0 TO SY-LSIND .
      LOOP AT T_SPFLI INTO FS_SPFLI.
        AT FIRST.
          WRITE:
            /  'Carrier Id'(003),
            15 'Connection Id'(004),
            30 'Departur City'(005),
            45 'Arrival City'(006),
            60 'Dept Airport'(007),
            75 'Arri Airport'(008),
            90 'Dept Country'(009),
            105 'Arri Country'(010).
            ULINE.
        ENDAT.
        WRITE:
          /01  FS_SPFLI-CARRID,            " Carrier Id
           15  FS_SPFLI-CONNID,            " Connection Id
           30  FS_SPFLI-CITYFROM,          " Departur City
           45  FS_SPFLI-CITYTO,            " Arrival City
           60  FS_SPFLI-AIRPFROM,          " Departure Airport
           75  FS_SPFLI-AIRPTO,            " Arrival Airport
           90  FS_SPFLI-COUNTRYFR,         " Departure Country
           105 FS_SPFLI-COUNTRYTO.         " Arrival Country
      ENDLOOP.                             " LOOP AT T_SPFLI INTO FS_SPFLI
    ENDFORM.                               " DISPLAY_DETAILS
    *&      Form  DISPLY_FIELDS                                            *
    This Subroutine displays All Fields names in displayed list          *
    There are no interface parameters to be passed to this subroutine.   *
    FORM DISPLY_FIELDS.
      SET PF-STATUS  'WINDOW'.
      WINDOW STARTING AT 3 10
             ENDING   AT 15 60.
      WRITE:
        /1  W_BOX AS CHECKBOX,
          5 'CARRID',
        /1 W_BOX AS CHECKBOX,
          5 'CONNID',
        /1 W_BOX AS CHECKBOX,
          5 'CITYFROM',
        /1 W_BOX AS CHECKBOX,
          5'CITYTO',
        /1 W_BOX AS CHECKBOX,
          5 'AIRPFROM',
        /1  W_BOX AS CHECKBOX,
          5 'AIRPTO',
        /1 W_BOX AS CHECKBOX,
          5 'COUNTRYFR',
        /1 W_BOX AS CHECKBOX,
          5 'COUNTRYTO'.
    ENDFORM.                               " DISPLY_FIELDS
    *&      Form  SORT_ASC_FIELD                                           *
      This subroutine sorts the list by selected fields in ascending     *
       order                                                             *
    There are no interface parameters to be passed to this subroutine   *
    FORM SORT_ASC_FIELD .
      DATA:
        LW_CHECK TYPE C,                   " Check Box
        LW_FIELD(255) TYPE C,              " Field
        LW_F_VALUE(10) TYPE C,             " Field Value
        LW_FIELD1(10) TYPE C,              " Field Value
        LW_FIELD2(10) TYPE C,              " Field Value
        LW_FIELD3(10) TYPE C,              " Field Value
        LW_FIELD4(10) TYPE C,              " Field Value
        LW_FIELD5(10) TYPE C,              " Field Value
        LW_FIELD6(10) TYPE C,              " Field Value
        LW_FIELD7(10) TYPE C,              " Field Value
        LW_FIELD8(10) TYPE C.              " Field Value
      DO 8 TIMES.
        READ LINE SY-INDEX.
        LW_CHECK = SY-LISEL+0(1).
        LW_F_VALUE = SY-LISEL+4(10).
        IF LW_CHECK = 'X'.
          CASE SY-INDEX.
            WHEN 1.
              LW_FIELD1 = LW_F_VALUE.
            WHEN 2.
              LW_FIELD2 = LW_F_VALUE.
            WHEN 3.
              LW_FIELD3 = LW_F_VALUE.
            WHEN 4.
              LW_FIELD4 = LW_F_VALUE.
            WHEN 5.
              LW_FIELD5 = LW_F_VALUE.
            WHEN 6.
              LW_FIELD6 = LW_F_VALUE.
            WHEN 7.
              LW_FIELD7 = LW_F_VALUE.
            WHEN 8.
              LW_FIELD8 = LW_F_VALUE.
          ENDCASE.
        ENDIF.
      ENDDO.
      SORT T_SPFLI STABLE BY
        (LW_FIELD1)  ASCENDING
        (LW_FIELD2)  ASCENDING
        (LW_FIELD3)  ASCENDING
        (LW_FIELD4)  ASCENDING
        (LW_FIELD5)  ASCENDING
        (LW_FIELD6)  ASCENDING
        (LW_FIELD7)  ASCENDING
        (LW_FIELD8)  ASCENDING.
      PERFORM DISPLAY_DETAILS.
    ENDFORM.                               " SORT_ASC_FIELD
    *&      Form  SORT_DES_FIELD
      This subroutine sorts the list by selected fields in descending    *
       order                                                             *
    There are no interface parameters to be passed to this subroutine   *
    FORM SORT_DES_FIELD .
      DATA:
      LW_CHECK TYPE C,
      LW_FIELD(255) TYPE C,
      LW_F_VALUE(10) TYPE C,
      LW_FIELD1(10) TYPE C,LW_FIELD2(10)
        TYPE C,
      LW_FIELD3(10) TYPE C,LW_FIELD4(10)
        TYPE C,
      LW_FIELD5(10) TYPE C,LW_FIELD6(10)
        TYPE C,
      LW_FIELD7(10) TYPE C,LW_FIELD8(10)
        TYPE C.
      DO 8 TIMES.
        READ LINE SY-INDEX.
        LW_CHECK = SY-LISEL+0(1).
        LW_F_VALUE = SY-LISEL+4(10).
        IF LW_CHECK = 'X'.
          CASE SY-INDEX.
            WHEN 1.
              LW_FIELD1 = LW_F_VALUE.
            WHEN 2.
              LW_FIELD2 = LW_F_VALUE.
            WHEN 3.
              LW_FIELD3 = LW_F_VALUE.
            WHEN 4.
              LW_FIELD4 = LW_F_VALUE.
            WHEN 5.
              LW_FIELD5 = LW_F_VALUE.
            WHEN 6.
              LW_FIELD6 = LW_F_VALUE.
            WHEN 7.
              LW_FIELD7 = LW_F_VALUE.
            WHEN 8.
              LW_FIELD8 = LW_F_VALUE.
          ENDCASE.                         " CASE sy-index.
        ENDIF.                             " IF lw_check = 'X'.
      ENDDO.                               " DO 8 TIMES.
      SORT T_SPFLI STABLE BY
        (LW_FIELD1)  DESCENDING
        (LW_FIELD2)  DESCENDING
        (LW_FIELD3)  DESCENDING
        (LW_FIELD4)  DESCENDING
        (LW_FIELD5)  DESCENDING
        (LW_FIELD6)  DESCENDING
        (LW_FIELD7)  DESCENDING
        (LW_FIELD8)  DESCENDING.
      PERFORM DISPLAY_DETAILS.
    ENDFORM.                               " SORT_DES_FIELD
    Regards,
    Rama chary.Pammi

  • Save Interactive Reports in Apex 4.0 for a specific user

    Hello all
    Here's the setup: I have APEX 4.0.1 running on Oracle EE 10.2.0.5 on Windows 2003.
    I built a GPS application which allows users to see their vehicles on a google map...but this is beside the point.
    My problem is that when a user saves a specific Interactive Report (after having done some customization as to columns & computaitons etc) the report is visible to any one that connects to the application.
    I am using a custom made authentication (in Apex I use no authentication and have a function validate the user logon before he is taken to the main page). this is because users are divided into companies, sub companies and departments and each user is granted access to a page in function of his presence in this hierarchy.
    My question is: how can I implement the feature whereby saved interactive reports are visible to only those users that saved them?
    Thanks in advance

    Hi "user12045065" (please change your forum handler),
    what does APP_USER show for you? Is it the same for all users?
    I'm not sure if I fully understood your sentence "in Apex I use no authentication and have a function validate the user logon".
    Does that mean you are NOT using a "custom authentication scheme" for that? If you answer that question with yes, how should APEX be able to distinguish the different users? And I still don't understand why you don't use it, because also with a "custom authentication scheme" you can redirect the user to the page he is privileged for.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Refresh Report and At Line-Selection and At User-Command

    Hi All
    I have 2 querries
    1) I want to use At Line-selection and At user-command in the same report. But At line-selection is not getting triggered why? When I remove Set pf-status 'xxx' and at user command , then at line selection works . I want to user both at a time.
    2) I am giving user ability to edit the report shown and when he comes back by exiting the editing I want to refresh the report which is shown already to him to give effect of his editing.
    Thanks in anticipation
    pM.

    i just tried, and no problem at all.
    In the <b>Recommended Function Key Settings</b>  for  F2 key add command "PICK"
    Regards
    Raja
    since you are new to the forum, have a look at this weblog.
    /people/mark.finnern/blog/2004/08/10/spread-the-love

Maybe you are looking for

  • Safari won't load and trying to open it locks my computer

    Okay, so I'm at a loss. A few weeks ago, Safari crashed. When I tried to open it again, it would bounce on the dock, the pinwheel would come up and then nothing else would happen....when I tried to quit Safari, I noticed the computer was locked-up an

  • Pictures are tinted red when playing on TV

    Has anyone experienced and/or solved this issue? When playing pictures from the library (not streaming) they are all tinted with a reddish hue. This happened after a few hours of normal operation. I restarted the machine and it did nothing to help th

  • Change Appearance Color in Elements 6

    Hi, New to Elements 6 and what a surprise. My eyes can't get used to working with a black background. I'm told there is a slider somewhere that will change the appearance of Elements 6 from Black to Gray in both the editor and organizer similar to El

  • Weblogic Server 7.0 - can't find cmd.exe

    Hi I am having a simular problem I have succefully installed web logic server 7.0 and created a domain "dlidomain". When I am trying to start->Programs-> " WebLobic Platform 7.0 -> User Projects --> dlidomain" its searching for "cmd.exe" which is not

  • The page layouts for a book created in iPhoto are blank. How do I get the original book back?

    I have a MacBook Pro, Mac OS X, version 10.7.5, Memory 4GB 1067 MHz DDR3, Processor 2.53GHz, Intel Core 15. iPhoto '11 version 9.4.3. I created an iPhoto book using iPhoto '9 in 2010. I bought the book and now want to buy another book. When I went to