Get marked row in SM30

Hi ABAP friends,
i am using a viewcluster to enable the user to insert data into two z* tables. This tables have the relationship 1:n.
They are related via an unique number that is mapped by an number range object. I have added some code at the table maintainence dialog so that the number is increased for every new dataset.
When i want to add an position to the underordered table i need to get key value exactly.
At which point can i get this value when i jump from the overview dynpro to the detailview of the head table or from the overview dynpro of the head table to the overvie dnypro of the position table.
I need only the key value of the head position tha is used to jump on the position table to fill teh fields if new entries are generated by the user.

So let me try to explain.
I am using an viewcluster. With this tool you can combine severeal table mantainence views.
On the one hand you can jump into the detail dynpro of the head position. This is necessary beacause i want to lock single dataset, while someone is working on them. Therefore i am deleting the global table lock, by calling a report over an transaction where i call the mainenace view (viewcluster) in the end. When i jump into the item table. a single row has to be marked to get the dependet entries. THis is done by sap automatically. but if i want to create new datasets i want the key field ( a unique number) to be filled automatically. You can input the key manually or can link a search help for the head table , but i want the key field of the item table to be not ready for input and befilled automatically in the background. Also i need the key to enable row level lock of the table.

Similar Messages

  • How to get selected Row Index in a table based ona  VO?

    Hi All,
    I'm writing an ADF form wherein I use a VO based on a SQL query. I'd like to know how to get the index of a selected row. I havea selection Listener in place where I can print the selected Row's data using getSelectedRowData().toString() on the table.
    How can I get certain Attributes from this selected row.
    One solution I thought of is to get the row index and then read attributes. But I cant seem to figure out how to get rowIndex for a selected row. Any sugestions?
    Using JDeveloper 11g.
    Thanks
    P.

    If your selected row is marked as current row you can use
    // Get a attribute value of the current row of iterator
    DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("testIterator");
    String attribute = (String)iterBind.getCurrentRow().getAttribute("field1");Where 'testIterator' is the name of the iterator you use for the table and 'field1' is the name of an attribute you want to get.
    Or you can iterate over the selected row keys (even if it's only one):
    // get  selected Rows of a table 2
    for (Object facesRowKey : table.getSelectedRowKeys()) {
    table.setRowKey(facesRowKey);
    Object o = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
    Row row = rowData.getRow();
    TestRow testRow = (TestRow)((DCDataRow)row).getDataProvider() ;
    }Where TestRow is the row type of the VO of your table.
    Timo

  • How to mark row in OO ALV ?

    Hi ,
    I am using OO editable ALV . Method set_table_for_first_display has been used . In the report, user can select a row /rows and click on button 'EDIT' in the toolbar . Then one pop up screen will be displayed where user can change the fields . The changed fields will be copied to original ALV output .
    In order to reflect changes in the ALV ouput , I am using method refresh_table_display  to refresh the ALV display . After refresh I am using method set_selected_rows to mark row/rows which were selected earlier but, the issue is that row/rows are not getting marked in the ALV output .
    Any suggestions to mark row/rows after using method refresh_table_display  to refresh the ALV display would be of helpful .
    Thanks in advance .

    HI,
    it should be a field in ALV data table  for select , for example CHK ( Character  len 1 ) see bellow :
    TYPES: BEGIN OF wa_out ,
        CHK   TYPE C LENGTH 1 ."MARK ROW
        INCLUDE STRUCTURE ZPP_BARCODE .
       TYPES : cellcolors TYPE lvc_t_scol ,
       SERNR TYPE objk-SERNR ,
       VORNR TYPE afru-VORNR  ,
       ROWNO TYPE i ,
       end of wa_out.
    you should update ALV data table with X or space in field CHK 
    data:
        ET_INDEX_ROWS     TYPE LVC_T_ROW ,
        ET_ROW_NO     TYPE LVC_T_ROID ,
        wa_ROW_NO     LIKE LINE OF ET_ROW_NO.
      data: w_cellcolor TYPE lvc_s_scol. "For cell color
      data:   gt_out  TYPE STANDARD TABLE OF wa_out , "ALV data table
              wa_out1 type wa_out .
    in layout table put CHK to BOX_FNAME  field
        ls_layout-edit  = ''.
        ls_layout-zebra = 'X'.
        ls_layout-CWIDTH_OPT = 'X' .
        ls_layout-BOX_FNAME = 'CHK' .
    after user select ALV rows and before process
    "-----  call GET_SELECTED_ROWS to read selected rows:
      CALL METHOD GI_GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = ET_INDEX_ROWS
          ET_ROW_NO     = ET_ROW_NO.
    "------now modify ALV table :
      LOOP AT ET_ROW_NO INTO wa_ROW_NO  .
                    WA_OUT1-chk = 'X' .
                    MODIFY   GT_out  index wa_ROW_NO-ROW_ID FROM WA_OUT1 TRANSPORTING chk  .
      ENDLOOP.
    now you can read selected rows from ALV
    loop at gt_out into  WA_OUT1 where CHK = 'X' .
    endloop.
    Regards ,
    REZA ROSTAMI / MAPNA / ABAP

  • How to handle marked rows in an ALV table

    Hi Experts,
    there is an ALV table in my Web Dynpro. It has a functionality to handle one marked row via lead selection. This is the coding to get the marked row:
    lr_nd_ma_leist = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_leist ).
    lr_el_ma_leist = lr_nd_ma_leist->get_lead_selection( ).
    idx = lr_el_ma_leist->get_index( ).
    My problem is to handle more than one marked row. I changed the contexts' properties to allow to mark more than one row. But how can I get the number and the index of all the marked rows?
    Thanks in advance,
    Tan

    use the method get_element_selected( ) and get_index( ).
    data sel type WDR_CONTEXT_ELEMENT_SET.
    sel = lo_nd_zdealer->get_selected_elements( INCLUDING_LEAD_SELECTION = abap_true ).
    data el type ref to if_wd_context_element.
    data indx type  i.
    loop at sel into el.
      indx = el->get_index( ).
      endloop.
    thanks
    sarbjeet singh

  • Getting correct row based on date

    Hi,
    if i have the following records for an account:
    now i have a date of 4-1-2013 and I want the row where either 4-1-2013 falls withing the BeginDt and EndDt OR if it does not fall within the BeginDt and EndDt, i wann the EndDt = null row.  So i should only get one row back each time, in this case I
    would get the first row back.
    thanks

    Hi,
    You can use BETWEEN statement to find rows where the date is between your date columns and you can use OR to get the second row if it's not inside the interval.
    There are other solutions, I've implemented this one:
    DECLARE @MyTable TABLE (OrgRoleNumTxt VARCHAR(20), BeginDt DATETIME, EndDt DATETIME);
    DECLARE @SearchDate DATETIME;
    INSERT INTO @MyTable
    SELECT '07238', '2013-01-01 00:00:00', '2013-06-30 23:59:59.997'
    UNION
    SELECT '07238', '2015-03-05 00:00:00', NULL
    -- Scenario #1: Returns the first record (between dates)
    SET @SearchDate = '2013-04-01';
    SELECT TOP 1 * FROM @MyTable WHERE (@SearchDate BETWEEN BeginDt AND EndDt) OR EndDt IS NULL ORDER BY BeginDt ASC;
    -- Scenario #2 (same query): Returns the second record (end date is null)
    SET @SearchDate = '2014-01-01';
    SELECT TOP 1 * FROM @MyTable WHERE (@SearchDate BETWEEN BeginDt AND EndDt) OR EndDt IS NULL ORDER BY BeginDt ASC;
    Hope this helps,
    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
    Pedro Martins
    Portugal
    https://www.linkedin.com/in/rechousa

  • Cannot get all rows from cfProcResult

    We upgraded one of our servers (A) from CF 6 to 7.02. Another
    server (B) has CF 7.01.
    On server B (CF 7.01) the code works (below), all rows of
    each dataset are returned.
    Now on server A (CF 7.02) all of the resulting datasets have
    only the first record in them. If I add maxrows="-1" to each of the
    cfProcResult tags there is no change. If I change that to
    maxrows="100" then I can get the rows up to 100.
    Is this a bug or is there a different means to return all
    rows?

    It think its a bug. I got the same results under MX 7.0.2.
    The topic of maxrows recently came up on another thread. I
    did some searching and according to TechNote 18339 there was a
    change with maxrow
    "<cfquery maxrows=N> bug. ColdFusion MX (until ColdFusion
    MX 7.0.1 CHF2) didn't pass maxrows to the underlying driver
    (statement.setMaxRows())"
    Given the results you're getting, it sounds like CF is
    applying the maxrow to all of the resultsets, not just the one
    where maxrows was declared. I suspect cfstoredproc's usage of
    statement.setMaxRows() is incorrect. Thats just a guess though.
    Bottom line, I think you'll need handle it manually.
    Personally, I would recommend placing the row count logic in the
    stored procedure (if possible). The overall results will be more
    consistent and you won't have to worry about this kind of issue
    again.
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18339
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00000314.htm
    http://www.remotesynthesis.com/blog/index.cfm/2006/3/23/Maxrows-Issue-in-CFQuery

  • Get selected row from grid

    Hi
    I use JDev 11.1 with ADF, i have grid, i need to get selected row of grid when i press buttom, how can i do that?
    Thanks

    Hi,
    You have a table in your page that is based on a viewObject iterator and you need to get the selected row in your backing bean when you click on a button.
    Did I get this right?
    If so then you need to add an actionListener on this button that executes a method in the backing bean.
    the button code:
    <af:commandButton text="commandButton 1" id="cb1"
                                        actionListener="#{myBean.buttonActionListener}"/>In this method you need to add code like this:
      public void buttonActionListener(ActionEvent actionEvent) {
        BindingContext bindingctx=BindingContext.getCurrent();
        DCBindingContainer bindings=(DCBindingContainer)bindingctx;
        DCIteratorBinding iter= bindings.findIteratorBinding("iteratorName");
        Row currentRow=iter.getCurrentRow();
      }If this is not what you need give some more details.
    Gabriel

  • How to get the rows from a table having some column has any letter

    Hi All,
    suppose i have a table having columns id(number), code(varchar).
    code has alphanumeric characters (ex. ABC123, 67B56 etc).
    some codes are only numbers (2344, 7898 etc).
    how can i get the rows which have alphabets in the code.
    ex:
    id code
    1 AB45
    2 456
    3 890
    4 67B7
    how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
    thanks in advance to all

    Thanks to one and all.
    i am gettig my required output.
    But i have a doubt in the operator.
    If i add or remove '[]' in the operator, i am getting different ouputs.
    There is a count difference in the result of the operators used.
    REGEXP_LIKE(<column>,'[[:lower:]]')
    REGEXP_LIKE(<column>,'[[[:lower:]]]')
    REGEXP_LIKE(<column>,'[:lower:]')
    Can anybody please explain what is the difference in using '[]', in the operator?
    What is the correct syntax, whether i have to use two '[]'s or one '[]'.
    Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
    Any query to get the required output in 8i version?
    Thanks in advance to all.

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to get multiple rows at one time in a table?

    hi
    I have a JTable bound with ViewObject and i use multiple selection mode setting to get selection row.
    My question is when i select more then one row at one time i only can get those index from JTable but can't get those rows from ViewObject.is it possible to get rows from ViewObject? or how to use JTable row index to get row from ViewObject?

    repost

  • How do I get Front Row to work with Lion?

    Hello fellow Mac users,
    How do I get Front Row to work with Lion? I have an iMac 27 inch computer and is the sole entertainment provider for my bedroom. I refuse to put a TV in my room and wanted to know how to get Front Row to work again on my mac? It seems that the upgrade to Lion erased the app.
    I have quite a few movies and series that I bought off iTunes and is a shame that I can't use a media center app like Front Row on Lion.

    I kind of have the opposite problem. I need to know how to turn off my remote on the computer. I am using the remote for my Apple TV and it keeps making the volume on my Computer go up and down (with annoying sounds).
    There used to be a way to un-sync the remote with the comp but I cannot remember how and the Apple help is not much help! I have Lion.
    Thanks!
    Best,
    Tony

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get first row from View Object cache.

    hi,
    I am using Jdeveloper 11.1.1.6
    can we get first row from View Object cache??
    Thanks in Advance.
    Best
    Shashidhar

    Hi Frank,
    Thanks for reply!!
    My case is:
    I have a Query based ViewObject.
    One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOV  filed the value is selected.
    when i create second row LOV value got refreshed because both are in same VO.
    I need to get the LOV value of first row and set same value to second Row.
    Shashidhar

  • XML DB: is it possible to get a row for each element in a container element?

    I have an XML document containing a container element (collection). If I query, using an XPath expression, the contained elements I get a row for each container element with the contained element concatenated. Is it possible to get a row for each contained element?
    I run this simple query:
    select extract(xmltype('<colors><color>Red</color><color>Green</color></colors>')
    , '/colors/color/text()').getstringval() from dual
    And get this result:
    EXTRACT(XMLTYPE('<COLORS><COLOR>RED</COLOR><COLOR>GREEN</COLOR></COLORS>'),'/COL
    RedGreen
    1 row selected.
    What I would like to have is:
    Red
    Green
    2 rows selected.
    Wishful thinking or possible? Many thanks!

    Sure. This is where our XMLSequence() function comes in. It allows you to treat the top-level nodes in a nodeset as if they were rows in a table when combined with the TABLE() operator. Here's an example.
    First, to make the SQL look a little cleaner, I like to define a function like this:
    create or replace function testdoc return xmltype as
    begin
      return xmltype('<colors><color>Red</color><color>Green</color></colors>');
    end;.
    To break out the nodeset of <color> elements as a table, we use the following query:
    select value(list_of_color_elements).extract('*/text()').getStringVal() as color
    from TABLE( XMLSequence( extract(testdoc(),'/colors/color'))) list_of_color_elements.
    Or, using the new-in-9.2 extractValue() operator so we don't have to remember the text() part:
    select extractValue( value(list_of_color_elements), '.') as color
    from TABLE( XMLSequence( extract( testdoc() ,'/colors/color'))) list_of_color_elements.
    Here the TABLE(XMLSequence(...)) combo produces a table of XMLType, with one XMLType object in each row of the table.
    In general, if the XMLType instance were coming from an XMLType table xmltab the query would look like this:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( value(x),'/colors/color'))) colors.
    And if the XMLType were instead in a column of XMLType named doc in a table xmltab, then we would have the syntax:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( x.doc ,'/colors/color'))) colorsOnce you get the hang of it, you'll see that the combination of TABLE(XMLSequence()) to "shred" XML nodes into rows, and XMLAgg() to aggregate fragments of XML across multiple rows back into a single document, is quite powerful.

  • How to get selected  row index  of a Table ?

    hi gurus,I'm new  to Webdynpro for abap
    I'm displaying    just Flight details in a Table  so
    how to get selected  row index  of a  Table  and need  to be display in Message manager.

    Hi,
    For getting the row index use the following code.
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA index TYPE i.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_el_node = lo_nd_node->get_lead_selection(  ).
      index = lo_el_node->get_index( ).
    node is the name of the node which is binded to the table.
    For printing the message u can use code wizard.
    Press ctrl-F7. Now Select generate message.
    IN this select the method  REPORT_SUCCESS
    In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
    Write the whole code in onLeadSelect of the table.
    Regards,
    Pankaj Aggarwal

Maybe you are looking for

  • Playback of repeats in score editor

    Is there any way to have Logic intelligently follow the repeats indicated in the score editor during playback? DP, even though the score editor *****, has a way to do this. One of the main reasons I switched to Logic was so that I wouldn't have to ex

  • Can I combine two partitions without losing data on one?

    So if I have two partitions on one hard drive can I combine them without losing the data that is on one of them?  If not, could I just do a time machine backup, combine the two partitions, and then restore the time machine backup?  Would that work?

  • CCSS-AWART

    I am looking for Data element AWART (Attendance or Absence Type) in Structure CCSS.  I need this data to be called in a Report painter.  Can someone guide as how to create this data element and populate data in it? Thanks, Balaji

  • Embedd excel in browser, use excel interface for inputing values.

    Embed excel sheet in browser and give application same functionality as excel sheet gives. We can use the excel sheet for input and able to update the values in database. Please provides the solution as how to do it. Is there any reply...........

  • My website won't load properly in FF but will in IE - tried solutions - didn't work

    I have 2 websites (1 cloned from the other) that both worked well in FF - until about a month ago. www.drydiapersplus.ca (landing page now loading properly in FF - but loads properly in IE) and www.drydiapersplus.com (loads properly) When I try & ope