Refresh and combobox

Hi all,
I need to develop a really small add-on for a client. This add on is suppose to handle this action:
When the user clicks on add when he is on the BP master data screen, the add-on will create a project code based on the BP Code and select the new project code in the combox before adding the BP.
Everything is working expect selecting the new project code before adding the BP. One of the issue is that I can't see the new project code until I reload the screen (I tried with a refresh but it does not work).
The second issue is that I don't know how to select my new project code in the combox. Can anyone help me?
Vincent
Here is the code if you think you can help me:
Select Case pVal.EventType
    Case et_LOST_FOCUS:
    Case et_FORM_LOAD:
        Set frm = SBO_Application.Forms(FormUID)
    Case et_ITEM_PRESSED:
    ' If user clicks on Add the business partner
    Case et_CLICK:
        If pVal.ItemUID = "1" And pVal.Before_Action = True Then
            Set frm = SBO_Application.Forms(FormUID)
            ' Check that we are in Add mode
            If frm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
                ' Item 5 is the BP Code
                Set oItem = frm.Items.Item("5")
                Set oTextField = oItem.Specific
                Set oRecordSet = oCompany.GetBusinessObject(BoRecordset)
                ' Check that the Project code soes not exist already
                stext = "SELECT PrjCode FROM OPRJ WHERE PrjCode='" & oTextField.String & "' "
                oRecordSet.DoQuery (stext)
                ' If not, we can create the new project code
                If oRecordSet.RecordCount = 0 Then
                    stext = "INSERT INTO OPRJ VALUES ('" & oTextField.String & "' ,'" & oTextField.String & "','N','I',1)"
                    oRecordSet.DoQuery (stext)
                    ' 222 is the project code combobox
                    Set oItem = frm.Items.Item("222")
                    Set oCombo = oItem.Specific
                    ' Refresh the screen to see the new value
                    frm.Refresh
                    'Here I don t know how to select the new value in the combobox
                Else
                    SBO_Application.MessageBox "Code already exists"
                End If
                Set oItem = frm.Items.Item("41")
                Set oTextField = oItem.Specific
                If oTextField.String = "" Then
                    BubbleEvent = False
                    SBO_Application.SetStatusBarMessage "Tel1 is a mandatory field", SAPbouiCOM.BoMessageTime.bmt_Short, True
                Else
                    BubbleEvent = True
                End If
            End If
        End If
    End Select
Exit Sub
errhandler:
  SBO_Application.MessageBox "Rel. 6.2 SP1: At the moment can't make items visible which are not user defined", 1, "OK", "", ""
End Sub
Thanks a lot
Vincent

You can select an item in the combo box as follows:
Set sboCombo = sboForm.Items("222").Specific
sboCombo.Select "My Project", psk_ByDescription
I think you will not be able to see your new project in the list due to the timing of when the list is populated.  It would probably be easier to simply update the BP record using the DI after it has been added to the database.  (et_ITEM_PRESSED, before_action = False).
John.

