How to fill a  drop down box  in a  webdynpro application

Hi friends ,
               i am facing one problem while  filling a   dropdown box with  some  hot  coded values :  " High","Medium","low"..etc..
drop down box  having  fixed  elements   always.....
means  all values  should be  static and i  have to fill it  at design time  only..
can  any body  pls  reply  for the   above same......
Thanks and  Regards
Ratnakar reddy

Hi Ratnakar,
If u r using Dropdown By Key, u can use the method that Armin suggested.
If u r using Dropdown By Index, then do the following
Let ur View Name be 'MyView'
1. In ur View Context,Create a Node(Say Root) of Cardinality 0..N
2. Create a value attribute(Say Name) in 'Root'.
3. In wdDoInit(), add the following code
IPrivateMyView.IRootNode rNode=wdContext.nodeRoot();
IPrivateMyView.IRootElement rEl=rNode.createRootElement();     
rNode.addElement(rEl);
rEl.setName("HIGH");
rEl=rNode.createRootElement();
rNode.addElement(rEl);
rEl.setName("MEDIUM");     
rEl=rNode.createRootElement();
rNode.addElement(rEl);
rEl.setName("LOW");     
Hope this be Helpful
Fahad Hamsa

Similar Messages

  • How to fill the drop down menu in screen programming

    Hi, Experts,
    I have a drop down menu on the screen I want to fill that drop down menu with different values how can I do that I think that there are to ways
    Value List      from     dist/flow logic
                          A from program
    Please help me out in this way.
    Kind regards,
    Faisal.

    Hi Faisal,
      VRM_SET_VALUES function module is used to display drop down values in the screen.
    Use the following code
    * Selection screen elements                                            *
    SELECTION-SCREEN BEGIN OF BLOCK BLC1 WITH FRAME
                                        TITLE TEXT-000.
    PARAMETERS:
      P_BUKRS  TYPE BKPF-BUKRS OBLIGATORY  " Company code
               DEFAULT '1000',
      P_WERKS  TYPE VBRP-WERKS OBLIGATORY. " Plant
    SELECTION-SCREEN SKIP.
    PARAMETERS:
      P_GJAHR TYPE BKPF-GJAHR OBLIGATORY,  " Fiscal Year
      P_QUAT  TYPE CHAR20                  " Quarter
                AS LISTBOX VISIBLE LENGTH 30
                LOWER CASE OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLC1.
    Data:
    * To hold quarter details, these details are used to display in list box of
    * the parameter called Quarter in the selection screen.
      T_QUARTERS TYPE VRM_VALUES.
    *              AT SELECTION-SCREEN ON VALUE-REQUEST                    *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_QUAT.
    * To fill quarters......................................................
      PERFORM FILL_QUARTERS.
    * To display quarters in dropdown box...................................
      PERFORM DISPLAY_QUARTERS.
    * FORM DISPLAY_QUARTERS                                                *
    * This subroutine is used to display quarters in the dropdown box.     *
    * There are no interface parameters to be passed to this subroutine.   *
    FORM DISPLAY_QUARTERS .
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID              = 'P_QUAT'
          VALUES          = T_QUARTERS[]
        EXCEPTIONS
          ID_ILLEGAL_NAME = 1
          OTHERS          = 2.
      IF SY-SUBRC NE 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.                               " F SY-SUBRC NE 0.
    ENDFORM.                               " DISPLAY_QUARTERS
    * FORM FILL_QUARTERS                                                   *
    * This subroutine is used to fill quarters.                            *
    * There are no interface parameters to be passed to this subroutine.   *
    FORM FILL_QUARTERS .
    * Local field string declaration........................................
      DATA:
    * Field string to fill quarters in the year.
        LFS_QUARTERS TYPE LINE OF VRM_VALUES.
      REFRESH T_QUARTERS.
      LFS_QUARTERS-KEY  = '1'.
      LFS_QUARTERS-TEXT = TEXT-QU1.
      APPEND LFS_QUARTERS TO T_QUARTERS.
      LFS_QUARTERS-KEY  = '2'.
      LFS_QUARTERS-TEXT = TEXT-QU2.
      APPEND LFS_QUARTERS TO T_QUARTERS.
      LFS_QUARTERS-KEY  = '3'.
      LFS_QUARTERS-TEXT = TEXT-QU3.
      APPEND LFS_QUARTERS TO T_QUARTERS.
      LFS_QUARTERS-KEY  = '4'.
      LFS_QUARTERS-TEXT = TEXT-QU4.
      APPEND LFS_QUARTERS TO T_QUARTERS.
    ENDFORM.                               " FILL_QUARTERS
    Regards,
    Mahi.

  • How to create a drop down box and text box in screen painter?

    Hi i am totally new to this concept of screen painter..please can any tell me
    how to create drop down box in screen painter?
    How to create or display default date and time values?
    How to create text box for giving comments?
    How to store the records that we are entering in a table?
    Please can any one send me the procedure for creating all these its very urgent useful information will be surely rewarded.

    Hi,
    Check all these.
    1.how to create drop down box in screen painter?
    To get Drop Drown Box on screen .
    Follow these steps.
    1.
    Go to T.Code SE51 and Select Laypout for the Screen.
    2.
    Double click on the field for which u want Dropdown box.
    3.
    Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box or ListBox with key . Better to to select first one.
    4.
    Save and Activate ur screen .
    5.
    Enter the following piece of code in the PBO of the screen.(Change for ur requirement).
    6.
    The following code should be written under PROCESS BEFORE EVENT in the MODULE.
    TYPE-POOLS :vrm.
    DATA:
      i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
      w_natio LIKE LINE OF i_natio.
    DATA:
    BEGIN OF i_t005t OCCURS 0,
        land1 TYPE t005t-land1,
        natio TYPE t005t-natio,
    END OF i_t005t.
    IF i_t005t[] IS INITIAL.
      SELECT land1 natio
         FROM t005t
           INTO TABLE i_t005t
       WHERE spras = sy-langu.
      IF sy-subrc = 0.
      LOOP AT i_t005t .
          w_natio-key = i_t005t-land1.
          w_natio-text = i_t005t-natio.
          APPEND w_natio TO i_natio.
          CLEAR w_natio.
      ENDLOOP.
      ENDIF.
    ENDIF.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
                          id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
                    values = i_natio
    EXCEPTIONS
       id_illegal_name = 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.
    2.1.How to create or display default date and time values?
    1.
    create input field for DATE and TIME on screen.ex. DATE1 and TIME1 are screen field names .
    2.
    Just assign SY-DATUM to DATE1 and SY-UZEIT to TIME1 under PROCESS BEFORE EVENT.
    3.How to create text box for giving comments?
    1.
    Define one variable in the TOP include with type STRING means Global variable.
    2.
    Create one input field by giving screen field name which u have defined in the above step.
    4.How to store the records that we are entering in a table?
    For this case.. Create one table control. you can select one record and create record in the Z table by pressing button on Application toolbar..
    Check the following steps to handle Table control.
    1).
    U should take one variable in your internal table or in structure which
    is used for table control fields
    ex :
    data :
    begin of itab occurs 0 ,
        mark type c , "This is to select the record.
        matnr like mara-matnr ,
        matkl like mara-matkl,
        maktx like makt-maktx,
    end of itab .
    Controls: TABC types TABLEVIEW using screen 100.
    2).
    This mark variable should be given in Table control properties.
    follow the path
    double click on the table control-->attributes .->select
    w/SelColumn and in that itab-mark. Check in the figure.
    [Table control properties screen|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
    3).
    After that. Take this example.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL tabc
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    LOOP AT ITAB.
       Module read_table_control.
    ENDLOOP.
    module user_command_0100.
    In this Module read_table_control, You should write the following code
    MODULE read_table_control INPUT.
    MODIFY itab INDEX tabc-current_line."( This will update the
    "ITAB table MARK field with 'X ' whatever we have selected
    "on table control.)
    ENDMODULE.
    4)
    If you want to Delete some of the records from Table control
    follow this code …Create one pushbutton and give Fucnction code to that
    and write below code
    CASE OKCODE.
    WHEN 'CREATE'.
    LOOP AT itab WHERE mark = 'X'.
    "Use UPDATE statement to create new record.
    ENDLOOP.
    ENDCASE.
    I hope that you will get something.
    Regards,
    Venkat.O

  • How to create a drop down box values on design time?

    Hello,
    I have a drop down box that I would like to edit on design time to have the valus 1 to 10.
    Is it possible to doo it on design it or do I have to create a loop in the code to do that?

    See go to LocalDictionary->Data Type-> SimpleType Right Click and create a Simple Type giving some Package Name
    Once u have created
    There u will see Enumeration Tab and give Key Value Pairs by pressing New Button
    Now Create a Context Attr and at Type property select that three dots
    Then go to Dictionary Simple Type and select the Package u have given
    then select the Simple type u have created
    Then assign the context Attr to the UI Element
    Message was edited by: krish kanth

  • How do I disable the drop down box which appears below the Search Box (which shows previous searches) when I start typing in my search topic

    Hi I would like to know how to disable the drop down box which appears below the search box on the start page when I start to type in my search topic. If for example the first letter I type in is an S then it shows a list of previous searches of sites beginning with the letter S.

    This is stored in the Firefox form history. For details of how to clear form history and prevent Firefox from storing any more form history see https://support.mozilla.com/kb/Form+autocomplete

  • How to handle Drop Down Box on Interactive Adobe Form

    Hi,
    On my adobe form there are some drop down boxes like company code, cost centre etc, actually i need F4 help on those fields,  but what i found is it's not possible to have F4 help on adobe form so i have choosen alternative as webdynpro acitvex drop down box in library. I have written a web dynpro application to fetch the data and display it on adobe interactive form, i could able to display the data for all the fields on adobe form except these drop down boxes, can any body suggest me how to handle these drop down boxes in webdynpro application. Your help will be greatly appreciated.
    Thansk & Regards,
    Venkat

    Hi Venkat,
    As you are using the WDP ActiveX dropdown in your form, it is fine but to populate values in the DD, you need to bind the context attribute with a simpletype and then populate the values. Use the below code to obtain a ModifiableSimple Type:
    IWDAttributeInfo abcInfo = wdContext.nodeABC().getNodeInfo().getAttribute("AttributeName");
                        ISimpleTypeModifiable def = abcInfo.getModifiableSimpleType();
                        IModifiableSimpleValueSet abcValueSet = def.getSVServices().getModifiableSimpleValueSet();
    and after this put te values in the obtained modifieable simple type like below:
    abcValueSet.put(key,value);
    where key may be the ID and value may be the name to be displayed in DD.
    Reward points if found helpful.
    Regards,
    Arafat

  • Advice needed on the Drop-down box description.

    There are lots of postings on how to get the drop-down box working and there's even a How-to guide called Dropdown boxes. However, I have a field (defined using the AET tool) which has an Search help assigned, so the drop-down list is automatically displayed for me. Having said that I'm still bemused as to how it works as there's no code in the P and V Getter methods.
    Anyway, that aside, the dropdown box is working fine, as mentioned, but I also have the description field to populate with the description of the value returned by the drop-down box. In my case it's a Department code and associated description.
    Initially, I inserted code in the SET_DEPT method to lookup the description (using a SELECT statement) and place the result in the DEPT_DESC field. However, this method is not being called, I don't think, or at least my break point is not being reached.
    So I'm looking for somewhere to place the code which will be called when the DEPT field changes value, and I can then lookup the description and populate the DEPT_DESC field.. Both the DEPT and DEPT_DESC fields are in the same context node by the way.
    It's a real pity that when you create new fields in the AET tool you can't relate one field to another or somehow use a search help and say that the source is another field and this field will hold the result, or something like that.
    Jason

    Hi,
    It was said that the SET_* method will be called when you press enter on the view to trigger a server round trip.
    For your case, I'd like to suggest you take standard coding for example.
    That is the categorization in service ticket view in IC_AGENT role.
    When select the first category, if the second category only has one value, it will be automatically set. which should be similar to your requirement.
    component view GSMCDDLB/DropDownList
    call stack is
    METHOD SET_FIELDS      CL_GSMCDDLB_DROPDOWNLIST_IMPL=CP
    METHOD EH_ONCATCHANGE  CL_GSMCDDLB_DROPDOWNLIST_IMPL=CP
    METHOD DO_HANDLE_EVENT CL_GSMCDDLB_DROPDOWNLIST_IMPL=CP
    when a value is selected in the first dropdown, an event is triggered, you may debug and find out your event, and make the codings in EH_* method.
    set value for other field is some what simple also, like that in
    METHOD SET_FIELDS      CL_GSMCDDLB_DROPDOWNLIST_IMPL=CP
    CALL METHOD lr_dropdownlist->if_bol_bo_property_access~set_property
    If the first field is not a dropdown, for example a field with F4 help, after select the value from the popup, there will be event SELECT_OBJECT triggered for the view I tested.
    You may put breakpoint in do_handle_event for the controller class and observe what event was triggered.
    Then make the relevant coding.
    Hope could do help!
    Hongyan

  • Drop down box in OIM

    Hi All,
    How to creare a drop down box (list box) in OIM instead of Lookup. Is it possible?
    Thanks & Regards
    Inbaa

    It can be done using "ComboBox" option.
    Thanks Rajiv.
    Edited by: Inbaa on Sep 29, 2009 8:53 AM

  • Text elements in drop down box

    Hi,
    I am working on text elements in drop down box for service request application. I have a requirement that the display of text elements in PCUI should be in such a way that
    depends on the role of the user. eg: for role 'X' some  text elements should be displayed and role 'Y' remaining text elements should be displayed. In SAP GUI all text elements should be displayed. I copied MAC of text data to ZCL_CRM_BSP_AM_SLS_TM and tried to add the logic in methods IF_CRM_BSP_MODEL_ACCESS_IL~GET_ALLOWED_DDLB_VALUES
    IF_CRM_BSP_MODEL_ACCESS_IL~FILL_DROPDOWN_LISTBOX
    when i put external break point none of this methods are touched. Instead it goes to the methods of the class CL_CRM_BSP_TEXTMANAGEMENT_SC. This method is buried deep inside. Should i copy all the standard classes above this class and do the modification? Is there any other way? Any help is highly appreciated.
    Kind Regards,
    Charan

    Hi Charan,
    You have mentioned that in GUI all text elements have to be displayed. Why is it so?
    If that's not the case then you can control it in PFCG authorizations. Object CRM_TXT_ID.
    If you provide authorizations for a specific role for specific text ids only, the same would reflect in PCUI also. Others may not appear in the dropdown.
    Please try.
    Regards,
    J.Prabananth

  • OnSelect event for a Drop down UI Element in Webdynpro ABAP Select Options

    Hi Experts
    We have built our UI based on the webdynpro ABAP Select Options. We have a requirement that, when we change the value of a drop down box in the UI, I need to hide some fields. Can anybody help me out in handling of OnSelect event of a drop down box built using webdynpro ABAP Select Options. We are on SAP Netweaver 7.0 EHP1.
    Rrgards,
    Srikanth.
    Edited by: Srikanth Kancherla on Apr 29, 2010 10:43 PM

    Hi Srikanth,
    as you seem to be already aware, the component is dynamically built.
    so you would have to enhance the code that builds the element and insert a reference to a new action (enhancement) that could handle the onSelect event.
    What is it about this that you particularly want help with?
    Cheers,
    Chris

  • How do I set a "force-fill" to a drop-down box?

    How do I require the drop-down boxes to be filled prior to submitting?  I already have the "required" box checked.  I'm guessing that maybe why the required is not working is due to the blank I have at the top of the list.  I did that so upon opening the document the boxes appear blank & need a selection entered.  This is what it looks like when I remove the blank.

    Thanks for replying.  Although, I may need a “dumbed” down version of your response…Let me see if I understand correctly.  I cannot require a recipient to select an option in a drop down box.  Or is that only the case if I have a blank within the list?  I’m fairly new to the Adobe Forms (read: no formal training…just bumbling along on my own), so I have no idea what setting the property to true means or how to do custom scripting.
    Respectfully,
    Michelle Wessels
    Probation Education
    Education Services Division
    Arizona Supreme Court
    Administrative Office of the Courts (AOC)
    (602) 452-3010 * (602) 452-3004 Fax
    [email protected]<mailto:[email protected]>
    cid:[email protected]
    Main AOC Mailing address:  1501 W. Washington * Phoenix, AZ  85007
    Judicial Education Center/Office Location Address:  541 E. Van Buren, Suite B4 * Phoenix, AZ 85004

  • I typed my username and then my password for an account into the username field accidentally. now i start to type username and drop down box gives option of using this to fill username field. how do i get it to stop?

    When start to enter username ("un")for an account that I use firefox suggests previously typed ones in drop down box. Accidentally typed a password next to my un, now everytime i begin to type un this presents as option i can click on to fill un field. If someone else wanted to login to own account on my comp firefox would show this. not secure. suggestions?

    Remove saved Password(s): [http://kb.mozillazine.org/Menu_differences Firefox > Preferences] > Security: Passwords: "Saved Passwords" > "Show Passwords"
    * http://kb.mozillazine.org/Deleting_autocomplete_entries

  • How to populate data in drop down box dynamically in adobe form?

    Dear Experts.
    I am new to adobe interactive form can anybody please tell me how to fill data in a drop down box dynamically? I am using webservices method.
    Thanks in advance.
    Chitta Ranjan Mahato
    Edited by: mahato123 on Aug 5, 2011 12:16 PM

    you can create a method to populate the context attribute that you are using to map to your dropdown box.
    DATA: node_info TYPE REF TO if_wd_context_node_info.
    DATA: it_table TYPE wdr_context_attr_value_list.
    ** select your dropdown data into it_table and pass it to your context attribute.
    ** here, mine is call PROJ_TYPE - the values should appear in your dropdown.
      node_info->set_attribute_value_set(
         name      = 'PROJ_TYPE'
         value_set = it_table ).

  • How to get values from a multiple drop-down box.

    On my first page, I have a multiple drop-down box as the following code.
    <select name="selInterMethod" class="textbox" multiple>
    <option selected value="CH">Chicago</option>
    <option value="NY">New York</option>
    <option value="SF">San Francisco</option>
    </select>
    On my second transaction page, I need to save "CH-NY" into my Database column: city if the user selected Chicago and New York.
    How can I accomplish this in JSP?
    Thanks for your help.

    I figured out the solution. Here it is. FYI
    String inter_method = "";
    String Inter_Method[]=request.getParameterValues("selInterMethod");
         if( Inter_Method.length > 0 ) {
              for (int i = 0; i < Inter_Method.length; i++) {
                   inter_method = inter_method + '-' +Inter_Method;
              inter_method = inter_method.substring(1,inter_method.length());
              System.out.println("trx inter_method = " + inter_method);

  • How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    Hello,
    Try Mail>Preferences>Accounts icon>Account Information tab>Click on the Outgoing SMTP server drop down, choose edit Server list, highlight the old one & click Remove.
    (Such convolution is worthy of Windows® in my estimation)

Maybe you are looking for