How to do choose one record in alv screen from dyn_table ?

Experts:  How to do choose one record in alv screen from <dyn_table> ?
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: V_COUNT TYPE I.
CLEAR: V_COUNT,<dyn_wa>.
LOOP AT <dyn_table> INTO <dyn_wa>. "WHERE <?????> = 'X'.  I should how to do write ?
        V_COUNT = V_COUNT + 1.
ENDLOOP.
  if not rs_selfield-tabindex eq 0 AND V_COUNT NE 0.
    IF R_UCOMM = '&CHANGE'.
      IF sy-subrc = 0.
        IF V_COUNT = 1.
          CALL SCREEN 100.
          perform dny_field_value_update.
          rs_selfield-refresh = 'X'.
        ENDIF.
      ENDIF.
    endif.
  endif.
ENDFORM. "USER_COMMAND

Anyways which version of SAP are you using ? As of SAPNW 7.0 Release 2 you can specify dynamic tokens with LOOP ... WHERE statement.
My sap product is ecc5.0. Still thanks!
Now I have solved it.
FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                         RS_SELFIELD TYPE SLIS_SELFIELD.
  DATA: V_COUNT TYPE I.
  CLEAR:  V_COUNT,<dyn_wa>,IT_TOTAL.
  SY-INDEX = rs_selfield-tabindex.   
READ TABLE <dyn_table> INTO <dyn_wa> INDEX SY-INDEX.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <DYN_WA> TO <dyn_field>.
  CONDENSE <DYN_FIELD> NO-GAPS.
  IT_TOTAL-KUNNR = <DYN_FIELD>.
  ASSIGN COMPONENT 'PLANTNO' OF STRUCTURE <DYN_WA> TO <dyn_field>.
  CONDENSE <DYN_FIELD> NO-GAPS.
  IT_TOTAL-MATNR = <DYN_FIELD>.
  ASSIGN COMPONENT 'CUSTOMERNO' OF STRUCTURE <DYN_WA> TO <dyn_field>.
   CONDENSE <DYN_FIELD> NO-GAPS.
  IT_TOTAL-CUSTOMERNO = <DYN_FIELD>.
  ASSIGN COMPONENT 'ZPERSON' OF STRUCTURE <DYN_WA> TO <dyn_field>.
  CONDENSE <DYN_FIELD> NO-GAPS.
  IT_TOTAL-ZPERSON = <DYN_FIELD>.
  IF SY-SUBRC = 0.
    "CHECK  <dyn_field> = 'X'.
    V_COUNT = V_COUNT + 1.
  ENDIF.
  if not rs_selfield-tabindex eq 0 AND V_COUNT NE 0.
    IF R_UCOMM = '&CHANGE'.
      IF sy-subrc = 0.
        IF V_COUNT = 1.
          CALL SCREEN 100.
          perform dny_field_value_update.
          rs_selfield-refresh = 'X'.
          "exit.
        ENDIF.
      ENDIF.
    endif.
  endif.
Edited by: andy1982999 on Apr 2, 2010 8:42 AM