Similar Messages

  • How to schedule macros to open a report , refresh and update database?

    Hi,
    We have the below set of steps that work on a deski environment. It works fine on XI R3.1 Fix pack 1.5, but I am unable to schedule and get the macros to run although i've included the entire macros code in - Private Sub DocumentAfterRefresh()
    Refresh of report
    Step 1 : Report is Refreshed. Refreshed data contains 10 Report Names to be opened by the Macros and the prompt values that these reports need to be refreshed with.
    Macros Functionality:
    Step 1 : Opens 1st report of the 10 reports from the repository in deski thick client, updates the database by setting a flag on the processing to Y or N for the report being processed.
    Step 2 : Refreshes the report with the prompt values obtained from the first refresh in the report, saves the refreshed data to a CSV or PDF at a location.
    Step 3 : Updates the database if the report has been genrated or not and then deletes the local copy of the output csv and pdf.
    The above steps repeat over and over again until all 10 reports open up, get refreshed and update the database.
    Now all of this works on Deski thick client/refresh and macros.
    However, when i schedule it, the macros doesnot seem to be running.
    Is the above scenario even possible to replicate via a schedule process..? 
    Note : The reports need to be retained in Deski itself.
    PLz help...!

    Scheduling Background Jobs 
    Use
    You can define and schedule background jobs in two ways from the Job Overview:
    Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
    The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
    Procedure
    Call Transaction SM36 or choose CCMS ® Jobs ® Definition .
    Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
    Set the job’s priority, or "Job Class":
    High priority: Class A
    Medium priority: Class B
    Low priority: Class C
    In the Target server field, indicate whether to use system load balancing.
    For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
    To use a particular application server to run the job, enter a specific target server.
    If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
    Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
    Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
    Save the fully defined job to submit it to the background processing system.
    When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
    For a simple job scheduling procedure, see the R/3 Getting Started Guide.

  • TS3276 ppl i fed up with my mac air while using my exchange email account, it takes ages to refresh and it doesn't send or receive instantly , no clue although that the same setting and server names has been set up on my iPhone and it is working fine

    ppl i fed up with my mac air while using my exchange email account, it takes ages to refresh and it doesn't send or receive instantly , no clue although that the same setting and server names has been set up on my iPhone and it is working totally fine

    Install ClamXav and run a scan with that. It should pick up any trojans.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • Why can't I log in to my iTunes account (iPod Touch)? Whenever I put in the password it refreshes and keeps prompting me - it doesn't say it is incorrect, it just refreshes it.

    I just bought an iTunes card and was eager to redeem it. My iPod prompted me to log in as usual, but when I put in the correct password it just kept prompting me again. I've tried putting in my password to log in but it won't allow me to get into my account, rather it just refreshes and prompts me, and I've been doing this about ten times before I gave up. My internet connection is fine and all else is running smoothly.
    And no, it isn't the incorrect password. I have tried putting in an alternative password to check, before refreshing it said it was incorrect.
    With the correct password it'll just keep prompting me over and over so I cannot get in. This is really annoying and I don't know what to do as this hasn't happened before.
    If anyone knows what is going on please inform me.
    (Also: I cannot sync my iPod into any computers at the moment. I lost the previous computer and if I synced it with the new one I would lose everything on it, and some information on there is dear to me such as photos and videos. That is if I had a choice - computers with iTunes don't seem to recognise it as an iPod device, rather a camera which I can't take anything off of.
    This is another problem on its own, though.)

    Have you tried going to Settings>iTunes and App Stores (or just Store) and signing out and then signing in again?

  • I just got the new itunes and I can open itunes and see my music but whenI try and go to the itunes store it just loads to a white page. I try and refresh and go to the home page and nothing happens. I can sign into my account and the tabs for the itunes

    I just got the new itunes and I can open itunes and see my music but whenI try and go to the itunes store it just loads to a white page. I try and refresh and go to the home page and nothing happens. I can sign into my account and the tabs for the itunes store pop up like they normally would when browsing the itunes store but when I click on one of them, it is a blank page. Is there a setting I need to change? Does it just take an extremely long time to load? Please help!!

    Bucktr09:
    I'm having the exact same problem.  I upgraded to the newest version of iTunes on my iMac and ever since I did the store is a blank white screen.  I can get my library content but the store is a no go.  Is there any one out there with a solution?

  • With "New" twitter, as of a week or so ago, it constantly refreshes and I can't figure out how to make it stop. I wonder if it's tied to an add-on, plug-in, or extension? (FWIW, IE8 does not do this)

    Within the page for New Twitter, it is constantly refreshing the page. If I'm reading, it refreshes and I lose my place. If I'm typing a tweet it refreshes and deletes everything I've typed. I do not have any add-ons installed; basic list of extensions (Java Consoles; multiple versions), though I MS .net framework 1.1 has had trouble updating and is currently disabled and so is my Norton AV toolbar.
    Again this only started happening 7-10 days ago, and I wonder if there was an update to Firefox or an extension/plugin perhaps causing this. Have had to resort to using Twitter on IE8. :(

    Does it help if you make the Find bar (Ctrl+F) or the Add-ons bar (Ctrl+/) (Firefox > Options or View > Toolbars) visible?

  • How do I get all the control buttons in one place in 3.6.16, like they used to be in previous versions? Having the refresh and stop buttons between address and search windows, and the home button to the far right is awful.

    In 3.6.16, the buttons are all over the place. In previous versions, the forward, back, refresh, stop and home buttons were all together. In this version, the refresh and stop buttons are between the address and search windows, and the home button to the far right.
    I would love to have them all together as they used to be - much more user friendly that way. I have tried installing alternate themes, but the coding of this version over-rides the themes.

    Firefox 4.0 has a combined Reload and Stop and Go button that appears at the right end of the location bar.
    To restore the Firefox 3 appearance you can use these steps:
    * Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
    * Move the Reload and Stop buttons to their previous position at the left side of the location bar.
    * Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
    * Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons.

  • Tried to reinstall itunes and got apple application support not found. i have a folder on my desktop of apps removed during a refresh and all my apple stuff is in that folder.

    Im running windows 8 on my desktop. i tried to reinstall itunes and when i open it i get the following message " Apple Application Support not found, Apple Application Support is required to run iTunes". I have a folder on my desktop that has files in it that says Apps removed during refresh and  there is Apple files in there. Im guessing this could be a windows issue but Im not to good with computers. Any help would be great.

    Hello agerveler,
    Thanks for using Apple Support Communities.
    It sounds like we may need to do a complete removal of iTunes and its components, followed by a reinstall.  Follow the instructions in the following article to resolve your issue:
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Take care,
    Alex H.

  • Disable Refresh and back  facilty in a jsp page

    hi,
    I have a jsp page which makes entries in a db. to stop is doing it again (by refreshing the page) refresh facility is to be diabled. I do not want to use cookies or session . Can any one tell me how to disable refresh and back button in a html/jsp page
    Atishay

    i am bit new with jsp and i do not know how to use synchronization token
    howeever i think if we have a hidden input with value=0 and later make it one when entry is made in the db by the jsp page. But the problem is that i do not know how to check the value. Because each time we refresh the page the value of the variable will be initialized so a check can not be made.
    Also following will help
    <META HTTP-EQUIV="Expires" CONTENT="Fri, 1 Jun 2001 00:01:00 GMT">
    but how to take the time of the host machine which will run the jsp page.
    Thanks
    Atishay

  • Data fetch from table without Refresh and without using tab key.

    hi Friends,
    I have a problem i want to extract data from table without Refresh into text field without using Tab key. when i'll enter any value in a text field then corressponding value should come in to corressponding textfield without using Tab Key.
    eg. when i enter emp_id 101 in a text field then the first_name and last_name ,adress should come in to corressponding text fields without refresh and without using Tab key.
    How Can I do this.
    Thanks
    Manoj

    Hi Manoj,
    I assume that this is similar to: Data fetch without Refresh rather than Re: Value of one textfield should come into another textfield Without Using TAB ?
    If so, the only change you need to make on the first one is to use "onkeyup" instead of "onchange" in the item's "HTML Form Element Attributes" setting.
    Note, however, that the user must move away from the item at some point (for example, to click a button), so the onchange will be triggered anyway.
    Andy

  • What exactly is the difference between :"Refresh" and "Expand All"?

    They seem to do the same thing most of the time. What is the difference?

    Hi Dermot,
    Well, for a report that uses no expansions the time it takes for Refresh and Expand All should be about the same. Maybe a little bit faster for Refresh. But if your report does have expansions, Refresh should be significantly faster.
    Here is the list of what happens to each EVDRE in your workbook when you click the "Expand All" button: [http://help.sap.com/saphelp_bpc75_nw/helpdata/en/fb/b03d0099e8428d95eb7de2c964cf18/frameset.htm] It has 8 steps. I believe that when you click the "Refresh" button it only executes steps 3 and 4 (not completely sure about that, but you get the point - it doesn't do everything).
    Expand All can get especially problematic when you have a workbook with a large number of EVDREs. In this case, a nice option  is to right-click on the worksheet and take a look at the options under the top menu item. One of the options is to expand only the active sheet, which can save you a lot of time.
    Cheers,
    Ethan

  • I can't find preferences for the notes app. and every once in awhile some of my notes just disappear at start up, I see the name and then it refreshes and they are gone, very annoying. Can anyone tell me why it does this and how to stop it? thanks

    I can't find preferences for the notes app. and every once in awhile some of my notes just disappear at start up, I see the name and then it refreshes and they are gone, very annoying. Can anyone tell me why it does this and how to stop it? thanks

    Hi again, I am on an iMac using OSX 10.7.5, I"ve taken screenshots to show you I think my settings are correct

  • ChoiceBox and ComboBox

    Hi all,
    I am using Scene Builder and I have two questions about Choice Box.
    1) What is the difference between ChoiceBox and ComboBox? It seems both have same features and functionalities
    2) How to change default item1, item2, etc, font style and size on a ChoiceBox or ComboBox from SceneBuilder? I see I can set my own custom items names from FXML file but I would prefer to accomplish from SceneBuilder if possible.
    Thanks
    Alberto

    1) What is the difference between ChoiceBox and ComboBox? It seems both have same features and functionalitiesThe difference between a ChoiceBox and a ComboBox comes down to the method of display: a ChoiceBox uses menus, a ComboBox uses a ListView.
    A ChoiceBox well-suited to a small number of choices
    A ComboBox well-suited to a large number of choices.

  • Refreshing and Executing a Macro

    Post Author: Zahed
    CA Forum: Desktop Intelligence Reporting
    Refreshing and Executing a Macro Problem Description I have a report which has a MACRO WITHIN IT. I want to schedule the report , refresh report and auto run macro which exports the results to text file. I am able to schedule and Refresh but can't get the MACRO auto after refresh to run. In 5.1.8 when I scheduled the report it used give me the option to REFRESH And run the MACRO. How do I do this in BO XR2.
    The text file itself is a concatenation of the date and version number which is done within the code, hence the need to use and run the Macro. The Macro needs to executed after Report Refresh.Any help will be appreciatedZahed

    OK, enough time lost.
    Would you simply have tried tit, you would have seen that your toolbar is automatically stored in your Global.mpt (I did hope you had heard about the organizer and global.mpt) and as such available for all projects in that machine.
    You would also have seen that when you create it it floats, and by simply dragging a toolbar around you can make it float.
    If you want to make it accessible to all users, copy it into a file (using Tools, Organizer) save that file, send it to your end users (or store it on a file server where they have access) with the instruction to use Tools, Organizer to copy it into their
    global.mpt. Done this many times for customers, works like a charm.
    Indeed in 2010 it is more complicated and some things like creating your own button is so complicated I dare not even begin.

  • [svn:fx-trunk] 10209: reverting commit 10198, which affected animation for some halo components like Tree and ComboBox.

    Revision: 10209
    Author:   [email protected]
    Date:     2009-09-12 17:36:41 -0700 (Sat, 12 Sep 2009)
    Log Message:
    reverting commit 10198, which affected animation for some halo components like Tree and ComboBox. Should wait for either the real fix (involves RPC changes) or at least a fix that limits the scope to only Flex4 effects instead of all uses of UIComponent.suspendBackgroundProcessing.
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as

Maybe you are looking for