How to find the selected item in alv grid or table control

can any one tell me please
how to find the selected item in alv grid or table control

In table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
IN PAI
  LOOP AT it_tkhdr.
    FIELD it_tkhdr-sel_row
      MODULE tab_tkhdr_mark ON REQUEST.
  ENDLOOP.
MODULE tab_tkhdr_mark INPUT.
  MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
ENDMODULE.                 " tab_tkhdr_mark  INPUT
here it_TKHDR is internal table sel_row is field for selection
After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
regards,
Gagan

Similar Messages

  • How to find the selection character is xml tag or not?(CS2-js)

    I have a xml tagged indesign document, when i select a tag in paragraph i cant able to find it as xml tag, it only shows me the character contents as small box, is there any way to find the selected item is xml tag or not ?
    thanks
    subha

    I have a xml tagged indesign document, when i select a tag in paragraph i cant able to find it as xml tag, it only shows me the character contents as small box, is there any way to find the selected item is xml tag or not ?
    thanks
    subha

  • How to find the number of columns in an internal table DYNAMICALLY ?

    Hi,
    How to find the number of columns in an internal table DYNAMICALLY ?
    Thanks and Regards,
    saleem.

    Hi,
    you can find the number of columns and their order using
    the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_INCLNAME                   = sy-repid
      changing
        ct_fieldcat                  = IT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif
    now describe your fieldcat . and find no of columns.
    and their order also..
    regards
    vijay

  • Alv Grid and Table Control

    What is the difference between Alv Grid and Table Control?Explain in detail..

    Table control is a screen table to display table data in a screen. You can add table control to a screen in the Screen Painter. The typical flow-logic to process table control is:
    LOOP AT <internal table> CURSOR <scroll-var>
    [WITH CONTROL <table-control> ]
    [FROM <line1> ] [TO <line2> ].
    ...<actions>...
    ENDLOOP.
    ALV Grid is a SAP Technology to display a set of data on the output screen. For example if you have selected some SAP tables and processed these data in a way you want to display, then you can pass the internal table to the ALV Grid and it will be displayed on the result screen as ALV Grid. See example in SE16 result.

  • How to get the selected items from listbox

    Regarding listbox i have two questions
    1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
    2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
    please give me a suggestion.

    In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
    If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
    Wish you good luck. Perhaps, someone else has a already made vi.
    Cheers!
    ian.f
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

  • How to find the inserted values in alv

    Hello All,
    How to find the inserted and deleted values in ALV.
    Regards,
    lisa.

    Hi,
    copy the output table before calling set_table_for_first_display and refresh_display
    then in your event call
    CLASS lcl_alv_handler_1100 DEFINITION.                        
      PUBLIC SECTION.
        METHODS:
          handle_data_changed                                      
             FOR EVENT data_changed OF cl_gui_alv_grid
                 IMPORTING er_data_changed,
    ENDCLASS.  
    after this here you can find modified new output table
    then compare the new output table with older one
    aRs

  • How to check the selected items of a selectManyListbox in doDML of an EO ?

    Hello,
    I have a VO based on en EO. During the doDML(UPDATE) of that EO, I would like to check what items of a af:selectManyListbox have been selected.
    How could I get the checked items in the selectManyListbox (which belongs to the ViewController) in the doDML method of an EO (which belongs to the Model)?
    Many thanks

    Hello John,
    I know I cannot access the component directly. This is why I asked my question.
    The real case is rather complex and long to be copied and pasted here.
    Let me simplify it without being too generic.
    The VO is based on a hierarchical SQL query. All its EO attributes are transient. This VO is shown as a Tree in the page.
    Each node of the Tree has a checkBox. During commit (doDML() of the EO to be precise), for each checked node I need to access the selected items of a selectManyListbox in some proper way to perform further operations on the DB (no matter what now). The selectManyListbox is based on a second VO. As you may understand, the problem is that from the EO I don't have a direct access to the selectManyListbox. Also, as far as I know, the VO the selectManuListBox is based on does not have any informations about the selected elements, since the checkBox in the list cannot be associated to the VO. Basically I cannot know what elements have been choosen.
    I hope the problem is clear.

  • How to identify the modified rows in ALV grid in OO

    Hello All,
    I have strange problem and i don't know how to solve it?
    I have ALV grid and in that ALV grid i have two buttons 'CONT' and 'ALLOC', when the user press 'ALLOC' button i will give a popup to make the user to enter some value.
    After entering the value i will do some calicualtions and i will distribute the amount in the fields of ALV grid and i should update the ALVGRID.
    Normally we can use CALL METHOD ME->REFRESH_TABLE_DISPLAY.( I have already checked by using this method and it worked fine)
    Here is the way my program look like
    ALVTREE1
    ALVTREE2
                 |----
    ALVGRID
    The problem is when i press the other button CONT i am unable to know what values exist in ALVGRID.
    How can i find these distributed amount in ALV?
    I hope i am clear while explaining problem.
    Here is  the required code:
      method handle_user_command.
        data: lt_fields       type table of sval,
              ls_field        type sval,
              ls_fieldcatalog type lvc_s_fcat,
              ls_merkpl       type zvhf_merkpl,
              lv_month(2)     type n ,
              lv_year(4)      type n ,
              lv_spmon        type zvhf_allocation-spmon,
              lv_value        type p.
        field-symbols: <fs> type any,
                       <ls_merkpl> type zvhf_merkpl.
        case  e_ucomm.
          when 'CNT'.
            call method gcl_gui_alv_grid->check_changed_data.
            call method dailogbox_container->set_visible
              exporting
                visible = space.
            call method gcl_gui_alv_tree2->frontend_update.
            call method gcl_gui_alv_tree2->update_calculations.
            clear: gt_merkpl.
          when 'ALCT'.
    Popup to get the values enterd by the user
            ls_field-tabname   = 'DD02V'.
            ls_field-fieldname = 'DDTEXT'.
            append ls_field to lt_fields.
            call function 'POPUP_GET_VALUES'
              exporting
                popup_title     = 'Enter value'
                start_column    = '1'
                start_row       = '1'
              tables
                fields          = lt_fields
              exceptions
                error_in_fields = 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.
            elseif sy-subrc = 0.
              read table lt_fields into ls_field index 1.
              if sy-subrc = 0.
                gv_value = ls_field-value.
    Read the table zvhf_allocation with nodekey  in order to get percentages
                select * from zvhf_allocation into table gt_allocation
                                   where dvkbur = gs_node_info-nodename.
    Read gt_merkpl in order to get existing line in ALV grid
                loop at  gt_merkpl into ls_merkpl.
    *Read FCAT inorder to find the field and move proprtinate value
                  loop at gt_fieldcatlog3 into ls_fieldcatalog.
    *Split is required to match ZVHF_ALLOCATION-SPMON  with screen text and to proprtinate the value
                    split ls_fieldcatalog-scrtext_l at '.' into
                          lv_month lv_year.
                    concatenate lv_year lv_month into lv_spmon.
    Check whether an entry exist or not in ZVHF_allocation
                    read table gt_allocation into gs_allocation
                                              with key spmon = lv_spmon binary search.
    *If an entry exist proprtinate the value as enterd in table
                    if sy-subrc = 0.
                      lv_value  = gv_value * gs_allocation-prozent.
                      lv_value = lv_value / 100.
                      perform assign_value using     ls_fieldcatalog-fieldname lv_value
                                           changing  ls_merkpl.
                      modify gt_merkpl from ls_merkpl.
                    endif.
                  endloop.
                 CALL METHOD gcl_gui_alv_grid->frontend_update.
                  call method gcl_gui_alv_grid->refresh_table_display
                    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.
                endloop.
              endif.
            endif.
        endcase.
      endmethod.                    "handle_user_command
    If you have any further questions please let me know.
    Regards,
    Lisa

    Hello Vijay,
    Thanks for you reply,
    The event data_changed is not working because i called method refresh_table_display. So the event changed will not be raised after i press button CONT
    If i didn't call this method then i can see the value enterd by the user in ALV grid.
    So, do you have an more ideas.
    Regards,
    Lisa

  • How to detect a selected row in ALV GRID

    Hi,
    Can anyone tell me how to detect and catch an event when a row is selected in an ALV GRID?
    I would like to catch such event when the end user presses Ctrl + Shif + Space bar.
    Thank you and best regards.
    Hassane.

    Hi,
    Use this wiki link, to have a checkbox with all the records in ALV Grid and to process those selected records at a user command, as per the requirement.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bcheckbox%252bto%252bprocess%252bselected%252brecords%252bat%252bruntime
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • How to know the select stmt used in creating a table?

    Hi,
    If we create a table by selecting some records form another table, can we see the select statement used to create that table.
    example: Create table emp2 as select * from emp where deptno=20;
    is there any data dictionary table which stores select * from emp where deptno=20
    Thanks in advance.
    Edited by: 805791 on Jul 28, 2012 9:01 PM

    No. The SELECT statement is not associated with the table in the data dictionary.
    If the statement was executed recently, you may find the entire CREATE TABLE in the V$SQL view. Or, if you have licensed the AWR, you may find it in the DBA_HIST_SQLTEXT view. But there is no guarantee that the query will be in either view.
    Justin
    Edited by: Justin Cave on Jul 29, 2012 3:46 AM
    Additionally, this question doesn't appear to relate to the Oracle Call Interface so it should probably have been asked in a different forum. The General Questions forum or the SQL and PL/SQL forum would have been more appropriate.

  • How to Extract the selected line in alv?

    Hi,
      I am learning ABAP and i have a doubt.It is as follows.
    In interactive reports, by clicking on a ROW we can display the line by using SY_LISEL in AT LINE_SELECTION event .
    Now i want to have a pop up window when we click on a selected row of ALV  report I want that single ROW to be displayed . How can i do this?

    Hi Ravindra,
    I think this is not possible with ALV reports because these use field catalogs unlike Interactive reports. Interactive reports only has the capability of popping up the data in the next list when clicked on row with the help of the events.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • How  to find the current item is new

    I create a item ,and diaplay "new" .so I want to know which table I can find the
    "new" identifier. if anyone konw this please contract me .my Email :[email protected]

    If you are referring to where to find the new image itself, that is in the middle tier in the images directory. You can access it by adding /images/new.gif to your base portal URL.
    If you are looking for how to add the new icon to a region, edit the region settings by clicking the pencil in the region heading and go to the attributes tab. Double-click the "new item" in the left selector box to move it to the right selector box then hit Apply and OK.
    If you are looking for the logic where it is displayed, there is a setting on the page group level that determines how many days to display the New icon. The portal then dynamically uses the modify date of the item to determine if the new icon should be rendered. You can query the item views yourself if you want to create your own New logic.
    Rgds/Mark M.

  • How to find the selection profile w.r.t plants.

    Hi,
    I have a list of 50 plants, how can i find the list of selection profile that includes these plants. Apart from going inside each and every selection profile.
    Thanks
    Aswath

    Hi Aswath,
    Make use of the badi SAPAPO/SDP _SELECTOR to get
    critical fields and tables and you can create your
    custom report to find out this information
    Regards
    R. Senthil mareeswaran.

  • How to get the selected item of a ListBox if it's contents are binded data? (Please read)

    So, I am making an application in which binds data from a WebClient to a ListBox. Thus, it is needed to understand that I did not create this data, it is from a Web API. So my goal is to be able to click on any of the items in the list box(which are binded
    from a web API) and open a pop-up to display more data binded from that specific area.
    Example:
    The data has been loaded and I click on the 2nd item, well this item is a Metallica concert located in Russia blah blah.. ok, so I press it, it opens a pop up with more info like the date, location, etc...
    Info:
    I am binding the things in the lost box from and "events" statement, and I want the data in the list box in the pop up to display the selected child item, "event".
    Zack Bowling

    So are you storing that 'more info data' along with main data(i.e. that metallica concert etc.) somewhere in a List/observableCollection/database etc, if yes then probably it can be fetched directly from that collection. 
    e.g.
    private void listBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    var Itemobj = (listboxname.SelectedItem) as ObjectClassname; string datevalue = Itemobj.date; string location = Itemobj.location;
    //so using Itemobj you can fetch the properties you want as stored in ObjectClassname.
    // Here ObjectClassname is the name of class storing the properties(setter-getter) for the parsed data.
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How to find the select statement has written all selected values into text

    Hi,
    I am using form6i. i am selecting a set of values from database tables based upon some user parameters and writing into the text file using Text_io.put_line . In this case how we can make sure that the text fille contains all the data what we are selected from selected statement. somebody told that there might be chances of aborting of data while writing into the text file. is there any way to fild out the selected statements has written all the selected fields and corresponding output into the .txt file.
    Please suggest me.

    somebody told that there might be chances of aborting of data while writing into the text fileWhat kind of "chance" does that somebody refer to?
    If you want to verify if the number of records (lines) in the file matches the number of records from the cursor, you could re-open the written file in read-mode and count the number of lines by reading one by one, then compare the number of lines with the number of records from the cursor.

