Listbox on Modulepool

Hi
    I Created 2 listboxes, and added a field to one of the checkbox and retriving the data using select statement upto  some 10 rows, here the question is  in one list box numbers from 1- 10 should be displayed and in second list box One – Ten should be displayed ) .
how can i solve this ? plz help me out as soon as possible
Prakash Yalamanchili

Use FM 'F4IF_INT_TABLE_VALUE_REQUEST' as shown below:
*populate Full Text grade list box
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'ZGRADE'
      value_org       =  'S'
   TABLES
      value_tab       = wi_zhrdaccgrad
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
    MESSAGE 'no help' TYPE 'E'.
  ENDIF.
You can store the values you want in a database table and pass the name of the table in Value_tab.
And the field name in retfield.
Otherwise, attach a search help. to the screen field. So no listbox is required.
Hope it helps,
saipriya

Similar Messages

  • How to populate the data in LISTBOX   of Dialog programming

    Hi All,
    I know how to create a Listbox in Modulepool programming, But i do n't know how to populate the data in LISTBOX. Does anyone knows , please help me ?
    Thanks in advance
    KR

    hi,
    u need to write this after all modules of PAI in screen flow logic
    PROCESS ON VALUE-REQUEST.
      FIELD ifmtp-form_type MODULE fm_drop.
    MODULE fm_drop INPUT.
      CLEAR ifmtp.
      REFRESH ifmtp.
      ifmtp-form_type = 'C'.
      APPEND ifmtp.
      ifmtp-form_type = 'F'.
      APPEND ifmtp.
      ifmtp-form_type = 'H'.
      APPEND ifmtp.
      ifmtp-form_type = 'D'.
      APPEND ifmtp.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield  = 'FORM_TYPE'
          value_org = 'S'
        TABLES
          value_tab = ifmtp.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " fm_drop  INPUT
    here ifmtp-form_type is my list box field on screen in which ifmtp is my internal table and form_type is my field name
    i have declared internal table like
    DATA : BEGIN OF ifmtp OCCURS 0,
              form_type LIKE zform_track_mast-form_type,
           END OF ifmtp.
    reward if useful...

  • How to Fetch Data From an Internal table to a field in Modulepool Screen ??

    In my Modulepool Screen i have two fields ,
    Based on the data of the First field ,the second field will display the data.
    For ex-  first field - I choosed the data -" MARUTI",
                then in the second field , all d CARs ( 800,zen,waganor.....)related to MARUTI shd be displayed.
    without using POV module hw to use dis ? and also using POV ,what are the function modules to be used ..
    pls explore in details...
    Thnks to all d contributors for their Time.....

    see if u have a limited values to display in Listbox, den we will go for vrm_set_values.
    but here as per the requirement
    thr is no limited Values in d second dropdown box.
    Let me Clear abt the requirement.
    First field - issue no.
    2nd field- Item no.
    when u select a particular issue no, den in item it shd display the corresponding item nos related to that issueno. And both Fields r Primary keys in d table( customised Table.)
    this is wwht exactly my requirement.
    as i created The search help for issueNo, its displaying all the issueno Dat are in DB.
    But Itemno Field is nt behaving as per That.
    Pls Suggest me.. in details

  • Drop down box in a modulepool

    Hi,
    I am creating a modulepool with a drop down box in one of the dynpros. I have managed to fill it with values using the 'VRM_SET_VALUES' function module.
    The problem comes when running the modulepoool. The field displays the drop down box with the correct values, but it does not take the values I select. The first opcion is the defualt, and even though I choose a different one it does not take the change.
    Is there something missing?
    Thanks in advance,
    Nerea.

    Hi Nerea,
    Check with this code
    TYPE-POOLS: VRM.
    TABLES SPFLI.
    TABLES SSCRFIELDS.
    DATA flag.
    DATA: NAME TYPE VRM_ID,
          LIST TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST.
    PARAMETERS PS_PARM LIKE SPFLI-CARRID  AS LISTBOX VISIBLE LENGTH 10
    USER-COMMAND
    fcodex.
    data: i_spfli type spfli occurs 0 with header line.
    PARAMETERS PQ_PARAM LIKE SPFLI-connid AS LISTBOX VISIBLE LENGTH 15
    USER-COMMAND
    fcodey.
    INITIALIZATION.
      NAME = 'PS_PARM'.
      DATA T TYPE I VALUE 0.
    SELECT DISTINCT carrid into corresponding fields of table i_spfli FROM
    SPFLI.
      loop at i_spfli.
        VALUE-KEY = i_spfli-CARRID.
        VALUE-TEXT = i_spfli-CARRID.
        APPEND VALUE TO LIST.
      endloop.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID     = NAME
          VALUES = LIST.
    AT SELECTION-SCREEN.
      if sy-ucomm eq 'FCODEX'.
        REFRESH LIST.
        CLEAR LIST.
        PQ_PARAM = ' '.
        NAME = 'PQ_PARAM'.
        SELECT  * FROM SPFLI WHERE CARRID = PS_PARM.
          VALUE-KEY = SPFLI-connid.
          VALUE-TEXT = SPFLI-connid.
          APPEND VALUE TO LIST.
        ENDSELECT.
      endif.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SY-UCOMM NE 'FCODEX' OR SY-UCOMM NE 'FCODEY'.
          CALL FUNCTION 'VRM_SET_VALUES'
            EXPORTING
              ID     = NAME
              VALUES = LIST.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      clear i_spfli.
      refresh i_spfli.
    select * into table i_spfli from spfli where carrid = ps_parm and connid
    = pq_param.
      loop at i_spfli.
        WRITE: / 'CITY FROM:', I_SPFLI-CITYFROM, 'CITY TO :',I_SPFLI-CITYTO,
       'DEPARTURE TIME :', I_SPFLI-DEPTIME.
      ENDLOOP.
    Reward with point if it is helpful
    Regards
    Alfred

  • How to add search help to custom infotype listbox??

    Hi All,
    How to add search help to custom infotype listbox??
    Thanks in advance

    Hi Vinay,
    We have search help and list box as 2 different options.
    At a time we can make a field a list box or a search help.List box is restricted and we can pick values from the defined list whereas in search help we can allow more entries and then validate the value entered later.
    Implementing a listbox or search help in infotype is same as that of implementing it in a modulepool .
    for search help..we can create a custom search help or check for existing search help in se11
    then in the screen on infotype field..assign the search help direcly at the screen painter level..
    double click on the field in screen painter -> change mode and then in the space for "search help" enter the search helps name
    for list box..in the screen painter ,make sure the field is selected as list box..then in PAI of screen we do a
    (Process on value-request..field fieldname module module name)..check syntax and other details...
    Using function module vrm_set_value fill the field and populate it as required
    Pls check and revert
    Regards
    Byju

  • Get selected values from Listbox control

    Hi All,
    I'm still new to SL so please bear with me.
    I have a ListBox being bound with some records from a DB.  Here's the xaml:
    <ListBox x:Name="lstClassSeries" SelectionMode="Multiple" DisplayMemberPath="Description" Grid.Row="11" Grid.Column="1"></ListBox>
    What I need is to get the values of the items that were selected and I can't seem to get it to work.  I've tried looping through the SelectedItems but there's no property for value or text.  I even tried to cast the item as a ListBoxItem but I
    get the following error:
    Unable to cast object of type 'UI.Silverlight.TransactionService.DTODropDown' to type 'System.Windows.Controls.ListBoxItem'.
    How can I get the values of the items selected?
    Thanks

    You're using windows forms style techniques with xaml.
    This is a bad idea.
    You ought to learn MVVM.
    You probably don't think you want to learn it, but trust me on this one.
    Learn MVVM as soon as you can.
    There's a selecteditems collection.
    You have to cast   to listboxitem, it has a content property which you cast to whatever you put in there originally.
    Here's a snippet.
    I have a class foo, load a bunch of them in.  Do stuff. Work out what's selected in the click event of a button.
    public class foo
    public int id {get;set;}
    public string description {get;set;}
    public partial class MainPage : UserControl
    public MainPage()
    InitializeComponent();
    lb.Items.Add(new ListBoxItem{Content=new foo{ id=1, description="a"}});
    lb.Items.Add(new ListBoxItem { Content = new foo { id = 2, description = "b" } });
    lb.Items.Add(new ListBoxItem { Content = new foo { id = 3, description = "c" } });
    private void Button_Click(object sender, RoutedEventArgs e)
    List<foo> selectedfoos = lb.SelectedItems.Cast<ListBoxItem>().Select(x=>x.Content as foo).ToList();
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to populate values in listbox of a field?

    HI all,
    My requirement is : i have one filed , for that i have five values,
    i want to display those five values in the list box. then i have to select one of them  and based on this field i have to display few fields in table control .
    here i am able to display the values in listbox but even i select any value , it showing the first vale only !!!!!!
    please help me in this regard.

    This is the way........
    DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
      DATA : L_PSPNR  TYPE PROJ-PSPID,
             L_WBSE   TYPE PRPS-POSID.
    PARAMETERS : P_BPO TYPE CKIS-EXTNR
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BPO.
    DATA : BEGIN OF IT_BPO OCCURS 100,
             BPO LIKE ZCKIS-BPO,
             END OF IT_BPO.
      DYNFIELDS-FIELDNAME = 'P_PSPNR'.
      APPEND DYNFIELDS.
      CLEAR DYNFIELDS.
      DYNFIELDS-FIELDNAME = 'P_WBSE'.
      APPEND DYNFIELDS.
      CLEAR DYNFIELDS.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME               = SY-CPROG
          DYNUMB               = SY-DYNNR
          TRANSLATE_TO_UPPER   = 'X'
        TABLES
          DYNPFIELDS           = DYNFIELDS
        EXCEPTIONS
          INVALID_ABAPWORKAREA = 1
          INVALID_DYNPROFIELD  = 2
          INVALID_DYNPRONAME   = 3
          INVALID_DYNPRONUMMER = 4
          INVALID_REQUEST      = 5
          NO_FIELDDESCRIPTION  = 6
          INVALID_PARAMETER    = 7
          UNDEFIND_ERROR       = 8
          DOUBLE_CONVERSION    = 9
          STEPL_NOT_FOUND      = 10
          OTHERS               = 11.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
    Rewards if satisfied
    Thanks

  • How can i add to a listBox items near in a new column other items ?

    The items on the right i changed the property of the listBox1 righttoleft to Yes.
    My problem is i want to build a new column for the number so each number i'm adding will be next on the left to the belong item string. And not under it like now.
    1. Maybe i need to use another control and not listBox ?
    2. How can i add column/s and also maybe adding a title to each column like: Names Id Number....?

    If you want columns, you should consider a
    ListView or
    DataGridView.

  • Goto field and listbox color formats

    i've got two questions
    1. i've scripted a functional listbox (field2) that hides or shows fields depending on options selected ('yes' opens field2a, 'no' hides field2a) but depending the option chosen i want to 'go to' an appropriate field. example: 'yes' automatically goes to field2a, 'no' proceeds to field3
    as it is the 'yes' jumps to field3 and 'no' goes back to the top of the page. is there a command/script i can enter at the end of the 'if' and 'or' statement that will place the cursor in a designated field?
    2. the list box only shows as white text on a blue background. is there a way to make it show like a regular text box (black text on a white background)?
    any help is greatly appreciated!!
    ..joseph g

    You are sure you are getting only "No" and "Yes" from your list box?
    $host.messageBox(Concat("Event value = ", event.vlaue), "Verify Event Value", 3, 1);
    if (event.value=="No") {
    this.getField("5S1").hidden = true;
    xfa.host.setFocus("8");
    }else {
    if (event.value=="Yes") {
    this.getField("5S1").hidden = false;
    xfa.host.setFocus("5S1") };
    Are your 2 fields are not in the same section, you will need to provide the full reference.

  • Select all in listbox

    Hi guys,
    I have a question.
    I have a from xml populated listbox and want to select by pushing a button all populated items in the list.
    this is my code.
    the interesting thing is, that this code works before I import xml data, but as soon as i import xml data, it doesnt work anymore.
    Do you have any idea, what the problem is and how can I fix it?
    and second question. Is it possible deselect single items, when all are selected?
    var temp1 = "";
    for (i=0;i< PAGE3.ListBox1.length.rawValue;i++){
        temp1 = temp1 + ListBox1.getDisplayItem(i) + "\n";
    ListBox1.rawValue = temp1
    Thank you in advance for any help!!
    Diana

    The code should work as long as you set "Allow Multiple Selection" at design time.
    However I will suggest small change to your code...try the following...
    var temp1 = "";
    for (i=0;i< PAGE3.ListBox1.length;i++){
        temp1 = temp1 + ListBox1.getDisplayItem(i) + "\n";
    ListBox1.rawValue = temp1
    Hold "Ctrl" btn for deselcting from the list.

  • Get All images from a website and put them in a listbox.

    Hi Everyone, I am new to Java Programming.
    I wanted to know if there is a way to get all the images in a website and put them in a listbox. And if an item is clicked in list box, view it in a picturebox.

    Harsimran_Singh wrote:
    what is the whole idea about .Net vs. Java...guys, .NET users are so friendly and helpful, they don't even judge english
    This is not putting a good impression of Java Users on me.good luck with .net. im sorry that things didnt work out with java.
    unfortunately, .net is essentially a clone of java so you may find that you will be looking
    to learn exactly the same things but for an expensive propriety platform.
    if you change your mind, read:
    [swing tutorials|http://java.sun.com/docs/books/tutorial/uiswing/]
    jlist
    listcellrenderer
    [list tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]
    [advanced list programming|http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html]
    on your way out thank the moderators : )

  • How to select multiple values from a listbox

    Hi,
    I have a list box on my UI which is not allowing me to select multiple values
    I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving error
    When i drag & drop the component i am unable to drop it as a multi select list box that option is not coming.
    I am working on Jdev 11.1.1.3 and I am using ADF/BC components
    How to select multiple values from a listbox ?
    Thanks,

    Hi,
    I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving errorank
    And what is the error ?
    Frank

  • Removing selected items from listbox

    Hi ADF Experts,
    I have a selectmanylistbox with few values displaying in UI and a Remove Button at the bottom.
    User selects certain items from the listbox and clicks on Remove button. The selected items should be reomved. Can anybody suggest how to do this.
    Thanks,
    Animesh

    Duplicate of https://forums.oracle.com/thread/2562542
    User, please don't ask the same question multiple times. If you don't get the answer you want it may be because you did not give the right information and or use case me understand.
    Timo

  • Getting selected value from Listbox

    Hi,
    I have populated my listbox on the selection screen using the function module VRM_SET_VALUES.
    How do I get the value which is selected from the list box.
    Where is the selected value in the listbox stored.
    Thanks,
    Abhishek

    The code I used is:
    Another issue is that whenever I select any value in the listbox it is not displayed on the screen. It becomes blank again.
    PARAMETERS:  p_prin  AS LISTBOX VISIBLE LENGTH 30 USER-COMMAND sele.
      DATA: i_printers TYPE STANDARD TABLE OF frprlist,
            wa_printers TYPE frprlist.
      DATA: l_name  TYPE         vrm_id,
            i_list  TYPE         vrm_values,
            l_ctr   TYPE         i VALUE 0,
            wa_value LIKE LINE OF i_list.
      CLEAR: wa_value.
    Get printers
      CALL FUNCTION 'RSPO_FRONTEND_PRINTERS_FOR_DEV'
        EXPORTING
          device         = p_print
        TABLES
          list           = i_printers
        EXCEPTIONS
          no_list        = 1
          list_truncated = 2
          name_not_found = 3
          OTHERS         = 4.
      IF sy-subrc EQ 0.
    Populate to drop down box
        l_name = c_prin.
        LOOP AT i_printers INTO wa_printers.
          l_ctr = l_ctr + 1.
          wa_value-key = l_ctr.
          wa_value-text = wa_printers-prname.
          APPEND wa_value TO i_list.
          CLEAR wa_value.
        ENDLOOP.
        CALL FUNCTION 'VRM_SET_VALUES'
          EXPORTING
            id              = l_name
            values          = i_list
          EXCEPTIONS
            id_illegal_name = 1
            OTHERS          = 2.
        IF sy-subrc NE 0.
    Do nothing
        ENDIF.
      ENDIF.
      CLEAR: l_name, l_ctr, wa_value, i_list.

  • Display selected item from Listbox

    hi,
    i get <h:selectOneListbox> value from database, now i want to know which item is selected in the listbox
    my JSP code is
    <h:selectOneListbox binding="#{DynamicListBean.std_list_lbx}" id="std_list_lbx" immediate="true"
                                onchange="common_timeoutSubmitForm(this.form, 'std_list_lbx');" required="true" size="5"
                                style="height: 312px; left: 168px; top: 192px; position: absolute; width: 216px" value="#{DynamicListBean.selectedCategory1}" valueChangeListener="#{DynamicListBean.std_list_lbx_processValueChange}">
                                <f:selectItems id="listbox1SelectItems1" value="#{DynamicListBean.items1}"/>
                            </h:selectOneListbox>Java code is public String getSelectedCategory1() {    
            return selectedCategory1;
        public void setSelectedCategory1(String selectedCategory1) {
            this.selectedCategory1 = selectedCategory1;
    public void std_list_lbx_processValueChange(ValueChangeEvent vce) {
            connection();
            int n1 = 0;
            String a = "";
            if (con != null) {
                try {
                    stmt = con.createStatement();
                    String query = "select std_id, std_name from std_detail";
                    rs = stmt.executeQuery(query);
                    String iddata = "";
                    if (rs != null) {
                        while (rs.next()) {
                            iddata = rs.getString("std_id");
                      //      System.out.println(rs.getInt("std_id"));
                            stmt1 = con.createStatement();
                            String query1 = "select chpt_detail from chapter_detail right outer join std_detail on chapter_detail.std_id = std_detail.std_id where chapter_detail.std_id = " + iddata + " ";
                            String data3 = "";
                            rs1 = stmt1.executeQuery(query1);
                            if (rs1 != null) {
                                while (rs1.next()) {
                                    data3 = rs1.getString("chpt_detail");
                                    chpt_lst_lbx.setValue(data3);
                                    dList2.add(data3);
                                stmt1.close();
                                rs1.close();
                                List selectItems = new ArrayList();
                                Iterator it = dList2.listIterator();
                                while (it.hasNext()) {
                                    String label = (String) it.next();
                                    chpt_lst_lbx.setValue(label);
                                    selectItems.add(new SelectItem(label));
                                items2 = (SelectItem[]) selectItems.toArray(new SelectItem[0]);
                        stmt.close();
                        rs.close();
                        con.close();
                } catch (Exception e) {
                    System.out.println("Sorry failed to display values from the database table. " + e.getMessage());
                    System.out.println(e);
        }any idea or suggestion tell me

    You usually use the property behind value="#{DynamicListBean.selectedCategory1}" for that. But in your case you'll need the vce.getNewValue() as the valueChangeListener is been invoked before the property is been set.
    Having said that, your code is terrible. Please read on about the DAO pattern. Further on, did you know that you can also just use List<SelectItem> instead of SelectItem[] as f:selectItems value?
    If you want to populate child menu's, you may find this article useful to avoid future and painful problems: [http://balusc.blogspot.com/2007/10/populate-child-menus.html].

Maybe you are looking for

  • How do i set my time capsule as a wireless external hard drive?

    it is currently doing regular automatic back-ups of our system, but we want to set it as our hard drive as well.

  • Work Manager 6.1 Initialize / Default Collection

    Hi, I'm trying to default the Crew Member Collection from a complex table when the application initializes. I have added a Sub-Action to the Transmit Action which has an Enable Rule to determine if it executes. My issue is when I launch the Agentry A

  • Org structure table

    Hi,    can anyone send me the tables where the attributes of the organization unit is stored. my requirement is that i need to upload the attribute (WBS element in mycase) for the organization units from an excel sheet to the relevant tables so that

  • Safari wouldn't work

    Not sure if this will be helpful to some readers, however, after loading 2.2, I found that Safari was 'stuck': ie; I could not log on to the Internet, though other downloads worked, such as 'Mail', 'YouTube', etc. I 'restored factory settings', then

  • How do you save a pic as a .jpg file so I can email it as a file and not as a pic?

    Have 6 pics in an album and want to save them individually in a .jpg file.  Will email and recipient will select which 2 or 3 he will use in a newsletter.  When I select "email" it just attaches a pic to the message - my guy needs a jpg file!  Thx so