Eclipse: How to add checkbox on screen

  Hi,
I am working on Eclipse, can u please give me example how we can create Checkbox.

Hi Nishant ,
Follow the API documentation of SAP UI 5 for all the simple and complex controls.
Here is the link for the checkbox control - CheckBox - SAPUI5 Demo Kit
Example :
// create a simple CheckBox
var oCB = new sap.ui.commons.CheckBox({
text : 'I want to receive the newsletter',
tooltip : 'Newsletter checkbox',
checked : true,
change : function() {if(oCB.getChecked()){alert('YES')}else{alert('NO')};}
// attach it to some element in the page
oCB.placeAt("sample1");

Similar Messages

  • How to add new tab screen in transaction BP

    Hi,
       Please let me know How to add new tab screen in transaction ukm_BP. Is there any SPRO configuration needed for this?
    Thanks,
    Debi.

    Hi,
    You may also try the exits available with the MIGO transaction. To find exits you can use the fillowing code by giving tranasaction code as input.
    REPORT  zrmexitfinder                               .
    TABLES: modsap, modact, tstc.
    PARAMETERS: input1 LIKE tstc-tcode DEFAULT ' ',
                input2 LIKE modsap-typ DEFAULT ' '.
    DATA: search1(6),
          search2(3),
          search3 LIKE modsap-member.
    DATA : first_row VALUE 'Y'.
    CONCATENATE: '%' input1 '%' INTO search1,
    '%' input2 INTO search2.
    SELECT * FROM tstc WHERE tcode LIKE search1.
      first_row = 'Y'.
      CHECK tstc-pgmna NE space.
      CONCATENATE '%' tstc-pgmna '%' INTO search3.
      SELECT * FROM modsap WHERE typ LIKE search2
      AND member LIKE search3.
        SELECT SINGLE * FROM modact WHERE member = modsap-name.
        IF first_row EQ 'Y'.
          WRITE: /0 tstc-tcode, 6 tstc-pgmna, 16 modsap-name, 32 modsap-typ,
                 45 modsap-member, 70 modact-name.
          first_row = 'N'.
        ELSE.
          WRITE: /16 modsap-name, 32 modsap-typ, 45 modsap-member, 70 modact-name.
        ENDIF.
        CLEAR : modsap, modact.
      ENDSELECT.
      IF sy-subrc NE 0.
        WRITE : /0 tstc-tcode, 6 tstc-pgmna, 30 'No exits found'.
      ENDIF.
      CLEAR tstc.
    ENDSELECT.
    END-OF-SELECTION.
      CLEAR: search1, search2, search3.
    Regards,
    Renjith Michael.

  • How to add a splash screen in a DwCS6 PhoneGap for Android build?

    So I have the new Dw CS6 and want to see what great things DW can do in building Android Apps. So I follow the California Trails demo on Lynda.com. Build it in DreamWeaver, package it with Phonegap and it runs. However, there are some things I'm noticing that happen with this Phonegap that do not happen when I take the SAME files and place them in my Eclipse SDK and build the application under Eclipes.
    1) There is a 5 to 9 second delay where a black screen is displayed after the app is launched and when it actually displays the index.html. How do I stop this from happening?
    2) How do you add a splach screen? In Eclipes I would add the image to the drawables folders and modify my Activity.java file but we don't have these in DW.
    3) How do I get an external URL to display within my Phonegap App? In Eclipes I make the call to the URL while in a WebView but there isn't anything like that in Dw or Phonegap.
    4) How do I attach or reference my KeyStore file in these PhoneGap builds so I can put them on Google Play?
    Maybe I'm asking too much of Dw and PhoneGap? It this release not intended to create a fully functional app or is it just suppose create a Pseudo App that in reality is a HTML5 webpage made to look like an app? I'm not judging or being critical just trying to find out how or if this Dw feature can be interated in to my workflow.

    I assume that you want to show the splash page after every session is initiated after an authentication.
    Try this:
    Protect the app pages (/app1, /app2 etc) with the following authen scheme:
    Level:1
    Form:/login.html
    Action:/dummy1
    Passthrough:no
    In the authentication success of this one, have an action:
    Authentication success URL: /some_dummy_page.html
    Now, protect this url /some_dummy_page.html with the following:
    Level:2
    Form:/splash_page.html
    Action:/dummy2
    Passthrough:no
    When you access /app1 or /app2, then the first scheme will be invoked, login.html page will come. give your login and password, on successful authen, it will (try to) go to /some_dummy_page.html. but since this one is protected, it will show the splash_page.html. Click on ok, and it will POST to the /dummy2. Because the action in both the schemes are different, the obformlogin cookie will persist.
    You will need to have the action in the splash page to point to /dummy2.
    Hope this helps. Let us know.

  • How to add checkboxes to frame

    So I have two classes in my package. I am having trouble adding the checkbox group to my frame. I got it to add to my applet but I can not figure out how to add it to my frame. Here is what I have so far. When I run this program it puts the checkboxes in my applet and not in my frame.
    this is my painter class:
    package pt;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2006</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class painter extends Applet {
    private int xValue=-10, yValue=-10;
    MyFrame x;
    Checkbox Red, Black, Magenta, Blue, Green, Yellow;
    CheckboxGroup cbg;
    public void init()
    x= new MyFrame("Christie's Window");
    x.show();
    x.resize(250,100);
    cbg = new CheckboxGroup();
           Red = new Checkbox("Red", cbg,true);
           Black = new Checkbox("Black", cbg,false);
           Magenta = new Checkbox("Magenta",cbg,false);
           Blue = new Checkbox("Blue", cbg, false);
           Green = new Checkbox("Green", cbg, false);
           Yellow = new Checkbox("Yellow", cbg, false);
           add(Red);
           add(Black);
           add(Magenta);
           add(Blue);
           add(Green);
           add(Yellow);
         addMouseMotionListener(new MotionHandler(this));
    public void paint(Graphics g)
    g.drawString("Drag the mouse to draw", 10, 20);
    g.fillOval(xValue, yValue, 4,4);
    //Override Component class update method to allow all ovals
    // to remain on the screen by not clearing the background
    public void update(Graphics g)   { paint(g); }
    // set the drawing coordinates and repaint
    public void setCoordinates(int x, int y)
      xValue = x;
      yValue = y;
      repaint();
    // Class to handle only mouse drag events for the Drag applet
    class MotionHandler extends MouseMotionAdapter {
      private painter dragger;
      public MotionHandler(painter d)  { dragger = d; }
      public void mouseDragged( MouseEvent e)
        { dragger.setCoordinates( e.getX(), e.getY() );   }
        } and here is MyFrame class:
    package pt;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2006</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class MyFrame extends Frame {
    MyFrame(String x){
       super(x);
        public boolean handleEvent(Event evtObj) {
          if(evtObj.id==Event.WINDOW_DESTROY) {
            hide();
            return true;
          return super.handleEvent(evtObj);
    }

    here's your conversion, with listeners to change the color
    //import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    //public class painter extends Applet {
    class painter extends Frame {
    Color color = Color.RED;
    private int xValue=-10, yValue=-10;
    //MyFrame x;
    Checkbox Red, Black, Magenta, Blue, Green, Yellow;
    CheckboxGroup cbg;
    //public void init()
    public painter()
    //x= new MyFrame("Christie's Window");
    setTitle("Christie's Window");
    //x.show();
    //x.resize(250,100);
    setSize(600,400);
    setLocation(200,100);
    cbg = new CheckboxGroup();
           Red = new Checkbox("Red", cbg,true);
           Red.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Red.getState()) color = Color.RED;}});
           Black = new Checkbox("Black", cbg,false);
           Black.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Black.getState()) color = Color.BLACK;}});
           Magenta = new Checkbox("Magenta",cbg,false);
           Magenta.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Magenta.getState()) color = Color.MAGENTA;}});
           Blue = new Checkbox("Blue", cbg, false);
           Blue.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Blue.getState()) color = Color.BLUE;}});
           Green = new Checkbox("Green", cbg, false);
           Green.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Green.getState()) color = Color.GREEN;}});
           Yellow = new Checkbox("Yellow", cbg, false);
           Yellow.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Yellow.getState()) color = Color.YELLOW;}});
    Panel p = new Panel();
           p.add(Red);
           p.add(Black);
           p.add(Magenta);
           p.add(Blue);
           p.add(Green);
           p.add(Yellow);
    add(p,BorderLayout.NORTH);
         addMouseMotionListener(new MotionHandler(this));
    addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent we) { System.exit(0); }});
    public void paint(Graphics g)
    super.paint(g);
    g.setColor(color);
    g.drawString("Drag the mouse to draw", 10, 75);
    g.fillOval(xValue, yValue, 4,4);
    //Override Component class update method to allow all ovals
    // to remain on the screen by not clearing the background
    public void update(Graphics g)   { paint(g); }
    // set the drawing coordinates and repaint
    public void setCoordinates(int x, int y)
      xValue = x;
      yValue = y;
      repaint();
    // Class to handle only mouse drag events for the Drag applet
    class MotionHandler extends MouseMotionAdapter {
      private painter dragger;
      public MotionHandler(painter d)  { dragger = d; }
      public void mouseDragged( MouseEvent e)
        { dragger.setCoordinates( e.getX(), e.getY() );   }
      public static void main(String[] args){new painter().setVisible(true);}
    }

  • How to Add Checkbox and icon in ALVGRID

    Hi Experts,
      i have one Requirement. i need to add Checkbox, Selectall,icon(Unlock or inactive) infront of Contracts of ALV GRID.How to achive that.
    Thanks,
    Venkat.

    Hi
    For check box
    At declaring field catalog using structure LVC_S_FCAT
    mark CHECKBOX = 'X' and also EDIT = 'X'.
    For reference check below subroutine in program BCALV_EDIT_05.
    form build_fieldcat changing pt_fieldcat type lvc_t_fcat.
    data ls_fcat type lvc_s_fcat.
    call function 'LVC_FIELDCATALOG_MERGE'
    exporting
    i_structure_name = 'SFLIGHT'
    changing
    ct_fieldcat = pt_fieldcat.
    *§A2.Add an entry for the checkbox in the fieldcatalog
    clear ls_fcat.
    ls_fcat-fieldname = 'CHECKBOX'.
    * Essential: declare field as checkbox and
    * mark it as editable field:
    ls_fcat-checkbox = 'X'.
    ls_fcat-edit = 'X'.
    * do not forget to provide texts for this extra field
    ls_fcat-coltext = text-f01.
    ls_fcat-tooltip = text-f02.
    ls_fcat-seltext = text-f03.
    * optional: set column width
    ls_fcat-outputlen = 10.
    append ls_fcat to pt_fieldcat.
    endform.
    For Icon:
    CONSTANTS:
         icon_id_failure            LIKE icon-id   VALUE ' ((Content component not found.)) @',
         icon_id_okay              LIKE icon-id   VALUE ' ((Content component not found.)) @'.
    TYPES: BEGIN OF ls_tab,
           matnr LIKE equi-matnr,
           maktx LIKE makt-maktx,
           b_werk  LIKE equi-werk,
           b_lager LIKE equi-lager,
           lgobe LIKE t001l-lgobe,
           sernr LIKE equi-sernr,
           icon LIKE icon-id,
           objnr LIKE equi-objnr,
          END OF   ls_tab.
    *Table that display the data for the ALV.
    DATA: itab  TYPE ls_tab OCCURS 0 WITH HEADER LINE.
        PERFORM get_h_date .
        IF h_date => sy-datum .
          itab-icon = icon_id_okay.
        ELSE .
          itab-icon = icon_id_failure.
         ENDIF.
    Regards
    Sudheer

  • Hi Experts, oo hierarchical alv, how to add checkbox on every header?

    Hi Experts,
    I am working on oo hierarchical alv, how can I add checkbox on every header? thanks in advance!
    Kind regards
    Dawson

    Hi Dawson,
    Just refer the below program & pass the check box functionality (mentioned in bold) in REUSE_ALV_HIERSEQ_LIST_DISPLAY in your program.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
    INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
    END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_internal_tabname = 'ITAB'
    i_inclname = sy-repid
    CHANGING
    ct_fieldcat = alvfc
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    it_fieldcat = alvfc
    i_callback_program = sy-repid "<-------Important
    i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
    is_layout = alvly
    TABLES
    t_outtab = itab
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
    LOOP AT itab.
    itab-flag = 'X'.
    MODIFY itab.
    ENDLOOP.
    IMPORTANT.
    WHATROW-REFRESH = 'X'.
    ENDFORM. "ITAB_user_command
    Regards
    Abhii...

  • How to add Checkbox in Table

    Hi,
    I want to add CheckBox in Table. my requirement is multiselection. I Implemented the following steps, but it's not working. anyone can tell me,what mistake i did?
    I created two "Value Attribute"(check,Name) under a "Value Node"(Student) in context.
    check - Boolean
    Name - mapped a Dictionary simple Type(5 values)
    Include a Table in Layout and select Create Binding on right clicking of Table.
    Checked only Student and check -> Next
    Selected the Editor as checkbox -> Finish
    Selected Name from context and assigned to checkbox text property.
    Then I deployed the application. But only one checkbox is displayed in Table without any text.
    Please give me the suggestion, how to do this.
    Thanks in Advance
    Rajakumar

    Hello,
    I think you have a fundamental misunderstanding on how Checkboxes work. A Checkbox triggers a boolean value with true (checked) or false (uncheked).
    When you map your name attribut to text you will see the content of that attribute as text behind. But not the metadata.
    You may want to use a RadiobuttonGroup or CheckboxGroup for your purpose.
    Frank

  • How to add sign in screen at the beginning of training presentation

    Hello Captivate users
    Does anyone know how to add log in or a screen that captures the name of person doing the training so you can see who has done the training?
    Kind Regards
    Nat

    Hello,
    Welcome to Adobe Forums.
    You can use Text Entry Box and Text Caption to create a login screen.
    Once you add a Text Entry Box, a variable will be assigned with it (for ex : Text_Entry_Box_1), you can use that variable to capture the name of the person who views the project's published output.
    Thanks,
    Vikram

  • How to add a logon screen if the user is a guest.

    hi,all
    how do i add a logon screen if the user is annoymous, I use
    IWDClientUser wdUser = WDClientUser.getCurrentUser();
    IUser currentuser = wdUser.getSAPUser();
    And I don't want to raise exception,if the user is a guest.I just want to show the logon screen to him and let him to logon.
    I know if the webdynpro application is on the portal, it has no need.
    But I just want to do this for test.
    Is there any code to do this?
    Thank you.
    Best Regards
    delma

    Hi Delma,
    If you need the logon before starting the application itself, then you can set "authentication=true" in the application properties.
    If you wanna show some initial content in WD and on any specific user action, if you want the user to login, then try this:
         if(WDClientUser.forceLoggedInClientUser().isAnonymousUser())
              WDClientUser.forceLogoffClientUser("<app url>");
    -Aarthi

  • How to add CheckBoxs to a scrollPane

    I have a file I�m getting user info out of and finding certain information the
    User enters, I�m making a query, I�m taking the found items and making an array of Checkboxes out of them witch is working my problem is adding the Checkboxes to the scroll Pane
    public class Frame1 extends JFrame{
    public static Panel listan = new Panel();
    JCheckBox[] jCheckBox1 ;
    JScrollPane scrollPane1 = new JScrollPane(list);
    //other Window objects
    //first method
    private void jbInit() throws Exception {
    //puts all window objects together
    // Constructs user screen
    list.setLayout(verticalFlowLayout1);
    panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
    // i have a find buttion that takes all infoamtion out of file
    // and puts in an array then finds user enterd infomation
    // this is just example code that just adds CheckBoxs to the scrollPane
    // and is Basically the same way the other program does
    // second method
    void addcheckbox_actionPerformed(ActionEvent e) {
    jCheckBox1 = new JCheckBox[50];
    for (int i = 0; i < 50; i++) {
    String checkboxText = ("Checkbox #: " + (i + 1));
    jCheckBox1[i] = new JCheckBox(checkboxText);
    for (int i = 0; i < 50; i++) {
    list.add(jCheckBox1, null);
    My problem is that I can�t add the checkboxes at the second method but it works in the first, I can add in the first because I initialize in the second.

    If you want something to compile here is all my example code
    I will incorporate it to my 30 page program
    Here is what I want my code to do
    package list;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.Checkbox;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Frame1 extends JFrame {
      public static boolean ch=true;
      JPanel contentPane;
      GridLayout gridLayout1 = new GridLayout();
      JPanel panel1 = new JPanel();
      XYLayout xYLayout1 = new XYLayout();
      JButton jButton1;
      JButton jButton2;
      JButton addcheckbox;
      JCheckBox[] jCheckBox1 ;
      JScrollPane scrollPane1 = new JScrollPane();
      JPanel list = new JPanel();
      VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
      //Construct the frame
      public Frame1() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
      //Component initialization
    // method one
      private void jbInit() throws Exception {
        contentPane = (JPanel)this.getContentPane();
        jButton1 = new JButton();
        jButton2 = new JButton();
        addcheckbox = new JButton();
        this.setContentPane(contentPane);
        this.setLocale(java.util.Locale.getDefault());
        this.setResizable(false);
        this.setSize(new Dimension(400, 300));
        this.setState(Frame.NORMAL);
        this.setTitle("Frame Title");
        contentPane.setOpaque(true);
        contentPane.setRequestFocusEnabled(true);
        contentPane.setLayout(gridLayout1);
        panel1.setLayout(xYLayout1);
        jButton1.setSelected(false);
        jButton1.setText("Print");
        jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
        jButton2.setText("select all/none");
        jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
        addcheckbox.setBorderPainted(true);
        addcheckbox.setText("add");
        addcheckbox.addActionListener(new Frame1_addcheckbox_actionAdapter(this));
        scrollPane1.setLocale(java.util.Locale.getDefault());
        list.setLayout(verticalFlowLayout1);
        contentPane.add(panel1, null);
        panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
        scrollPane1.getViewport().add(list, null);
        //scrollPane1.add(listan, null);
        panel1.add(jButton1, new XYConstraints(261, 92, 90, 39));
        panel1.add(jButton2,   new XYConstraints(262, 152, 108, 30));
        panel1.add(addcheckbox, new XYConstraints(25, 49, -1, 35));
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
      void jButton1_actionPerformed(ActionEvent e) {
        String checkprint = "selected:\n";
        for (int x = 0; x < jCheckBox1.length; x++) {
          if (jCheckBox1[x].isSelected()) {
             checkprint = checkprint + jCheckBox1[x].getText()+"\n";
        System.out.println(checkprint);
      void jButton2_actionPerformed(ActionEvent e) {
        for (int x = 0; x < jCheckBox1.length; x++) {
          if (ch == true) {
            jCheckBox1[x].setSelected(true);
          else{
            jCheckBox1[x].setSelected(false);
    if (ch == true)
          ch=false;
        else
          ch=true;
    //method two
      void addcheckbox_actionPerformed(ActionEvent e) {
        jCheckBox1 = new JCheckBox[50];
            for (int i = 0; i < 50; i++) {
              String checkboxText = ("Checkbox #: " + (i + 1));
              jCheckBox1[i] = new JCheckBox(checkboxText);
            for (int i = 0; i < 50; i++) {
             list.add(jCheckBox1, null);
    class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    class Frame1_jButton2_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton2_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class Frame1_addcheckbox_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_addcheckbox_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.addcheckbox_actionPerformed(e);
    }doesn�t work but if I take all of method two and put it in one it workspackage list;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.Checkbox;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Frame1 extends JFrame {
    public static boolean ch=true;
    JPanel contentPane;
    GridLayout gridLayout1 = new GridLayout();
    JPanel panel1 = new JPanel();
    XYLayout xYLayout1 = new XYLayout();
    JButton jButton1;
    JButton jButton2;
    JButton addcheckbox;
    JCheckBox[] jCheckBox1 ;
    JScrollPane scrollPane1 = new JScrollPane();
    JPanel list = new JPanel();
    VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch (Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    // this is the same code in method two
    jCheckBox1 = new JCheckBox[50];
    for (int i = 0; i < 50; i++) {
    String checkboxText = ("Checkbox #: " + (i + 1));
    jCheckBox1[i] = new JCheckBox(checkboxText);
    for (int i = 0; i < 50; i++) {
    list.add(jCheckBox1[i], null);
    contentPane = (JPanel)this.getContentPane();
    jButton1 = new JButton();
    jButton2 = new JButton();
    addcheckbox = new JButton();
    this.setContentPane(contentPane);
    this.setLocale(java.util.Locale.getDefault());
    this.setResizable(false);
    this.setSize(new Dimension(400, 300));
    this.setState(Frame.NORMAL);
    this.setTitle("Frame Title");
    contentPane.setOpaque(true);
    contentPane.setRequestFocusEnabled(true);
    contentPane.setLayout(gridLayout1);
    panel1.setLayout(xYLayout1);
    jButton1.setSelected(false);
    jButton1.setText("Print");
    jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
    jButton2.setText("select all/none");
    jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
    addcheckbox.setBorderPainted(true);
    addcheckbox.setText("add");
    addcheckbox.addActionListener(new Frame1_addcheckbox_actionAdapter(this));
    scrollPane1.setLocale(java.util.Locale.getDefault());
    list.setLayout(verticalFlowLayout1);
    contentPane.add(panel1, null);
    panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
    scrollPane1.getViewport().add(list, null);
    //scrollPane1.add(listan, null);
    panel1.add(jButton1, new XYConstraints(261, 92, 90, 39));
    panel1.add(jButton2, new XYConstraints(262, 152, 108, 30));
    panel1.add(addcheckbox, new XYConstraints(25, 49, -1, 35));
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton1_actionPerformed(ActionEvent e) {
    String checkprint = "selected:\n";
    for (int x = 0; x < jCheckBox1.length; x++) {
    if (jCheckBox1[x].isSelected()) {
    checkprint = checkprint + jCheckBox1[x].getText()+"\n";
    System.out.println(checkprint);
    void jButton2_actionPerformed(ActionEvent e) {
    for (int x = 0; x < jCheckBox1.length; x++) {
    if (ch == true) {
    jCheckBox1[x].setSelected(true);
    else{
    jCheckBox1[x].setSelected(false);
    if (ch == true)
    ch=false;
    else
    ch=true;
    void addcheckbox_actionPerformed(ActionEvent e) {
    class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    class Frame1_jButton2_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton2_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class Frame1_addcheckbox_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_addcheckbox_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.addcheckbox_actionPerformed(e);
    }Edited by: deme on Feb 27, 2008 6:48 AM
    Edited by: deme on Feb 27, 2008 6:51 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to ADD ALV in Screen

    Hi All,
    I have to show some data in ALV format in a POP Up with some additional buttons and icon.
    Please help me to know thw way to add ALV in Screen.
    Thanks
    Piyush Mathur

    hi piyush,
    iam sending my code below.in this program interactive alv is working fine and pop also coming. i think this is ur requirement.
    REPORT ZMAHI1 LINE-SIZE 30.
    TABLES : VBAK,VBAP.
    TYPE-POOLS : SLIS.
    DATA : BEGIN OF IT_VBAK OCCURS 0,
            VBELN TYPE VBAK-VBELN,
            ERDAT TYPE VBAK-ERDAT,
            ERNAM TYPE VBAK-ERNAM,
            ERZET TYPE VBAK-ERZET,
            VTWEG TYPE VBAK-VTWEG,
            VKORG TYPE VBAK-VKORG,
            NETWR TYPE VBAK-NETWR,
           END OF IT_VBAK.
    DATA : BEGIN OF IT_VBAP OCCURS 0,
            VBELN TYPE VBAP-VBELN,
            MATNR TYPE VBAP-MATNR,
            ERZET TYPE VBAP-ERZET,
            POSNR TYPE VBAP-POSNR,
           LINE_COLOR(4) TYPE C,     "Used to store row color attributes
          END OF IT_VBAP.
    DATA : BEGIN OF IT_MATNR OCCURS 0,
             MATNR TYPE MARA-MATNR,
             ERSDA TYPE MARA-ERSDA,
             ERNAM TYPE MARA-ERNAM,
           END OF IT_MATNR.
    DATA : EVENTCAT TYPE SLIS_T_EVENT.
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    DATA: EVNT_IT_VBAK TYPE SLIS_T_EVENT        WITH HEADER LINE.
    DATA:  I_TITLE_VBAK TYPE LVC_TITLE VALUE 'ALV LIST FIRST'.
    DATA:  I_TITLE_VBAP TYPE LVC_TITLE VALUE 'ALV LIST SECOND'.
    DATA: V_REPID LIKE SY-REPID .
    DATA :    HEADING TYPE  SLIS_T_LISTHEADER.
    DATA: FCAT_MATNR TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    SELECT-OPTIONS :  S_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
      V_REPID = SY-REPID.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM BUILT_FIELDCATALOG.
      PERFORM E03_EVENTTAB_BUILD USING EVENTCAT[].
      PERFORM COMMENT_BUILD USING HEADING[].
    PERFORM END_OF_LIST.
      PERFORM GRID_DISPLAY.
    *&      Form  GET_DATA
    FORM GET_DATA.
      SELECT VBELN
             ERDAT
             ERNAM
             ERZET
             VTWEG
             VKORG
             NETWR
         FROM VBAK
         INTO TABLE IT_VBAK
      WHERE VBELN IN S_VBELN.
    ENDFORM.                    " GET_DATA
    *&      Form  BUILT_FIELDCATALOG
    FORM BUILT_FIELDCATALOG.
      CLEAR I_FIELDCAT.
      REFRESH : I_FIELDCAT[].
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-SELTEXT_M = 'SALES DOC NO'.
      WA_FIELDCAT-HOTSPOT = 'X'.
      WA_FIELDCAT-EMPHASIZE = 'C610'.
      WA_FIELDCAT-EDIT = 'X'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERDAT'.
      WA_FIELDCAT-EMPHASIZE = 'C510'.
      WA_FIELDCAT-SELTEXT_M = 'Creation Date'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERNAM'.
      WA_FIELDCAT-SELTEXT_M = 'NAME'.
      WA_FIELDCAT-EMPHASIZE = 'C410'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERZET'.
      WA_FIELDCAT-SELTEXT_M = 'TIME'.
      WA_FIELDCAT-EMPHASIZE = 'C310'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VTWEG'.
      WA_FIELDCAT-SELTEXT_M = 'DIS CHANNEL'.
      WA_FIELDCAT-EMPHASIZE = 'C210'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VKORG'.
      WA_FIELDCAT-SELTEXT_M = 'SALES ORG'.
      WA_FIELDCAT-EMPHASIZE = 'C110'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'NETWR'.
      WA_FIELDCAT-SELTEXT_M = 'AMOUNT'.
      WA_FIELDCAT-EMPHASIZE = 'C710'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " BUILT_FIELDCATALOG
    *&      Form  GRID_DISPLAY
    FORM GRID_DISPLAY.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = V_REPID
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
                IT_FIELDCAT             = I_FIELDCAT[]
                I_SAVE                  = 'A'
                IT_EVENTS               = EVENTCAT[]
           TABLES
                T_OUTTAB                = IT_VBAK
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
    ENDFORM.                    " GRID_DISPLAY
    for header
    *&      Form  HEADER
    FORM TOP_OF_PAGE.
      DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
            WA_HEADER TYPE SLIS_LISTHEADER,
            T_HEADER1 TYPE SLIS_T_LISTHEADER,
            WA_HEADER1 TYPE SLIS_LISTHEADER,
            T_LINE LIKE WA_HEADER-INFO,
            LD_LINES TYPE I,
            LD_LINESC(10) TYPE C.
    Title
      WA_HEADER-TYP  = 'H'.
      WA_HEADER-INFO = 'VBAK Table Report'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
    Date
      WA_HEADER-TYP  = 'S'.
      WA_HEADER-KEY = 'Date: '.
      CONCATENATE  SY-DATUM+6(2) '.'
                   SY-DATUM+4(2) '.'
       SY-DATUM(4) INTO WA_HEADER-INFO."todays date
      APPEND WA_HEADER TO T_HEADER.
      CLEAR: WA_HEADER.
    Total No. of Records Selected
      DESCRIBE TABLE IT_VBAK LINES LD_LINES.
      LD_LINESC = LD_LINES.
      CONCATENATE 'Total No. of Records Selected: ' LD_LINESC
         INTO T_LINE SEPARATED BY SPACE.
      WA_HEADER-TYP  = 'A'.
      WA_HEADER-INFO = T_LINE.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR: WA_HEADER, T_LINE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = T_HEADER
                I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    " HEADER
    *&      Form  E03_EVENTTAB_BUILD
    FORM E03_EVENTTAB_BUILD USING    E03_LT_EVENTS TYPE  SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 3
           IMPORTING
                ET_EVENTS   = E03_LT_EVENTS.
      READ TABLE E03_LT_EVENTS
      WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
        APPEND LS_EVENT TO E03_LT_EVENTS.
      ENDIF.
      DELETE E03_LT_EVENTS WHERE FORM IS INITIAL.
    ENDFORM.                    " E03_EVENTTAB_BUILD
    *&      Form  COMMENT_BUILD
    FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: W_HEADING TYPE SLIS_LISTHEADER.
      DATA: W_HEADING1 TYPE SLIS_LISTHEADER.
      CLEAR   : W_HEADING, LT_TOP_OF_PAGE.
      REFRESH : LT_TOP_OF_PAGE.
      W_HEADING-INFO = 'Synopsys World' .
      W_HEADING-TYP = 'H'.
      APPEND  W_HEADING  TO LT_TOP_OF_PAGE .
      CLEAR  W_HEADING  .
    ENDFORM.                    " COMMENT_BUILD
    end of header portion.
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING SY-UCOMM P_SELFIELD TYPE SLIS_SELFIELD.
      CASE SY-UCOMM.
        WHEN '&IC1'.
          IF P_SELFIELD-FIELDNAME = 'VBELN'.
            READ TABLE IT_VBAK INDEX P_SELFIELD-TABINDEX.
            IF SY-SUBRC EQ 0.
              SELECT * FROM VBAP INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
               WHERE VBELN = IT_VBAK-VBELN.
            ENDIF.
            PERFORM GETDATA_FROM_VBAP.
            PERFORM BUILD_FIELDCATLOG_IT_VBAP.
            PERFORM BUILD_LAYOUT.
            PERFORM HEADINGFOR_SECONDARY.
            PERFORM GRID_DISPLAY1.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  GETDATA_FROM_VBAP
    FORM GETDATA_FROM_VBAP.
      DATA: LD_COLOR(1) TYPE C.
      SELECT * FROM VBAP
        INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
       WHERE VBELN = IT_VBAK-VBELN.
      LOOP AT IT_VBAP .
        LD_COLOR = LD_COLOR + 1.
        IF LD_COLOR = 8.
          LD_COLOR = 1.
        ENDIF.
        CONCATENATE 'C' LD_COLOR '10' INTO IT_VBAP-LINE_COLOR.
        MODIFY IT_VBAP  TRANSPORTING LINE_COLOR.
      ENDLOOP.
    ENDFORM.                    " GETDATA_FROM_VBAP
    *&      Form  BUILD_FIELDCATLOG_IT_VBAP
    FORM BUILD_FIELDCATLOG_IT_VBAP.
      CLEAR FIELDCATALOG.
      REFRESH : FIELDCATALOG[].
      FIELDCATALOG-FIELDNAME   = 'VBELN'.
      FIELDCATALOG-SELTEXT_M   = 'SALES DOC NO'.
      FIELDCATALOG-COL_POS     = 0.
      FIELDCATALOG-OUTPUTLEN   = 10.
      FIELDCATALOG-EMPHASIZE   = 'X'.
      FIELDCATALOG-KEY         = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'POSNR'.
      FIELDCATALOG-SELTEXT_M   = 'PO Item'.
      FIELDCATALOG-COL_POS     = 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'MATNR'.
      FIELDCATALOG-SELTEXT_M   = 'MAT NO'.
      FIELDCATALOG-COL_POS     = 2.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'ERZET'.
      FIELDCATALOG-SELTEXT_M   = 'TIME'.
      FIELDCATALOG-COL_POS     = 3.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATLOG_IT_VBAP
    *&      Form  GRID_DISPLAY1
    FORM GRID_DISPLAY1.
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = GD_REPID
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND1'
                I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
                IS_LAYOUT               = GD_LAYOUT
                IT_FIELDCAT             = FIELDCATALOG[]
                I_SAVE                  = 'A'
                IT_EVENTS               = EVENTCAT[]
           TABLES
                T_OUTTAB                = IT_VBAP
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
    ENDFORM.                    " GRID_DISPLAY1
    *&      Form  BUILD_LAYOUT
    FORM BUILD_LAYOUT.
      GD_LAYOUT-ZEBRA = 'X'.
      GD_LAYOUT-NO_INPUT          = 'X'.
      GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
      GD_LAYOUT-INFO_FIELDNAME =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  END_OF_LIST
    FORM END_OF_LIST.
      DATA: LISTWIDTH TYPE I,
            LD_PAGEPOS(10) TYPE C,
            LD_PAGE(10)    TYPE C.
      WRITE: SY-ULINE(50).
      SKIP.
      WRITE:/40 'Page:', SY-PAGNO .
      WRITE:/40 'Page:', SY-PAGNO .
    ENDFORM.                    " END_OF_LIST
    *&      Form  HEADINGFOR_SECONDARY
    FORM HEADINGFOR_SECONDARY.
    *EVENT_IT_VBAK-FORM = '"HEADINGFOR_SECONDARY'.
    ENDFORM.                    " HEADINGFOR_SECONDARY
    *&      Form  USER_COMMAND
    FORM USER_COMMAND1 USING SY-UCOMM P_SELFIELD1 TYPE SLIS_SELFIELD.
      CASE SY-UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_VBAP INDEX P_SELFIELD1-TABINDEX.
          IF SY-SUBRC EQ 0.
            SELECT * FROM MARA  INTO CORRESPONDING FIELDS OF TABLE
    IT_MATNR
             WHERE MATNR = IT_VBAP-MATNR.
          ENDIF.
          PERFORM BUILD_FIELDCATLOG_IT_MATNR.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_IT_MATNR
    FORM BUILD_FIELDCATLOG_IT_MATNR.
      CLEAR I_FIELDCAT.
      REFRESH : I_FIELDCAT[].
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
      WA_FIELDCAT-HOTSPOT = 'X'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'ERSDA'.
      WA_FIELDCAT-SELTEXT_M = 'CREATION DTAE'.
      WA_FIELDCAT-HOTSPOT = 'X'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'ERNAM'.
      WA_FIELDCAT-SELTEXT_M = 'NAME'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
           EXPORTING
                I_ZEBRA       = 'X'
                I_TABNAME     = 1
                IT_FIELDCAT   = I_FIELDCAT[]
           TABLES
                T_OUTTAB      = IT_MATNR
           EXCEPTIONS
                PROGRAM_ERROR = 1
                OTHERS        = 2.
    ENDFORM.                    " BUILD_FIELDCATLOG_IT_MATNR
    thanks,
    maheedhar.t

  • How to add checkboxes to frames?

    Hi,
    I am trying to add checkboxes to a frame which will then be instantiated from an applet. I can launch the frame correctly from my applet but it always displays the last checkbox added only. So in my code below it would always display the 'Black' checkbox.
    Could anyone please tell me what I am doing wrong or not doing here?
    import java.awt.*;
    import java.applet.*;
    class Chooser extends Frame {
         Chooser(String title) {
              super(title);
              Checkbox cRed;
              Checkbox cBlack;
              CheckboxGroup cbg = new CheckboxGroup( );
              cRed = new Checkbox("Red", cbg, true);
              cBlack = new Checkbox("Black", cbg, false);
              add(cRed);
              add(cBlack);
            public boolean handleEvent(Event evtObj) {
              if (evtObj.id == Event.WINDOW_DESTROY) {
                   hide( );
                   return true;
              return super.handleEvent(evtObj);
         public void paint(Graphics g) {
              g.drawString("Chooser Frame",10,40);
    }Thanks
    Avi
    Message was edited by:
    avi22
    Message was edited by:
    avi22

    add a pack() statement to your Chooser constructor as the last statement before the end of the constructor
      Chooser(String title){
    //    your code here
        this.pack();

  • How to add checkbox in dropdown box

    hi to all
      please help me urgent
      can we add check box in to the drop down box in screen painter..?
    if yes then please tell me in detail.
    thank you...

    Hi,
    In drop down ( combo box) u can select only one item at a time. so why do u need check box ?

  • How to add checkbox in ALV OO?

    how to change editable mode and able to input???
    REPORT  ZZ_ALV_TEST.
    data:
          ispfli type table of spfli.
    data: gr_table type ref to cl_salv_table.
    data: gr_functions type ref to cl_salv_functions.
    data: gr_display type ref to cl_salv_display_settings.
    DATA: GR_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE,
          GR_COLUMN  TYPE REF TO CL_SALV_COLUMN_TABLE.
    start-of-selection.
    select * into table ispfli from spfli.
    cl_salv_table=>factory( importing r_salv_table = gr_table changing
    t_table = ispfli ).
    gr_functions = gr_table->get_functions( ).
    gr_functions->set_all( abap_true ).
    GR_COLUMNS = GR_TABLE->GET_COLUMNS( ).
      TRY.
          GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( 'CARRID' ). "Column which you
    * want to make checkbox
          GR_COLUMN->SET_CELL_TYPE( 1 ).
        CATCH CX_SALV_NOT_FOUND.
      ENDTRY.
    gr_table->display( ).

    I understand the CARRID column is not a checkbox, so you might mean something else entirely. If all you need is to toogle a checkbox value on click, then
    - first make the checkbox a hotspot
    gr_column->set_cell_type(  if_salv_c_cell_type=>checkbox_hotspot ). " constant value 6
    - implement a handler to the hotspot event
    DATA gr_events TYPE REF TO cl_salv_events_table.
        gr_events = gr_table->get_event( ).
        SET HANDLER ??->handle_hotspot_click FOR gr_events.
    - Your handler must toogle the checkbox value and refresh the display, something like
        METHOD handle_hotspot_click.
        FIELD-SYMBOLS <ls_item> TYPE spfli.
        READ TABLE ispfli INDEX row ASSIGNING <ls_item>.
        CHECK sy-subrc EQ 0.
        CASE column.
          WHEN 'CARRID'.  " your checkbox column
    *       Toogle Value
            IF <ls_item>-carrid EQ 'X'.
              <ls_item>-carridl = space.
             ELSE.
              <ls_item>-carrid = 'X'.
            ENDIF.
            gr_table->refresh( ).
        ENDCASE.
      ENDMETHOD.
    J.N.N

  • How to add checkboxes in InDesign CS3 for use in pdf?

    I need to create a page with checkboxes for the user to select various options. I can create buttons and hyperlinks, but I am unable to create checkboxes. Is it even possible to do so in InDesign?

    Thanks Bob. Just wondering though, I need to generate an electronic form, meaning I need to be able to use these checkboxes for scripting. I don't think the auto form recognition feature works for that... does it?

Maybe you are looking for

  • Tags in CS3 not displaying correctly

    I have pages that displayed correctly in Dreamweaver CS2. In CS3, the design view is not displaying properly. For example, if the tag is this: <p class="Body">, design view is not showing the page properly. If I reapply the CSS style, CS3 inserts thi

  • How-to hide the portal file shares on Windows

    Hi, Does anybody know how to hide the default file shares created by SAP NW 04 in windows? In other words: what I'm trying to accomplish is renaming the sapmnt share and saploc share (both on the E:\usr\sap\ folder) to sapmnt$ and saploc$. I know how

  • About the Customized Ruleset and Rules

    Dear all, I am testing a 3 sites replication. If i use the add_schema_rules to create the capture, propagation and apply process with the auto-generated rulesets and rules, everything is OK. But now, i want to customize the propagation to achieve som

  • Issues with buying Iphoto Album

    Hi i am having troubles with iphoto when trying to buy the album I just created. The album is there then I click 'buy album' enter all details required then I can see the downloading page - it starts downloading and it crashes after the 3rd picture.

  • Newbie looking to setup home virtual lab to do Windows Server 2012 R2 Labs for school

    Hey all, hopefully someone can point me in the right direction here. Im looking to setup a virtual lab with 3 windows server 2012 r2 machines running, all connected to the internet and within the same network so I can work on labs for class. I have a