How to get the current selected value of a combo box or a option button?

Hello All,
I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
But I don't know how to do that, can any one send any example code for this.
Regards,
Sudeshna.

Hi Sudesha,
If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
        Dim oForm As SAPbouiCOM.Form
        Dim oCombo As SAPbouiCOM.ComboBox
        Dim oData As SAPbouiCOM.UserDataSource
        oForm = oApplication.Forms.Item("MyForm")
        oCombo = oForm.Items.Item("myComboUID")
        oApplication.MessageBox(oCombo.Selected.Value)
        oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
        oApplication.MessageBox(oData.ValueEx)
Hope it helps,
Adele

Similar Messages

  • How to get the previoulsy selected value in a combobox

    How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

    Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
            comboBox.addItemListener(new ItemListener() {
                Object prevValue;
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        //do what you need with prevValue here
                    } else {
                        prevValue = e.getItem();
            });

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • How to get the current zoom value in ID?

    Is there any way that can get the current zoom value in InDesign?
    Thanks a lot.

    You could peek at the widget indicated in your screen shot, at least when that MDI (?) frame is showing.
    The window title at kLayoutPresentationBoss, IID_IDOCUMENTPRESENTATION also reflects the value.
    Probably best would be the kLayoutWidgetBoss, with its IID_IPANORAMA, GetXScaleFactor() - and GetYScaleFactor()!!!
    I just try to imagine how a document would look if these differ from each other ;-) and, even better, how to achieve that from the UI.
    Btw, one notification is on kDocWorkspaceBoss, protocol IID_IWINDOW, command kUpdateDocumentUIStateCmdBoss.
    Another one: there is a kDocWindowTitleModifyService ...
    Edit: of course I should again mention IID_IPANORAMA, observable from kLayoutWidgetBoss subject.
    Dirk

  • VS2013 / Team Explorer vsix - How to get the currently selected build definition?

    Greetings,
    My goal with a simple extension is to right-click any build definition and if my "Show Build Def Stats" menu item is selected, pop a message box with some summary details I plan to pull from the IBuildDefinition interface.
    I'm missing something fundamental I'm sure, but I cannot figure out how in the menu handler the actual build definition that I clicked on.
    The menu command is added where I want it successfully:
    Symbol info used to get this there:
        <!-- This is the Build Definition Context Menu -->
        <GuidSymbol name="guidTeamExplorerBuildDefContextMenu" value="{34586048-8400-472E-BBBF-3AE30AF8046E}" >
          <IDSymbol name="menuBuildDefinitionContext" value="0x109"/>
        </GuidSymbol>
    I am stumped as to how to get the fact that I clicked the "ISRepository" build definition in either the Initialize() or MenuItemCallBack() methods, I haven't come across the right service or container object that I recognize.
    Much obliged!
    --Jordan

    I have been investigating this for a while using .NET Reflector and finally I got it:
    In VS 2013, add references to the following assemblies in the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer:
    Microsoft.TeamFoundation.Controls.dll
    Microsoft.TeamFoundation.Build.Controls.dl
    And then use this code:
    Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
    Microsoft.TeamFoundation.Controls.ITeamExplorerPage teamExplorerPage;
    Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt buildsPageExt;
    teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) as Microsoft.TeamFoundation.Controls.ITeamExplorer;
    teamExplorerPage = teamExplorer.CurrentPage;
    buildsPageExt = teamExplorerPage.GetExtensibilityService(typeof(Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt)) as Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt;
    foreach (Microsoft.TeamFoundation.Build.Controls.Extensibility.IDefinitionModel definitionModel in buildsPageExt.SelectedDefinitions)
    System.Windows.Forms.MessageBox.Show(definitionModel.Name);
    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

  • How to get the current selected column and row

    Hi,
    A difficult one, how do i know which column (and row would also be nice) of a JTable is selected?
    e.g.
    I have a JButton which is called "Edit" when i select a cell in the JTable and click the button "Edit" a new window must be visible as a form where the user can edit the a part of a row.
    Then the column which was selected in the JTable must be given (so i need to know current column) and then i want the TextField (the one needed to be edited) be active with requestFocus(). So it would be
    pricetextfield.requestFocus();
    Problem now is that i have to click every time in the window the JTextField which was selected in the JTable. I have chosen for this way of editing because my application is multi-user and it would be too difficult for me when everybody did editing directly (catch signals, reload data, etc.).
    My question is how do I know the current column and the current row in a JTable?

    I'm not sure what your mean by the "current" row or column, but the following utility methods return
    which row and column have focus within the JTable.
    public static int getFocusRow(JTable table) {
        return table.getSelectionModel().getLeadSelectionIndex();
    public static int getFocusColumn(JTable table) {
        return table.getColumnModel().getSelectionModel().getLeadSelectionIndex();
    }

  • How to get the current node element by its value?

    e.g,:
    wdContext.current<b>Deal</b>Element().setAttributeValue("<i>deal_id</i>","<i>aaaaaaa</i>");
    above code can get the result i wanna.
    but now i wanna in terms of its node'name to  set attribute vaue of itself. in other words,i have no idea about how to get the current node element by its name"<b>Deal</b>".

    Hi Wing,
    The answer is there in your question itself.
    wdContext.currentDealElement()
    will give you the current node element by its name"Deal" or you could use
    wdContext.nodeDeal().getCurrentElement()
    or you could use
    wdContext.nodeDeal().getElementAt(wdContext.nodeDeal().getLeadSelection())
    Regards,
    Sudeep

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • How to get the current slide Index or Id?

    I can get the selected slide of presentation use blow method.
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (asyncResult) {
    if (asyncResult.status == Office.AsyncResultStatus.Failed) {
    write('Action failed. Error: ' + asyncResult.error.message);
    else {
    write('Selected slides: ' + JSON.stringify(asyncResult.value.slides));
    But, How can I get the executor slide?

    ​Hi,
    >> How to get the current slide Index or Id?
    In my option, when you select a slide, it change to current slide. So, you could use the getSelectedDataAsync method to get the current slide, and then get the index or id by using the Slice object. You could refer the link below for Slice Object.
    # Slice.index property (JavaScript API for Office)https://msdn.microsoft.com/EN-US/library/office/jj715285.aspx?f=255&MSPPError=-2147217396
    Some key code as below:
    <script>
    function getText() {
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange,
    { valueFormat: "unformatted", filterType: "all" },
    function (asyncResult) {
    var error = asyncResult.error;
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    write(error.name + ": " + error.message);
    else {
    // Get selected data.
    var dataValue = asyncResult.value;
    write('Selected data is ' + dataValue.slides[0].index);
    // Function that writes to a div with id='message' on the page.
    function write(message) {
    document.getElementById('message').innerText += message;
    </script>
    >> How can I get the executor slide?
    What do you mean by this? Is this a new issue which is different from the above issue? If so, I will recommend you post a new thread for this issue and share us more information about this.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • How to get the "current date" in the BEx?

    Hi all,
    I need to get the "current date" in my Bex report in order to make a comparison. I know there is a "How to" which shows how to get the current date via a User Exit, but I didn't find it. Could you please help me?
    Thanks

    1. Create a  New Formula in Key Figures structure
    2. Give tech name and description and Select "New variable" option
    3. Next screen will launch Variable Wizard -> create a new variable with replacement path as processing type
    4. in next screene  select the date characteristic that represents the first date to use in the calculation (From Date)
    5. In the next  screen select Key in the Replace Variable with field. Leave all the other options as they are
    6. In the next Currencies and Units screen select Date as the Dimension ID.
    6. Save variable
    repeate the Above steps to create another variable (To Date)
    and now you can use these two new replacement path variables in your new formula.
    Dev

  • How to get the current logical system?

    Dear Abapers:
    I can't find the logical system value from the table SYST, pls tell me how to get the current logical system name, Thanks!

    Hi,
    Check with the table T000, the Logical system field name is LOGSYS.
    Regards
    Thiru

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

Maybe you are looking for

  • Disable webex connect

    Hi. I set up Jabber for connection to Unified Presence server, but when Jabber starts, tries to open go.webex.com/...(I see it on Wireshark and on proxy firewall) Therefore it always displays a window with request of login and password for our proxy

  • Menu/Title page of DVD blurry

    I have a new MacBookPro and just tried to burn my first DVD in iDVD8. I used 7.0 Themes - Centerstage. When I playback the DVD, the text on the main menu/title page looks fuzzy. Not crisp like in iDVD. I checked the DVD on: '08 MacBookPro, 1440x900x3

  • Reading Payroll Run

    I need to read payroll runs but payroll must be in Exit status before reading payroll run. how can i do this.........plz send some sample code.

  • How to open a RPD, from a linux folder? OBIEE 11g

    Hi, How to open a RPD, from a linux folder? Is there a tool, or any command line command to open the RPD? Thanks for your time and help.

  • Get transactional currency total based on currency type

    hi, i have created a custom report related to fi which is working fine. but now the issue is in that report we r having a transaction currency field WRBTR.the users want to calculate totals based on currency. for example my output is tran curr  curr