Similar Messages

  • How we can select two records in alv report

    how we can select two records in alv report

    Hello,
    You can use the method <b>get_selected_rows</b>.
         CALL METHOD gv_alv->get_selected_rows
            IMPORTING
          ET_INDEX_ROWS =
            et_row_no     = lt_selected_rows.
    READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
    The table <b>lt_selected_rows</b> will contain all the selected rows.
    Regards,
    Beejal
    **reward if this helps

  • How do I choose one of my favorite song or album from my iphone/iTunes while I connected to my car started directly from that chossen album.Thanks

    How do I choose one of my favorite song or album from my iPhone while I connected to my car start directly from that chosen album.Thanks

    When I connect my iPhone to my car start playing from one specific song every time and I need to change it to my one of favorite songs. How should I do that?
    thanks.....

  • I am having problems because two phone numbers are on the Apple ID, how do I choose one for imessage?

    I am having problems because two phone numbers are on the Apple ID, how do I choose one for imessage?

    Hello,
    In my opinion, this is the best procedure to use to update your BB OS:
    http://supportforums.blackberry.com/t5/BlackBerry-Device-Software/How-To-Reload-Your-Operating-Syste...
    However, the official download site:
    http://us.blackberry.com/support/downloads/download_sites.jsp
    shows your installed OS to be the current version from your carrier. Therefore, how your friends got a newer OS is a question to ask them and/or your carrier.
    You are, of course, free to use (via the above procedure) any carriers OS package...if another has the newer OS you want, you can use it. If you choose to do so, then simply insert, between steps 1 and 2 in the above procedure, the deletion, on your PC, of a file named VENDOR.XML
    Good luck.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can i delete one of my 5 computers from itunes? i need to rigistre a new computer...

    How can i delete one of my 5 computers from itunes? i need to rigistre a new computer...

    1)  Open itunes on the computer you want to deactivate. Make sure you are logged in.  Under the "Store" menu, pull down top "De-authorize this computer"
    2)  If you no longer have, or access to, the computer(s) you want to deauthorise,
    Log in to iTunes,  go to "view your account info" on the itunes store,
    Deauthorise all five,
    (Please Note: this can only be done Once every 12 months)
    Then re-authorize your current Computer(s) one at a time..
    Authorise / Deauthorise About  > 
    http://support.apple.com/kb/HT1420

  • How to boot only one group in remote machine from master machine

    Hi,
    I want to know the command to boot entire remote machine from master machine and how to boot only one group for remote machine from master machine.
    Thanks
    Amit

    You can boot the entire remote machine (after booting the Master machine) as follows:
    tmboot -B <lmid of remote machine> -l <lmid of remote machine>.
    For all the available tmboot options see http://download.oracle.com/docs/cd/E18050_01/tuxedo/docs11gr1/rfcm/rfcmd.html#wp1032112
    Regards,
    Malcolm.

  • How to select only one record at a time in ALV

    Hi all,
    I have to use ALV report.  Each record on the report output should have a button (or radio button) which will allow the record to be selected.  My requirement is to select only one record at a time.
    please guide me how to proceed further.
    regards
    manish

    hi
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sampleCheckBoxProgram
    Regards
    Pavan

  • How to display only one record.

    Hi Gurus,
    Here my requirement is i have 2 pages.
    first page having project_number lov,create and tableRN.
    once u select the projectnumber and click on the create button it is navigate to secound page,here enter the data and click on the submit button it ll insert into database table and navigate to fitst page and display the data in tableRN what ever u insert the data(this part is over).
    but the problem is, in tableRN displays all the records(previous records also displayed)
    my requirement is display only one record(click on the submit button at the time of record only).
    Plz help me
    its very urgent.
    Thanks
    Seshu.
    Edited by: its urgent on Jan 3, 2012 10:52 PM

    Seshu,
    Do u want to display the inserted row...
    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com
    www.querenttech.com

  • How do I delete  one item at a time from trash?

    How does one delete one item at a time from trash?

    In general, one doesn't.
    I suggest you create a new folder (I use "Trash Soon") on the desktop near the trash icon. Move all the stuff out of the Trash bin into the Trash Soon Folder. Then move the things you really want to eliminate to the Trash can. Empty Trash.
    DO NOT store anything you want to keep in the real Trash can. There are many activities that may cause "Empty Trash" a a side-effect.
    If you have multiple drives, The Trash is an illusion created for your convenience. The actual Items may be on several different drives, but all marked as "in Trash". Moving them to a folder on a different drive may cause unexpected copying.

  • **HOW DO I DELETE ONE CALL AT A TIME FROM MY IPHONE 4???**

    Please help I can't delete one call at a time from my call log!!

    Lol! I'm not cheating on anyone, never have... I just delete multiples of calls so my phone doesn't get too filled up.. But I'm also guessing now that I have an iPhone and not an htc I won't have a space issue. Thanks very much!!

  • How to exclude certain rows in the ALV display from the total?

    Hi,
    May I know is there a way to exclude certain rows that are shown in the ALV control from the calculation of grand total?
    Thanks much.

    See, if
    function module REUSE_ALV_TRANSFER_DATA 's
    IT_EXCLUDING   .... param
    works for you.

  • How to pass a value to a standard screen from program

    My requirement is to pass a value from the program to a standard screen.
    I m using transaction CU01. i have to get the dependency name from the program and displayed in CU01 first screen, after tht i have to create a dependency.
    Set parameter Id is not working for this screen so can any one help me to pass the value to standard screen from program.
    its urgent
    Thanks in advance.

    hi,
    consider filling up t_bdcdata for the single field and passing it as
    call transaction 'CU01' using itab. as in BDC
    santhosh

  • How to insert a specific record into alv

    Hi everyone,
      here is my problem:
        I put an ALV GRID control in my screen , it display some records.
        and I create a new button on the toolbar, and in the "handle user command class" , I need to
    select a record from DB table into a work area.
        after I select the record I need, here is the key question:
          *I want to insert the record into the ALV at a specific row position which the user decided,
    what should I do?*
      METHOD HANDLE_ON_USER_COMMAND.
        CASE E_UCOMM.
          WHEN CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
          WHEN 'FC_ASSIGN'.
    ***I do some selection here  
            select %%%$$%%%^&&** into GS_HOLIDAYS.
    *** after the selection, what should I do then????
    *** I want to insert the work area GS_HOLIDAYS into ALV at a specific position
    *** e.g.  into the 3rd row.
    *** how can I achieve that????
    ***call a method or something??????I don't know    
          WHEN 'FC_DELETE'.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.
    pls don't let me go through the programs in package "SLIS",because I have already done that and
    I haven't solved my problems yet.
    Thanks for your help.

    All u need to do is on user command for inserting new records u just insert a blank record in your internal table that u are displaying with required style informaion for making it editable and then refresh alv display by method REFRESH_TABLE_DISPLAY.
    Thanks & Regards,
    Vivek Gaur

  • One of 100 records in file has error. How to reprocess only one record??

    Hi All
    I have a scenario where, i receive data in a file, and we create invoices in SAP system from the data records in the file. My file contains 100 records and if there is an error in processing record number 43, how XI can be set up to restart when there are errors?
    Re-start of file processing has to commence from the failed record. This should avoid the possibility of double posting of interface records.
    Thanks
    Chandra

    Hi Chandra,
    I am not sure,if this option is useful for you.
    But we do this for Inventory Report(INVRPT) in our case because we have the same requirement.
    We receive an EDIFACT file and a record can have errors.Then we don't want to reprocess full file again.
    In order to avoid this,we create an IDoc for each line item.
    If there is an error in one line item,this IDoc will fail and can be corrected and reprocessed later.
    Kindly let me know if this is of any use to you.
    Thanks.
    Regards,
    Shweta

  • How do I select one record when working with image data sets?

    David Powers had an example with creating spry data sets and using the filename in the database linked to images in the local files as data sources.  The pages shows the images with the specified information requested, however all of the images display with their content.  I want to pull an individual record with the image and content. HELP!
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_rs_getPhoto = 10;
    $pageNum_rs_getPhoto = 0;
    if (isset($_GET['pageNum_rs_getPhoto'])) {
      $pageNum_rs_getPhoto = $_GET['pageNum_rs_getPhoto'];
    $startRow_rs_getPhoto = $pageNum_rs_getPhoto * $maxRows_rs_getPhoto;
    mysql_select_db($database_gepps1_db, $gepps1_db);
    $query_rs_getPhoto = "SELECT last_name, first_name, personal_bio, file_name, width, height FROM mem_profile";
    $query_limit_rs_getPhoto = sprintf("%s LIMIT %d, %d", $query_rs_getPhoto, $startRow_rs_getPhoto, $maxRows_rs_getPhoto);
    $rs_getPhoto = mysql_query($query_limit_rs_getPhoto, $gepps1_db) or die(mysql_error());
    $row_rs_getPhoto = mysql_fetch_assoc($rs_getPhoto);
    if (isset($_GET['totalRows_rs_getPhoto'])) {
      $totalRows_rs_getPhoto = $_GET['totalRows_rs_getPhoto'];
    } else {
      $all_rs_getPhoto = mysql_query($query_rs_getPhoto);
      $totalRows_rs_getPhoto = mysql_num_rows($all_rs_getPhoto);
    $totalPages_rs_getPhoto = ceil($totalRows_rs_getPhoto/$maxRows_rs_getPhoto)-1;
    ?>
    <table width="800" border=" ">
      <tr>
        <td>Image</td>
        <td>thumbnail</td>
        <td>firstname</td>
        <td>lastname</td>
        <td>personal bio</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><img src="<?php echo $row_rs_getPhoto['file_name']; ?>" alt="" width="<?php echo $row_rs_getPhoto['width']; ?>" height="<?php echo $row_rs_getPhoto['height']; ?>"></td>
          <td><img src="<?php echo $row_rs_getPhoto['file_name']; ?>" alt="" width="50" height="35"></td>
          <td><?php echo $row_rs_getPhoto['first_name']; ?></td>
          <td><?php echo $row_rs_getPhoto['last_name']; ?></td>
          <td><?php echo $row_rs_getPhoto['personal_bio']; ?></td>
        </tr>
        <?php } while ($row_rs_getPhoto = mysql_fetch_assoc($rs_getPhoto)); ?>
    </table>
    <?php
    mysql_free_result($rs_getPhoto);
    ?>

    I tried pulling the record by using entered value, but then I would need to create several recordsets.
    It's actually no problem doing that.  Can you explain more what you want the final result of this page to display? You are pulling a recordset of the entire group of photos.  Do you still want that comprehensive recordset on this page?  How many other images do you want?  Are you trying to make a master/detail pair where this page displays only the details for a single image?  See what I mean?

Maybe you are looking for