ALV GRID Problem when delete key is pressed from keyboard

I have created a ALV Grid using cl_gui_alv_grid class
I this I made one field editable based on some conditions
and used SEL_MODE as 'A' ( i tried 'D' too) in the LAYOUT Settings
When I select the records and press the DELETE key from keyboard
the records are getting deleted, and i am not able to catch this action
in the debug mode
(FYI: I have written my own set of code for delete row in the USER COMMAND EVENT which is not getting triggered in this case )
Can any body help me with this

have you used this to trigger the event
SET HANDLER W_EVENT_RECEIVER->HANDLE_USER_COMMAND FOR W_GRID

Similar Messages

  • Hashtable containsKey() problem when String key is read from a file - HELP

    I'll try to be brief:
    I open a .txt file of Unicode encoding (not ANSI) in order to fetch some info.
    After I manipulate each line with splits etc I use a String as a key to a Hashtable.
    The problem is that later inside my code, I try to check wether this key (and hence its corresponded value) exists and I get a false value from the containsKey() method.
    and here's the code (I have embedded some comments //-type that address to this thread):
    FileInputStream fis = new FileInputStream(initFilename);
    InputStreamReader isr = new InputStreamReader(fis, "UTF-16");
    BufferedReader br = new BufferedReader(isr);
    lineText = loadSubiPhraseFilter(br);
    //In the loadSubiPhraseFilter method
    //parsing an input like this:
    //δόξα τώ Θεώ,1:1,2:2
    //Yeah, I know, its all greek to you ;)
    //Thus we first split the line with ','
    //we split the first token with ' ' and each one of the N words,
    //serves as an index in a N-dimension hashtable
    //This is achieved implicitly by adding another hashtable as a value to a String key etc...
    //When all words are added, the hashtable which contains the last word is used
    //to put another hashtable whose only key is the String "Index"
    //which points to the rest of the data. The thing is, I never get that far...
    //I dont get to even get a positive containsKey() when giving an inserted key at a later time
    //here's the loading procedure
    while((lineText = br.readLine()) != null && (lineText.charAt(0) != '#'))
         String [] info = lineText.split("[,]");
         /*Load subi indeces in a vector*/
         Integer [][] subiIndex = new Integer [info.length-1][2];// = new Vector<Integer>();
         for(int i = 1; i < info.length; i += 1)
              //load subiIndex here...
         /*Then fetch phrase to be modified and load its 'n' words in an n-dimesion hash which will utterly point to the subi indeces*/
         /*Starting from the last word, we  put the index vector*/
         String [] word = info[0].split("[ ']+");
         Hashtable<String, Object> nextWord = new Hashtable<String, Object>();
         nextWord.put("Index", subiIndex);
         /*Then we create a chain of hash dimensions corresponding to phrase words*/
         for(int i = word.length-1; i >= 0; i -=1)
              Hashtable<String, Object> prevWord = new Hashtable<String, Object>();
              //Yeah, I even tried the .trim() method...
              prevWord.put(word.trim(), nextWord);
              nextWord = prevWord;
              System.out.print(word[i] + "<-");
         /*We update the hash head and also add the first word with its first letter capitalized as key pointing to the same next key in hash dimension chain*/
         subiPhraseFilter = nextWord;
         subiPhraseFilter.put((capitalMap.get(word[0].charAt(0))+word[0].substring(1)).trim(), subiPhraseFilter.get(word[0]));
         //The following debbuging print outs work just fine. Its only just later when I cant get a containsKey()...
         System.out.println("|| "+subiPhraseFilter);
         System.out.println("subiPhraseFilter.containsKey("+word[0]+"): "+subiPhraseFilter.containsKey(word[0]));
    //Then the following code is executed
    Integer [][] subiPhraseIndeces(String word1, String word2, String word3)
         String [] tmp = {word1, word2, word3};
         Hashtable<String, Object> dimension = subiPhraseFilter;
         //The following debbuging print out does NOT return true
         //even when I explicitly give a String key which I know it is inserted
         System.out.println("subiPhraseFilter.containsKey(" + tmp[0] + "): " + subiPhraseFilter.containsKey("&#949;&#957;&#955;&#972;&#947;&#969;".trim()));
         for(int i = 0; (i < tmp.length) && (tmp[i] != null) && dimension.containsKey(tmp[i]); i += 1)
              //This is NEVER executed...
              System.out.println(i + ": dimension.containsKey(" + tmp[i].trim() + ")");
              dimension = (Hashtable<String, Object>)dimension.get(tmp[i].trim());
              return (Integer [][])dimension.get("Index");
    Whats most irritating is that this also happens arbitrarily in another place of my code where I load again info by using each line as a key to another Hashtable and, the containsKey() method returns true to all but one (!) line-words, even if I change its position in the file. I won't put the latter code here because its just very simple. (in case I wasnt clear I read a section of a file that looks like
    wordA
    wordB
    wordC
    wordN
    each wordX is put as a key to a Boolean value and yet, containsKey(wordA) returns false even if i change the input file to
    wordB
    wordA
    wordC
    wordN
    isn't that just peculiar?
    A significant note in this problem is that I do not read english characters, rather than greek (hence the unicode filetype) which I put as keys to the hashtable; later I try to get corresponded values by fetching text (which I also manipulate) from a JTextfield, as key, and I'm afraid that maybe something is happening there.
    However the code sample I added above didnt work even when I added an english word in the file and explicitly asked wether it is contained as a key...
    Maybe I am doing something I really can't see right now...
    Help would be appreciated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    BalusC: "I would also not be surprised if that file is after all actually just UTF-8"
    No, it's not cause I explictly saved the .txt file as Unicode in wordpad and NOT as UTF-8. By the way notepad has ANSI as its default save-type.
    However I converted my input files to UTF-8 and read them using the "UTF-8" String flag in the constructor of the reader I was using. All the same.
    EDIT: Not to metion, the UTF-8 file needed an empty line at the beggining or my parsing would skip the first line, messing everything up!
    Just for the sake of it I will show the output of my program (redirected to a file cause cmd.exe does not support greek letters, or I didnt find a way to make it so):
    (This is the output when I load from the UTF-8 file the word "&#949;&#957;&#955;&#972;&#947;&#969;" in my has as a key (pointing to a Boolean i think - it doesnt really matter). What I print is the key of each dimension of the hash -here there's only one dimension- and then I print the hash reference, i.e like a toString() representation. The result shows that the Hashtable contains at key "&#949;&#957;&#955;&#972;&#947;&#969;" a value which is another Hashtable which contains the key "Index" pointing to something you shouldnt care. The hash head also contains the key "&#917;&#957;&#955;&#972;&#947;&#969;", which is actually the same as before only to have its first letter capitalized, which in turn points to a hash with one key etc...)
    &#949;&#957;&#955;&#972;&#947;&#969;<-|| {&#949;&#957;&#955;&#972;&#947;&#969;={Index=[[Ljava.lang.Integer;@360be0}, &#917;&#957;&#955;&#972;&#947;&#969;={Index=[[Ljava.lang.Integer;@360be0}}
    subiPhraseFilter.containsKey(&#949;&#957;&#955;&#972;&#947;&#969;): true
    (And later on I get a string from a JTextField I tokenize it and here's what I get when I reach the same word:)
    (Don't mind "Checking: ..." its 'cause I check a window of three words in order to reach up to a 3-dimension hash key. Yet I dont even get the first key!)
    Current token: '&#949;&#957;&#955;&#972;&#947;&#969;'
    Checking: &#949;&#957;&#955;&#972;&#947;&#969;, null, null
    subiPhraseFilter.containsKey(&#949;&#957;&#955;&#972;&#947;&#969;): false
    Now isn't that making one crazy?
    Any other ideas?
    Thnak you in advance!
    P.S. In case that I haven't done something really stupid which is ommitted here and yet can't be tracked, I think the problem must be somewhere between the encoding of JTextField and the encoding I read...
    P.S.2 Excuse me for saying hash instead of Hashtable sometimes in the above text
    Edited by: M.M. on Sep 2, 2009 3:22 AM
    Edited by: M.M. on Sep 2, 2009 3:23 AM

  • T420 - delete key gets pressed when screen/lid is closed

    Anyone run into this?
    I work at a large company and so far we have recieved a bunch of laptops where the delete key gets pressed if the lid is closed.
    I have tried replacing the KB but issue persists.
    Upon closer investigation, the DEL key does seem a bit raised when compared to other keys on the KB.

    ColonelONeill wrote:
    Strange, the DEL key is level for me.
    Have you updated your BIOS and drivers? I believe there was a change made where the keyboard will be deactivated when the lid is closed.
    Problem: On the listed ThinkPad systems, the delete key might be pressed and activated when the LCD is closed and the system is held tightly when carried..
    Affected Systems: ThinkPad T420, T420i, T420s, T520, W520, X220, X220t.
    Solution: Please update the BIOS to the version listed below, or newer. The BIOS can be downloaded from:
    T420/T420 (ver. 1.33): http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77071 .
    T420s/T420si (ver. 1.29): http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77010
    T520/T520i (ver. 1.32): http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77001
    W520 (ver. 1.30): http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77033
    X220/X220i/X220T (ver. 1.22) http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77150:
    As noted previsouly in another post, if the wireless antenna wires are not routed neatly underneath, the keyboard will stick up just enough for the screen to press on those keys.

  • Default button being clicked multiple times when enter key is pressed

    Hello,
    There seems to be a strange difference in how the default button behaves in JRE 1.4.X versus 1.3.X.
    In 1.3.X, when the enter key was pressed, the default button would be "pressed down" when the key was pressed, but wouldn't be fully clicked until the enter key was released. This means that only one event would be fired, even if the enter key was held down for a long time.
    In 1.4.X however, if the enter key is pressed and held for more than a second, then the default button is clicked multiple times until the enter key is released.
    Consider the following code (which is just a dialog with a button on it):
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(jButton1);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    new SimpleDialog().show();
    When you compile and run this code under 1.3.1, and hold the enter key down for 10 seconds, you will only see one print line statement.
    However, if you compile and run this code under 1.4.1, and then hold the enter key down for 10 seconds, you will see about 100 print line statements.
    Is this a bug in 1.4.X or was this desired functionality (e.g. was it fixing some other bug)?
    Does anyone know how I can make it behave the "old way" (when the default button was only clicked once)?
    Thanks in advance if you have any advice.
    Dave

    Hello all,
    I think I have found a solution. The behaviour of the how the default button is triggered is contained withing the RootPaneUI. So, if I override the default RootPaneUI used by the UIDefaults with my own RootPaneUI, I can define that behaviour for myself.
    Here is my simple dialog with a button and a textfield (when the focus is NOT on the button, and the enter key is pressed, I don't want the actionPerformed method to be called until the enter key is released):
    package focustests;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(new JTextField("a text field"), BorderLayout.NORTH);
    this.getContentPane().add(jButton1, BorderLayout.SOUTH);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    javax.swing.UIManager.getDefaults().put("RootPaneUI", "focustests.MyRootPaneUI");
    new SimpleDialog().show();
    and the MyRootPaneUI class controls the behaviour for how the default button is handled:
    package focustests;
    import javax.swing.*;
    * Since we are using the Windows look and feel in our product, we should extend from the
    * Windows laf RootPaneUI
    public class MyRootPaneUI extends com.sun.java.swing.plaf.windows.WindowsRootPaneUI
    private final static MyRootPaneUI myRootPaneUI = new MyRootPaneUI();
    public static javax.swing.plaf.ComponentUI createUI(JComponent c) {
    return myRootPaneUI;
    protected void installKeyboardActions(JRootPane root) {
    super.installKeyboardActions(root);
    InputMap km = SwingUtilities.getUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (km == null) {
    km = new javax.swing.plaf.InputMapUIResource();
    SwingUtilities.replaceUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW, km);
    //when the Enter key is pressed (with no modifiers), trigger a "pressed" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, false), "pressed");
    //when the Enter key is released (with no modifiers), trigger a "release" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, true), "released");
    ActionMap am = SwingUtilities.getUIActionMap(root);
    if (am == null) {
    am = new javax.swing.plaf.ActionMapUIResource();
    SwingUtilities.replaceUIActionMap(root, am);
    am.put("press", new HoldDefaultButtonAction(root, true));
    am.put("release", new HoldDefaultButtonAction(root, false));
    * This is a copy of the static nested class DefaultAction which was
    * contained in the JRootPane class in Java 1.3.1. Since we are
    * using Java 1.4.1, and we don't like the way the new JRE handles
    * the default button, we will replace it with the old (1.3.1) way of
    * doing things.
    static class HoldDefaultButtonAction extends AbstractAction {
    JRootPane root;
    boolean press;
    HoldDefaultButtonAction(JRootPane root, boolean press) {
    this.root = root;
    this.press = press;
    public void actionPerformed(java.awt.event.ActionEvent e) {
    JButton owner = root.getDefaultButton();
    if (owner != null && SwingUtilities.getRootPane(owner) == root) {
    ButtonModel model = owner.getModel();
    if (press) {
    model.setArmed(true);
    model.setPressed(true);
    } else {
    model.setPressed(false);
    public boolean isEnabled() {
    JButton owner = root.getDefaultButton();
    return (owner != null && owner.getModel().isEnabled());
    This seems to work. Does anyone have any comments on this solution?
    Tjacobs, I still don't see how adding a key listeners or overriding the processKeyEvent method on my button would help. The button won't receive the key event unless the focus is on the button. There is no method "enableEvents(...)" in the AWTEventMulticaster. Perhaps you have some code examples? Thanks anyway for your help.
    Dave

  • I bought this very nice iMac. The first time I ever use a Apple product. Can someone please tell me where the delete key is on the keyboard. I cannot think for one moment that Apple did not provide for such a key. Please help.

    I bought this very nice iMac. The first time I ever use a Apple product. Can someone please tell me where the delete key is on the keyboard. I cannot think for one moment that Apple did not provide for such a key. Please help.

    The delete key does a backward delete because it is the natural way to delete while typing. May not be to you and the millions of youngsters who grew up with windows computers. When you are typing and want to delete that which you just typed you are already at the end and you delete back to where you want to re-type. When you go back to a document and want to delete a selection, you have to go to the end of the selection instead of the beginning. it's just the way its always been done on macs. it takes some getting use to.
    If you select text to be deleted with your mouse then the delete key deletes the selected text. same for either delete key method.
    It is not convenient when you tab to fields in a form. That why fn-delete does a forward delete.
    Macs have a couple of keyboards. The small "wireless keyboard" only has the (backward) delete (fn-delete forward). The larger "Apple Keyboard with Numeric Keypad" has both a Delete (backwards) key beside the = abd it has the "delete >" key in the groups with fn, home, end, Pg up and Pg dn. This keyboard is best for users who have switched from windows or are familiar with the windows forward delete.

  • Has anyone noticed how easy it is to read a passcode that lights up with each key you press from across a room? Is there a way to stop keypad from lighting up on iPhone 4S, iOS 7?

    Has anyone noticed how easy it is to read a passcode that lights up with each key you press from across a room? Is there a way to stop keypad from lighting up on iPhone 4S, iOS 7.0.3?

    Has anyone noticed how easy it is to read a passcode that lights up with each key you press from across a room? Is there a way to stop keypad from lighting up on iPhone 4S, iOS 7.0.3?

  • How do I check if the ctrl key is pressed from within a mouseReleased actio

    How do I check if the ctrl key is pressed from within a mouseReleased action?
          addMouseListener( new MouseAdapter() {
             public void mouseReleased( final MouseEvent e ) {
               // If ctrl button is held down and mouse is clicked, do something
             }};

    Found it, I think
        e.isControlDown()

  • HT4623 i had a problem when i update iphone 3gs from ios 5.1.1 to 6.1. How could i fix it?

    i had a problem when i update iphone 3gs from ios 5.1.1 to 6.1. How could i fix it?. I can active my phone?help me, please!

    Well we need to know what your problem is if you want someone to offer a solution for you

  • I have problem when transferring book (PDF/Epub) from Computer to iPad with the new iTune? Please Help....

    I have problem when transferring book (PDF/Epub) from Computer to iPad with the new iTune? Please Help....

    With iTunes 11 you can enable the left-hand sidebar via control-S on a PC, option-command-S on a Mac. If you are trying to get it to the iBooks app then with the sidebar enabled the process should be similar to how it was on previous versions of iTunes e.g. add it to your iTunes library via File > Add To Library, connect the iPad and select it on the left-hand sidebar, and then use the Books tab on the right-hand side to select and sync it to the iBooks app.

  • I have a problem, when I execute an mapping from Desing Center, its frezeen

    I have a problem, when I execute an mapping from Desing Center, its frezeen, this doesnt send error can you help me plis
    Ali

    If I would be you, I will check mapping activity from backend using (TOAD/SESSION-BROWSER) your map should be under JDBC THIN CLIENT. Also check if your target table is locked by running this query (select
    c.owner,
    c.object_name,
    c.object_type,
    b.sid,
    b.serial#,
    b.status,
    b.osuser,
    b.machine
    from
    v$locked_object a ,
    v$session b,
    dba_objects c
    where
    b.sid = a.session_id
    and
    a.object_id = c.object_id;).

  • Popup instead of list when using WD4A ALV Grid Drop Down By Key

    I am develop a WD4A application and I am using an ALV grid.  I have set the cell editor for one column wiht the following code:
    CREATE OBJECT lr_ddbk
        EXPORTING
          SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
      Data: lv_key_visable TYPE abap_bool,
            lv_key_visible_fieldname TYPE string.
       lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
    *  lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
    *  lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
    *  lr_ddbk->SET_KEY_VISIBLE( abap_false ).
      lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
    This code works fine.  I then fill the drop down with the following code:
    *...Build the currency drop down list
      DATA lv_default_currency TYPE wdr_context_attr_value.
      DATA lv_currency_count TYPE STRING.
      DATA ls_tcurt TYPE tcurt.
      CLEAR ls_contextvalue_set.
      CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
      CLEAR lv_default_currency.
      loop at it_ac_attr into ls_ac_attr.
        if ls_ac_attr-attr_id eq 'CUR'.
          select single * from tcurt into ls_tcurt
               Where spras = 'EN' AND
                     waers = ls_ac_attr-value.
          If sy-subrc = 0.
            ls_contextvalue_set-value = ls_ac_attr-value.
         ls_contextvalue_set-value = ls_ac_attr-value.
            ls_contextvalue_set-text = ls_tcurt-ktext.
            IF ls_ac_attr-DFT_FLAG = 'X'.
              lv_default_currency = ls_contextvalue_set.
            ENDIF.
            append ls_contextvalue_set to lt_contextvalue_set.
          endif.
        Endif.
      endloop.
      lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
      lo_nd_zebuy_describe_item_info->set_attribute_value_set(
                                    exporting
                                       name = 'ZCURRENCY'
                                      value_set = lt_contextvalue_set ).
    *...End build currency drop down list
    This code works fine.  The issue I am having is that the drop down is behaving like a search help field rather than a drop down list.  Meaning a popup comes when I drop down the list.  The popup has the values I have set.  I don't want a popup I want a drop down list.  Additionallly the field is editable (meaning I can type a value into the field as well as select a value).  I want the user to only be able to select values from the list.  Any help with this issue would be appreciated.

    I fugured out what I was doing wrong.  I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.

  • Color a specific row in ALV GRID display when user clicks on that row

    hi
    i have the entire code ready of how to check the line selected by the user and also to color that line but after settings those parameters
    for to refresh the GRID so that the row apppears coloured .plz reply soon.... points will be awarded.....
    wat i have done is
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                 = i_repid
       i_callback_user_command           = 'USER_COMMAND'
       is_layout                         = it_layout
       it_fieldcat                       = int_fieldcat
      TABLES
           t_outtab                          = int
      EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2.
    to display the GRID then when user clicks on any row this module gets called
       FORM user_command USING r_ucomm TYPE sy-ucomm
                               rs_selfield TYPE slis_selfield.
         READ TABLE int INDEX rs_selfield-tabindex.
         int-rowcolor = 'C410'.
         MODIFY  int INDEX rs_selfield-tabindex TRANSPORTING rowcolor.
         it_layout-info_fieldname = 'ROWCOLOR'.
    then  again i call 'REUSE_ALV_GRID_DISPLAY'
    to display the GRID with the user selected line colored . the problem with this is when u go back from this screen u go to the previously displayed grid ....... whihc i dont want .....
       ENDFORM.                    "user_command

    Hi,
    By using following code,you can set the colors for each row,
    Change this based on your requirement.
    TABLES VBAK.
    TYPE-POOLS SLIS.
    Data Declaration
    TYPES: BEGIN OF T_VBAK,
          VBELN TYPE VBAK-VBELN,
          ERDAT TYPE VBAK-ERDAT,
          ERNAM TYPE VBAK-ERNAM,
          AUDAT TYPE VBAK-AUDAT,
          VBTYP TYPE VBAK-VBTYP,
          NETWR TYPE VBAK-NETWR,
          VKORG TYPE VBAK-VKORG,
          VKGRP TYPE VBAK-VKGRP,
          LINE_COLOR(4) TYPE C,
          END OF T_VBAK.
    DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
          WA_VBAK TYPE T_VBAK.
    ALV Data Declaration
    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GD_REPID TYPE SY-REPID.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BLD_FLDCAT.
    PERFORM BLD_LAYOUT.
    PERFORM DISPLAY_ALV_REPORT.
    Build Field Catalog for ALV Report
    FORM BLD_FLDCAT.
    FLDCAT-FIELDNAME = 'VBELN'.
    FLDCAT-SELTEXT_M = 'Sales Document'.
    FLDCAT-COL_POS = 0.
    *FLDCAT-EMPHASIZE = 'C411'.
    FLDCAT-OUTPUTLEN = 20.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERDAT'.
    FLDCAT-SELTEXT_L = 'Record Date created'.
    FLDCAT-COL_POS = 1.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERNAM'.
    FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'AUDAT'.
    FLDCAT-SELTEXT_M = 'Document Date'.
    FLDCAT-COL_POS = 3.
    FLDCAT-EMPHASIZE = 'C110'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VBTYP'.
    FLDCAT-SELTEXT_L = 'SD Document category'.
    FLDCAT-COL_POS = 4.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'NETWR'.
    FLDCAT-SELTEXT_L = 'Net Value of the SO in Document Currency'.
    FLDCAT-COL_POS = 5.
    FLDCAT-OUTPUTLEN = 60.
    FLDCAT-DO_SUM = 'X'.
    FLDCAT-DATATYPE = 'CURR'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKORG'.
    FLDCAT-SELTEXT_L = 'Sales Organization'.
    FLDCAT-COL_POS = 6.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKGRP'.
    FLDCAT-SELTEXT_M = 'Sales Group'.
    FLDCAT-COL_POS = 7.
    FLDCAT-EMPHASIZE = 'C801'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    ENDFORM.
    Build Layout for ALV Grid Report
    FORM BLD_LAYOUT.
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
    GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    GD_LAYOUT-CONFIRMATION_PROMPT = 'X'.  “ This asks the confirmation before leaving the screen.
    ENDFORM.
    Display report using ALV grid
    FORM DISPLAY_ALV_REPORT.
    GD_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = GD_REPID
       IS_LAYOUT                         = GD_LAYOUT
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       I_GRID_TITLE                      = 'SALES DOCUMENT HEADER'
       IT_FIELDCAT                       = FLDCAT[]
       I_SAVE                            = 'X'
      TABLES
        T_OUTTAB                          = IT_VBAK
    EXCEPTIONS
       PROGRAM_ERROR                     = 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.
    ENDFORM.
    Retrieve data from VBAK table and populate itab IT_VBAK
    FORM DATA_RETRIEVAL.
    DATA LD_COLOR(1) TYPE C.
    SELECT VBELN ERDAT ERNAM AUDAT VBTYP NETWR VKORG
    UP TO 20 ROWS
    FROM VBAK
    INTO TABLE IT_VBAK.
    LOOP AT IT_VBAK INTO WA_VBAK.
    LD_COLOR = LD_COLOR + 1.
    IF LD_COLOR = 8.
      LD_COLOR = 1.
    ENDIF.
    CONCATENATE 'C' LD_COLOR '10' INTO WA_VBAK-LINE_COLOR.
    MODIFY IT_VBAK FROM WA_VBAK.
    ENDLOOP.
    ENDFORM.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          W_HEADER TYPE SLIS_LISTHEADER.
    W_HEADER-TYP = 'H'.
    W_HEADER-INFO = 'WELCOME HEADER LIST'.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'REPORT:'.
    W_HEADER-INFO = SY-REPID.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'DATE:'.
    CONCATENATE SY-DATUM6(2) ' / ' SY-DATUM4(2) ' / ' SY-DATUM(4) INTO W_HEADER-INFO.
    APPEND W_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER
    ENDFORM.
    Reward points,if it is useful.
    Thanks,
    chandu.

  • ALV GRID Problem with reading contents

    Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code.
    1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'.
    'zbc_dan_registry' has 2 columns: name, value.
    zbc_dan_category' has 1 column: category.
    Now I want to have an ALV Grid, that displays the contents of 'zbc_dan_registry' and one additional column with dropdown fields, where the user can select a category for each row. This is, what my code already does.
    Now I want to save the contents of the whole table in a new table 'zbc_dan_registrz' (you see: 'registrz', not 'registry'!) with 3 columns:
    name, category, value.
    My problem is, how can I read the contents of the ALV Grid, with the user selected category for each row, and save them in an internal table? I've tried to adapt the code of "BCALV_EDIT_04", but I don't get it running.
    Some detailled help would be great, you know, I'm really working hard to understand ABAP, but it's really hard for me. Thanks for your support and help!!
    Here's my code so far:
    *& Report  ZBC400_DAN_TESTNO4
    REPORT  ZBC400_DAN_TESTNO4.
    DATA: lt_registrz TYPE TABLE OF zbc_dan_regstrz WITH HEADER LINE,
          lt_category TYPE TABLE OF zbc_dan_category WITH HEADER LINE,
          ls_category TYPE zbc_dan_category, "Struktur Kategorie
          ok_code LIKE sy-ucomm,
          container_r TYPE REF TO cl_gui_custom_container,
          grid_r TYPE REF TO cl_gui_alv_grid,
          gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_REG',
          fieldcat_r TYPE lvc_t_fcat,
          layout_r TYPE lvc_s_layo,
          lt_ddval TYPE lvc_t_drop,
          ls_ddval TYPE lvc_s_drop,
          c TYPE i.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
      DATA g_verifier TYPE REF TO lcl_event_receiver.
      DATA: BEGIN OF gt_outtab OCCURS 0.
        INCLUDE STRUCTURE zbc_dan_regstrz.
        DATA: celltab TYPE lvc_t_styl.
      DATA: END OF gt_outtab.
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
      TYPES: BEGIN OF lt_registrz_key.         "Struktur mit den Schlüsseln der Tabelle 'Registry'
        TYPES:  name TYPE zbc_dan_name,
                value TYPE zbc_dan_value,
                category TYPE zbc_dan_cat.
      TYPES: END OF lt_registrz_key.
      TYPES:  ls_registrz_keys TYPE STANDARD TABLE OF lt_registrz_key,
              ls_registrz_table TYPE STANDARD TABLE OF zbc_dan_regstrz.
      METHODS: get_inserted_rows EXPORTING inserted_rows TYPE ls_registrz_keys.
      METHODS: refresh_delta_tables.
      METHODS: handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
    *  METHODS: get_inserted_rows EXPORTING inserted_rows TYPE registrz_keys.
    *  METHODS: refresh_delta_tables.
      PRIVATE SECTION.
      DATA: inserted_rows TYPE ls_registrz_keys.
      DATA: error_in_data TYPE c.
      METHODS: get_cell_values IMPORTING row_id TYPE int4 pr_data_changed TYPE REF TO cl_alv_changed_data_protocol EXPORTING key TYPE lt_registrz_key.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed.
        DATA: ls_good TYPE lvc_s_modi,
              ls_new TYPE lvc_s_moce.
        error_in_data = space.
        IF error_in_data = 'X'.
          CALL METHOD er_data_changed->display_protocol.
        ENDIF.
      ENDMETHOD.
      METHOD get_cell_values.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'NAME'
            IMPORTING e_value = key-name.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'VALUE'
            IMPORTING e_value = key-value.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'CATEGORY'
            IMPORTING e_value = key-category.
      ENDMETHOD.
      METHOD get_inserted_rows.
        inserted_rows = me->inserted_rows.
      ENDMETHOD.
      METHOD refresh_delta_tables.
        clear me->inserted_rows[].
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
        SELECT client name value
          INTO CORRESPONDING FIELDS OF TABLE lt_registrz FROM zbc_dan_regstry.
        SELECT category INTO CORRESPONDING FIELDS OF TABLE lt_category FROM zbc_dan_category.
    CALL SCREEN 0100.
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          SET SCREEN 0.
          MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.
    MODULE clear_ok_code OUTPUT.
      CLEAR ok_code.
    ENDMODULE.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'DYNPRO100'.
      SET TITLEBAR 'D0100'.
    ENDMODULE.
    MODULE display_alv OUTPUT.
      PERFORM display_alv.
    ENDMODULE.
    FORM display_alv.
    IF grid_r IS INITIAL.
    *----Creating custom container instance
      CREATE OBJECT container_r
      EXPORTING
        container_name = gc_custom_control_name
      EXCEPTIONS
        cntl_error = 1
        cntl_system_error = 2
        create_error = 3
        lifetime_error = 4
        lifetime_dynpro_dynpro_link = 5
        others = 6.
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
    *----Creating ALV Grid instance
        CREATE OBJECT grid_r
        EXPORTING
          i_parent = container_r
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init = 2
          error_cntl_link = 3
          error_dp_create = 4
          others = 5.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
          CREATE OBJECT g_verifier.
          SET HANDLER g_verifier->handle_data_changed FOR grid_r.
    *----Preparing field catalog.
          PERFORM prepare_field_catalog CHANGING fieldcat_r.
    *----Preparing layout structure
          PERFORM prepare_layout CHANGING layout_r.
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
          CALL METHOD grid_r->set_table_for_first_display
          EXPORTING
    * I_BUFFER_ACTIVE =
    * I_CONSISTENCY_CHECK =
    * I_STRUCTURE_NAME =
    * IS_VARIANT =
    * I_SAVE =
    * I_DEFAULT = 'X'
            is_layout = layout_r
    * IS_PRINT =
    * IT_SPECIAL_GROUPS =
    * IT_TOOLBAR_EXCLUDING =
    * IT_HYPERLINK =
          CHANGING
            it_outtab = lt_registrz[]
            it_fieldcatalog = fieldcat_r
    * IT_SORT =
    * IT_FILTER =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error = 2
            too_many_lines = 3
            OTHERS = 4.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
          ELSE.
            CALL METHOD grid_r->refresh_table_display
    * EXPORTING
    * IS_STABLE =
    * I_SOFT_REFRESH =
          EXCEPTIONS
            finished = 1
            OTHERS = 2.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
        ENDIF.
        CALL METHOD grid_r->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD grid_r->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    ENDFORM.
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        i_structure_name = 'ZBC_DAN_REGSTR2'
      CHANGING
        ct_fieldcat = pt_fieldcat[]
      EXCEPTIONS
        inconsistent_interface = 1
        program_error = 2
        OTHERS = 3.
      IF sy-subrc <> 0.
    *--Exception handling
      ENDIF.
      LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'NAME'.
            ls_fcat-coltext = 'Name'.
            ls_fcat-outputlen = '40'.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'VALUE'.
            ls_fcat-coltext = 'Wert'.
            ls_fcat-outputlen = '30'.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'CATEGORY'.
              LOOP AT lt_category into ls_category.
                ls_ddval-handle = 1.
                ls_ddval-value = ls_category-category.
    *            ls_ddval-style = cl_gui_alv_grid=>mc_style_enabled.
                APPEND ls_ddval TO lt_ddval.
             ENDLOOP.
             CALL METHOD grid_r->set_drop_down_table
                EXPORTING it_drop_down = lt_ddval.
            ls_fcat-edit = 'X'.
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-coltext = 'Kategorie'.
            MODIFY pt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
    FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
      ps_layout-zebra = 'X'.
      ps_layout-grid_title = 'Kategorie zur Registry hinzufügen'.
      ps_layout-smalltitle = 'X'.
    ENDFORM.
    FORM save_data.
      DATA: ls_ins_keys TYPE g_verifier->ls_registrz_keys,
            ls_ins_key TYPE g_verifier->lt_registrz_key,
            ls_registrz TYPE zbc_dan_regstrz,
            ls_outtab LIKE LINE OF gt_outtab,
            lt_instab TYPE TABLE OF zbc_dan_regstrz.
      CALL METHOD g_verifier->get_inserted_rows IMPORTING inserted_rows = ls_ins_keys.
      LOOP AT ls_ins_keys INTO ls_ins_key.
        READ TABLE gt_outtab INTO ls_outtab
        WITH KEY  name = ls_ins_key-name
                  value = ls_ins_key-value
                  category = ls_ins_key-category.
        IF sy-subrc = 0.
          MOVE-CORRESPONDING ls_outtab TO ls_registrz.
          APPEND ls_registrz TO lt_instab.
        ENDIF.
      ENDLOOP.
      INSERT zbc_dan_regstrz FROM TABLE lt_instab.
      CALL METHOD g_verifier->refresh_delta_tables.
      ENDFORM.

    Hi Hans,
    You raised the Question in the Webdynpro ABAP forum. Here its very diffcult to get the answer from this forum. Please close it here and raise the same question in ABAP General Forum there you will get faster and so many anwsers.
    Please close the question here.
    Warm Regards,
    Vijay

  • Strange items deletion in various applications as if the Delete key being pressed.

    I work with a T420 laptop docked in a docking station.
    The following strange phenomenon is happaning:
    Occasionally, Items are being deleted or attempt to be deleted in various applications as if the Delete key is being pressed constantly.
    Examples:
    1. The Outlook window is open, left mouse click on the Inbox folder results in all emails being deleted.
    2. Explorer window is open, left mouse click on one of the files or folder results in attemp to delete the file or folder. Clicking 'NO' results in an endless loop of attempt to delete.
    3. Google window is open (IE), clicking on one of the letters in the search box, results in this letter being deleted.
    4. Open Task manager, results in attempt to delete the first task in row.
    When docked out the laptop from its station, this strange behavior stopped.
    Needles to say, that I replaced the external keyboard and the docking station itself, but it did not help.
    HAS ANYONE ENCOUNTERED SUCH A PROBLEM? What do I do?!

    I am having a similar issue that I can consistently recreate. I was finding that emails were "randomly" getting deleted from various folders. It was driving me crazy! I keep my Outlook inbox fairly well organized in that I keep emails in there if they require further action. I don't keep my Deleted folder organized however, so I was getting chunks of emails going from my Inbox to my Deleted items folder and it became very difficult to find all of the deleted emails that I still needed to action..... Here is how I can recreate this:
    Laptop is off of the docking station and open. Outlook has focus with an email highlighted in my inbox. I close the lid and place the laptop onto the docking station. The email that had focus is now in the deleted folder. Again, I can recreate this virtually every time. Please help!

  • Alv grid problem

    Hi,
    I m getting one problem in alv grid control.
    My o/p is looking like
    prog     xyz
    year      2006
    custno     country     name
    1256     uk     xy
    1563     us     mg
    The o/p is correct but when i press f3 button i got again heading as
    prog     xyz
    year     2006
    Will u tell me what is the problem here. I wanted to when i press f3 it will display my selection screen.
    Plz give me proper solution.

    Hi,
    This occurs because your output for alv is printed twice.
    1st with the header and then with the item.
    Try to print the whole at the same time.
    Regards,
    rajesh.

Maybe you are looking for

  • Need help for automated import/export of comments in XFDF

    Hi ! I created 2 Buttons on my toolbar. One for send comments and one for receive comments! If I click the send button, a window opens and ask for the directory where I want to save the xfdf file. How can i realize, that I can save the xfdf-file auto

  • How can I set 'menu' to return to 2nd menu scene selections?

    I have a two page menu. 1. Title page. 2. Scene Selections page. Once we are on the 2nd page, I want the viewer to be able to return to this page when returning from viewing a selection. There is a button on Page 2 to get them back to the main menu i

  • Multi-Line Tool Tip

    Greetings<p> I want to have a multi line tool tip generated from database table fields.<p> Currently I'm using #{datasource.currentRow["FieldName1"]}, #{datasource.currentRow["FieldName2"]} etc., but some of the strings in the field are rather long.<

  • How to check My iMac 27 inch new or used or refurblished?

    Hi, I am Pete. Long time being Apple Fan. I am usually buy Apple product from online and iStudio Reseller near my home. As the way of using apple product, I never claim or learn about checking product because of loyalty and trust. Today, I really har

  • Dynamic e-form options?

    Hi, I'm looking for ideas as to some of the dynamic options to better present content and reduce clutter. Let's say it's an e-form in which the end-user can go through tick or select which products they would like to request. However, let's say there