Capture the ALV Hot Spot column on which the user had exactly clicked

Hello Experts,
I have an ALV in Web Dynpro with 4 columns of which two columns have hot spot action on them.
Now when i click on the 1st column a pop up should appear and on click of the 2nd column a different Pop-up should appear.
Now i have an even handler which handles the ON_CLICK event..
Whenever i click on either of the columns the control will go to this event handler method.
Now my doubt is how to capture the column on which the user had exactly clicked so that i can define actions seperately for each column.
Reply is Appreciated.
Thanks in Advance,
Shravan

Try This
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    METHODS:
      on_link_click FOR EVENT link_click OF cl_salv_events_table
        IMPORTING row column.
ENDCLASS.                    "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION.
  METHOD on_link_click. 
   " Your business logic goes here. The variable *row* contains the row number and *column contains column name*.
  ENDMETHOD.
ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
* Put this code just nefore you have used the display method of SALV.
    DATA: lo_event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT lo_event_handler.
* Register the event handler
    SET HANDLER lo_event_handler->on_link_click FOR lo_events.
Hope this helps.
Regards
Mishra

Similar Messages

  • How to capture the user name who is running concurrent program

    Hi Everyone
    In oracle apps when i want to store the user name who is running a concurrent program in specific responsibility.
    For that I created a table as USER_INFO which has a column called USERNAME.
    T o capture the user name i created a before report trigger and wrote the following code which will store the username into USER_INFO
    function insert_trg return boolean is
    begin
      insert into USER_INFO(USERNAME) values
    (select fnd_profile.value('USERNAME') from dual);
    COMMIT;
      return (TRUE);
    end;In the above code i used fnd_profile.value('USERNAME') to store the username but after running the concurrent program when i am query the table it returns no rows .
    It means the fnd_profile.value('USERNAME') is not storing the value.
    Please tell me what to do?
    Regards
    Sabyasachi

    In order to fetch any FND_PROFILE or FND_GLOBAL values you need to initialize apps
    fnd_global.apps_initialize(user, resp_id,resp_application_id)
    begin
    fnd_global.apps_initialize(0,20420,1);
    dbms_output.PUT_LINE (FND_PROFILE.VALUE('ORG_ID'));
    dbms_output.PUT_LINE (FND_PROFILE.VALUE('USER_ID'));
    dbms_output.PUT_LINE (FND_PROFILE.VALUE('USERNAME'));
    end; Check the following MOS note
    How To Set the Applications Context (FND_GLOBAL.APPS_INITIALIZE) [ID 209185.1]
    Cheers,
    ND
    Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered.

  • How to capture the user change in an input field on a selection screen?

    I am coding a selection screen in which there are two input fields. The first field takes a Unix directory from the user input. Based on the input value, the second field will be populated with a the name of a file under the corresponding directory.
    My question is how I can make the program capture the user input without having to make the user press ENTER after they enter the value in the first field?
    Any help will be greatly appreciated.

    Venkat,
    Actually you led me to the real solution! It's the function module DYNP_VALUES_READ that does the trick for me. This function enables the program to capture dynamic user changes without recourse to PAI. Please refer to the code below:
    REPORT   zreiabsintf MESSAGE-ID zreiabsintfmc.
    *<HGDC------------------------------------------------------------------
    *  Selection screen for the conversion program
    *HGDC>------------------------------------------------------------------
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-001.
    PARAMETERS: p_indir   LIKE epsf-epsdirnam OBLIGATORY,                   " Inbound file directory
                p_infile  LIKE epsf-epsfilnam DEFAULT gc_infile OBLIGATORY, " Inbound file name
    SELECTION-SCREEN END OF BLOCK input.
    *<HGDC------------------------------------------------------------------
    *   Displays a file-open dialog when the user clicks the search
    *   help button next to the inbound file text field. The user
    *   can select the inbound file visually.
    *HGDC>------------------------------------------------------------------
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
    * Capture any user change to the directory.
      PERFORM check_dir_change.
    * Display the file open dialog
      PERFORM file_open_dialog CHANGING p_infile.
    *<HGDC------------------------------------------------------------------
    * Global constants
    *HGDC>------------------------------------------------------------------
    CONSTANTS:
        gc_indir  LIKE epsf-epsdirnam
                  VALUE '/interfaces/<SID>/inbound/',      " Default inbound directory template
        gc_infile LIKE epsf-epsfilnam VALUE 'input'.       " Default inbound file name
    *<HGDC------------------------------------------------------------------
    * Global data
    *HGDC>------------------------------------------------------------------
    DATA:
        gs_dynpfields   TYPE dynpread,                        " Fields of the current screen
         gt_dynpfields   LIKE STANDARD TABLE OF gs_dynpfields. " Table of the screen fields
    *&      Form  file_open_dialog
    *       Opens a dialog window for the user to choose a file in
    *       the specified Unix directory.
    *      <--P_FILE is the file to be selected.
    FORM file_open_dialog  CHANGING p_file.
    * Validate the directory.
      OPEN DATASET p_indir FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        MESSAGE i001(zreiabsintfmc) WITH p_indir.    " Unable to open the given directory
        EXIT.
      ENDIF.
      CLOSE DATASET p_indir.
    * Call the dialog window to open a file in the directory.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_indir
        IMPORTING
          serverfile       = p_file
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE i002(zreiabsintfmc).                 " Failed to open the file.
        EXIT.
      ENDIF.
    ENDFORM.                    " file_open_dialog
    *&      Form  check_dir_change
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM check_dir_change .
      CLEAR gs_dynpfields.
      CLEAR gt_dynpfields.
      gs_dynpfields-fieldname = 'P_INDIR'.
      gs_dynpfields-fieldvalue = p_indir.
      APPEND gs_dynpfields TO gt_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = gt_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc  NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_dynpfields INTO gs_dynpfields INDEX 1.
      p_indir = gs_dynpfields-fieldvalue.
    ENDFORM.                    " check_dir_change
    Thanks for all your answers! The problem is now solved.
    Edited by: Ning Hu on Apr 9, 2008 11:32 AM
    Edited by: Ning Hu on Apr 9, 2008 11:34 AM

  • How to capture the user activities in Project Server 2010

    Hi
    I want  to capture the user activities from Project Server 2010 like when a user has saved and published etc.
    Is there any possibility that we can get the user activities data from sql server.
    Please throw some light on the same.
    Thanks
    Geeth If you feel that the answer which i gave you is Helpful please select it as Answer/helpful.

    Hi Geetha,
    As far as I know, there is no such information stored in Project Server DB.
    You can have this kind of information by project, such as the ProjectModifiedDate in the Reporting DB (MSP_EPMProject_userView). I also know that there is a PROJ_LAST_SAVED date in the Draft DB. But be aware that querying in the Draft DB is not supported
    by MS.
    Another way would be doing some custom code, storing in a separate DB each save and publish operation per user.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Capturing the user

    I have a 'n' users with write back privileges. for those users they have the privileges to edit a column. Now i need how to capture the user information & last updated or modified the column.
    Can anyone let me know in detail.
    Thanks

    Hi mma,
    i was not clear the first posted by you. instead of reply to that post i posted a new one.
    I came to know with the usage of Variables we can capture the user. But i dont know how to use the variable.
    Thanks

  • Trace the statements which the user had executed

    Hi all,
    if i want to trace the statements which the user had executed, what should i do?

    Query the v$sqlarea or v$sql view. The sql_text column
    will print out the entire sql string statement.
    SQL > select sql_text from v$sqlarea where parsing_user_id = <input>
    But its length is restricted to 1000 characters. If the query statement exceeds 1000 characters, you can query
    from the v$sqltext view
    The parsing user id is the same as stored in the dba_users table
    SQL > select sql_text from v$sqltext where address = ( select address from v$sqlarea where parsing_user_id = <input> ) order by piece asc;
    Is this what you were looking for ???

  • Need to have pop up window in selection screen and capture the user action.

    Hello Friends,
                         I have a requirement, that need to show a pop up window after execution, and to get the action from user using a Push button.
    I create a selection screen and a sub screen as window.
    After user execute from the selection screen, I am popping up this window.
    Window contains some input values to be entered and push button to identify the user action.
    I try to capture the user action using sy-ucomm, but it does not hold any value when user press the button.
    How to overcome this issue.
    Here is the definition of the window.
    Pop Up Window for getting values
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE title .
    PARAMETER : p_vdate LIKE t9aa01-validfrom,
                p_dcggt LIKE t9aa01-hkont,
                p_dcgst1 LIKE t9aa01-hkont,
                p_dcgst2 LIKE t9aa01-hkont,
                p_na LIKE t9aa01-hkont.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 20.
    SELECTION-SCREEN PUSHBUTTON 2(10) text-001 USER-COMMAND SVE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF SCREEN 500.
    Cheers,
    Senthil
    Edited by: Senthil on Jan 7, 2008 11:03 AM

    Hi,
    Try using the below code.
           data : w_var type string.
           CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
              DEFAULTOPTION        = 'Y'
               textline1            = 'test '
             TEXTLINE2            = ' '
               titel                = 'check'
             START_COLUMN         = 25
             START_ROW            = 6
             CANCEL_DISPLAY       = 'X'
            IMPORTING
              ANSWER               = w_var.
                     if w_var = 'J'.
                     else.
                     endif.
    Comments : J indicates Yes and N indicates No
    Regards,
    Jeswanth

  • How to capture the user who has logged into the portal.

    Hi,
    How do I capture the user who has logged into the portal.
    HOw do I retrieve the first name and last name of the logged in username.
    Could someone provide me a related link or PDF to work on this.
    Thanks,
    Suvarna

    Hi suvarna,
    Check the following code
    ISearchResult rst = UMFactory.getUserFactory().getUniqueIDs();
                      IUserFactory usf = UMFactory.getUserFactory();
                      IUser iuser = null;
                      IUserListElement userElement = null;
                      int i = 0;
                      while (rst.hasNext()) {
                            iuser =
                                  UMFactory.getUserFactory().getUser(rst.next().toString());
                            String email = iuser.getEmail();
                            String fname = iuser.getFirstName();
                            String lname = iuser.getLastName();
    regards
    Anil Dichpally

  • Capturing the User Id from the Password change screen after Login

    Hi,
    I need to capture the User Id from the Password Change screen and Pass it to the Custom  Portal application that is triggered on the change password screen.That User Id will be passed on to the Portal application to retrieve the details of the User.
    I have triggered the Custom Portal application from the OnClick of CHANGE button.
    It can be probably done by appending the User Id captured from the Change Password screen to the Url of the Portal application.
    But am not clear how to capture the User ID.
    Pls help!!
    Thanks & Regards,
    Amarys.

    Hello
    Why do you want to capture user id? You can access it from portal application.

  • Prompt the error message according to what the user had entered.

                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                                  if(inputQuestionRange > 5 || inputQuestionRange <2){
                                       System.out.println("Error: Please Range enter between 2 to 5.\n");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];
                   }//for rangeResult:
    Input range for Question 1: 2d
    Error: Please enter a valid number.
    Error: Please Range enter between 2 to 5.
    Input range for Question 1:
    I would like to prompt the error message according to what the user had input.
    However when user input *2d* it just print both error message as it went into the if-else block. how can i skip the if-else block ???

                   //Set Range
                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                                       if(inputQuestionRange > 5 || inputQuestionRange <2){
                                            System.out.println("Error: Please Range enter between 2 to 5.\n");
                                       }     else{
                                                 System.out.println("OK");
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];                    
                   }//for rangeResult:
    Input range for Question *1*: 22
    Error: Please Range enter between 2 to 5.
    Input range for Question *1*: d
    Error: Please enter a valid number.
    Input range for Question *1*: 3
    OK
    Input range for Question *2*: ww
    Error: Please enter a valid number.
    Input range for Question *3*:
    Hi, thank you for your help, i just realize another problem.
    why does my Question number increment to 3, it should remain as 2 when i request for user input again. i try many ways by altering the for loop, when i insert the try & catch block in a while(!invalid), it just loop forever and crash. How can i solve this ?
    Edited by: metaroot on Feb 18, 2008 1:55 PM

  • Removing undeline from the hot spot column ( REUSE_ALV_GRID_DISPLAY )

    Hi
    I am using the Hot Spot for the columns in ALV report.
    I need to remove the underline from the column values here.
    How to do that.
    Amol

    One thing we have done with ALV is to not use the hotspots. We have the users double click on a cell, rather than single click. In the command processing routine, the system still receives the correct field name for deterining the processing, etc.
    The other advantage is that this allows us to copy and paste much easier individual fields fdrom the ALV without jumping to a new function unintentionally. The disadvantage is that you cannot see which fields have links.
    Remove the hotspot from the field, run the program, and double click on the field. It will still call the command processor, and the underline is gone.
    Just an idea based on something we had to do becuase of the copy/paste issue.

  • Strange navigation in ALV hot-spot.

    Hi All,
    I have a strange problem, which I hope to get som advice about.
    Anyway I have created an ALV-report with hot-spot.
    The hot-spot executes the line below and of course it "jumps" to VA03.
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    The strange thing happens when I press 'F3' and returns to the ALV.
    The first time I do this, - it works fine, but when I 're-click' on the hot-spot Im again directed to transaction VA03.
    Now have to press 'F3' twice to get back to the ALV.
    Same thing happens when I 're-re-click' the hot-spot. But now I have to press 'F3' three times.
    Does anyone have an Idea how to solve this?
    I use the event to handle the hot-spot and I have attached the PBO snippet below to ease your understanding of my program.
    Please feel free to ask for more information
    Thanks in advance
    Lars Bernstorff Hansen
    CLASS cl_event_receiver DEFINITION.
      PUBLIC SECTION.
        DATA: t_utab_unsend TYPE zsd_tt_utab_unsend_mail
            , t_utab_send   TYPE zsd_tt_utab_send_mail.
        METHODS: handle_hotspot_click
          FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id.
    MODULE status_0100 OUTPUT.
      DATA: et_index_columns  TYPE lvc_t_col
          , i_structure_name  TYPE dd02l-tabname
          , is_layout         TYPE lvc_s_layo
          , it_fieldcatalog       TYPE lvc_t_fcat
          , i_gridtitle       TYPE lvc_title
          , linetype          TYPE string
          , itabref           TYPE REF TO data
          , ls_fcat           TYPE lvc_s_fcat.
      FIELD-SYMBOLS: <psaareatab>  TYPE STANDARD TABLE
                   , <psaareatab2> TYPE STANDARD TABLE.
      IF p_r1 = lcl_initialization=>c_x.
        linetype         = 'ZSD_UTAB_UNSEND_MAIL'.
        i_gridtitle      = 'Ukomplette ordrer - ej sendte'(200).
        i_structure_name = 'ZSD_UTAB_UNSEND_MAIL'.
      ELSE.
        linetype         = 'ZSD_UTAB_SEND_MAIL'.
        i_structure_name = 'ZSD_UTAB_SEND_MAIL'.
        i_gridtitle      = 'Komplette ordrer - sendte'(201).
      ENDIF.
      CREATE DATA itabref TYPE STANDARD TABLE OF (linetype).
      ASSIGN itabref->* TO <psaareatab>.
      IF p_r1 = gc_x.
        ASSIGN gt_utab_unsend TO <psaareatab>.
      ELSE.
        ASSIGN gt_utab_send TO <psaareatab>.
      ENDIF.
      SET TITLEBAR  'MAIN100'.
      SET PF-STATUS 'MAIN100'.
      IF go_custom_container IS INITIAL.
        CREATE OBJECT go_custom_container
          EXPORTING
            container_name = go_container.
        CREATE OBJECT go_grid
          EXPORTING
            i_appl_events = lcl_initialization=>c_x
            i_parent      = go_custom_container.
      ENDIF.
      lcl_initialization=>gxt_utab_unsend[] = gt_utab_unsend[].
      lcl_initialization=>gxt_utab_send[]   = gt_utab_send[].
      lcl_initialization=>bukrs             = p_bukrs.
      lcl_initialization=>r1                = p_r1.
      " Create handler.
      CREATE OBJECT event_receiver.
      " Register handler for events.
      SET HANDLER event_receiver->handle_hotspot_click FOR go_grid.
      CALL METHOD r_present_result->set_layout( CHANGING is_layout = is_layout ).
      " Create field catalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = i_structure_name
        CHANGING
          ct_fieldcat      = it_fieldcatalog.
      " Hotspot fields.
      CALL METHOD r_present_result->set_fieldcatalog
        EXPORTING
          i_r1            = p_r1
        CHANGING
          it_fieldcatalog = it_fieldcatalog.
      lcl_initialization=>it_fieldcatalog[] = it_fieldcatalog[].
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = i_structure_name
          is_layout        = is_layout
        CHANGING
          it_fieldcatalog  = it_fieldcatalog
          it_outtab        = <psaareatab>.
      CALL METHOD go_grid->set_gridtitle
        EXPORTING
          i_gridtitle = i_gridtitle.
    ENDMODULE.                 " STATUS_0100  OUTPUT

    Hi.,
    Please Share your solution here.. It will be useful for others who are facing this kind of problem..!!
    Thanks & Regards,
    Kiran

  • How to capture the User input value to user exist function module.

    Hi,
    How can i capture user input value.Here i am using User exist in BPS variable.
    Calculating days using user exist functin module and my input is another variable i.e user defined value.
    How can i capture user defined vaule into my function module.
    This is very urgent can you help me..
    Thanks....

    Hi!
    You can get the instance using the method get_instance of the class cl_sem_variable, and call the method get_value with the return. Check the example:
          CALL METHOD cl_sem_variable=>get_instance
            EXPORTING
              i_area       = (planning area)
              i_variable   = (variable name)
            RECEIVING
              rr_variable  = lr_var
            EXCEPTIONS
              not_existing = 1
              OTHERS       = 2.
          CHECK sy-subrc IS INITIAL.
          CALL METHOD lr_var->get_value
            RECEIVING
              rto_value = et_value
            EXCEPTIONS
              error     = 1.
    After this, read the first line of the table et_value (it should be the value that the user choose on the screen).
    seeya!
    Robson

  • How to Capture the user command value instead of ucomm and pfkey from syst

    Hi,
    How to capture the value of enter key in the enhancements.
    Iam getting the sy-ucomm value as space. Please let me know the better solution ASAP.
    regards
    Nagendra

    Hello,
    If is a module pool program, take a look to the variable defined to receive the user-command (you can see this in the screen painter).
    Regards.

  • Capturing the LOG OFF url click action in a Webdynpro application

    Hi,
    I have this requirement where I need to know when the User logs off in a webdynpro application.
    I have several webdynpro applications, each independent, and each need to do some clean up tasks when the user clicks on the LOG OFF url in the portal login.
    Is there some standard event attached with the LOG OFF Url of the portal login?
    And could anybody please specify when exactly would the  <i>wdDoExit()</i> method of the application view(s) or the application component controller get's trigerred when the application is run from the portal login?
    Thanks in Advance.
    Regards,
    Swapna Priya.

    Hi Luciano,
    I was successfully able to call the RFC from wdDoExit() method of the component controller.
    Also I could successfully place a custom alert call when the user clicks on the LOGOFFurl in the portal browser.
    Now I have one more pending requirement for me to completely use this cycle of events.....The Portal Browser close action i.e., 'X' action.
    I did find a forum link with some code for the same but i did not understand where to place that code and have already raised a reply for hte same.
    Below is the link:
    /message/230174#230174 [original link is broken]
    Do you have any idea about how to trap this?
    Thanks for all your support
    Regards,
    Swapna Priya.

Maybe you are looking for