Maybe you are looking for

  • How to create a Jar with only class files?

    Dear all, I want to create a jar file with only classes.My class files and java files are in different folders under com . say com in com there are two folders folder 1 -- subfolder 1 folder 2 -- subfolder 2 like this. If i want to create a jar file

  • Please Help with creating .jar's

    Ok, so I get how to make them, the commands, the manifests, etc. But for god's sake my DOS doesnt seem to have access to a jar.exe to run. I can type in: c:\some path> jar cmvf manifest.txt jarname.jar file1 file2 It keeps telling me jar is not a rec

  • Hide/show dock no longer works

    Out of the blue, the dock has gone wonky. I have always had it set to hide/show, without problems. Now mousing over the bottom of the screen doesn't bring up the dock anymore. Even CMD-OPT D doesn't make the dock show its face, so I have to leave hid

  • Manual Upgrade from Oracle 10.2.0.4 to 11.2.0.2

    we are planning oracle DB version from oracle 10.2.0.4 to 11.2.0.2 , we are doing in AIX BOX. Below is steps can some one clarify if something is missing. 1)Cold backup 2)Start the db and change it into no archivelog mode 3)shut db 4)start in Upgrade

  • Query to Distribute rows into even buckets.

    Hi Folks, requesting a SQL solution (I can't write a PL/SQL Loop). Say I have 10 rows (10 Employe Ids) in a table. I am trying to write a sql to evenly divide these 10 ids into X number of buckets. (if its an odd number then the last bucket will have