Refresh SBO Order

Dear Sir,
I am using the DI to add an order to the database using the oOrder.Lines.Add methods and VB6 SP6 as developpemt language but instead of
creating a new form I am using the standard SBO Order form.
the problem is that when I open the order form, it is in a create mode, I start to enter items and i should create one line per quantiy for
example if i enter Item1 with qty = 2, at the line validation, 2 lines should be added to the database before going to a new line I
automatically insert the order line into the database using the oOrder.lines.add method. and now i have a problem since the user cannot see
that his order is now containing 2 lines with the same item reference with qty=1 per line.
My question is what should i do to refresh my order and get the exact number of lines already inserted in the database.
Thanks in advance

Hello Mary,
What you try to do (blocking the regular Add, but still using the form to display the result) would require a workaround that handles 2 events in parallel since you would have to <b>switch</b> the Form.Mode to "Find". That will cause the system message asking you whether it is OK to clear the data on the form ("Changes will cause the data to be deleted")...
...and that message needs to be handled separately - and you will need a global or static flag to know that you should close that message in your code.
I.e. you will have a workaround that isn't too nice and could cause more trouble than convincing the users that a bit of flicker doesn't really do much harm... - if I am not totally mistaken!
Here's the code for the opening / closing (in the background):
Please note that it works for the Item EVent only - at least in my patch (18) I had trouble using it in the FormDataEvent (what would be the more natural choice in principle...)
Try
    If (pVal.FormTypeEx = "139") _
    And (pVal.ItemUID = "1") _
    And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) _
    And (pVal.BeforeAction = True) Then
        Dim oFormOrig As SAPbouiCOM.Form
        oFormOrig = SBO_Application.Forms.Item(FormUID)
        If Not (oFormOrig.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE) Then
            Exit Sub
        End If
        BubbleEvent = False
        ' get the data from the form... (like you do now...;
        'we asked R&D to consider to supply an easier way to get the data...)
        '...(quite some work to do...)
        Dim oOrder As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
        oOrder.CardCode = "C20000"
        oOrder.DocDueDate = Date.Now
        oOrder.Comments = "Order added in FormDataEvent..."
        oOrder.Lines.ItemCode = "A00001"
        oOrder.Lines.Add()
        oOrder.Lines.ItemCode = "A00002"
        oOrder.Lines.Add()
        oOrder.Lines.ItemCode = "A00003"
        ' Try to add the order object to the database
        iRetCode = oOrder.Add()
        If iRetCode <> 0 Then ' If the addition failed
            oCompany.GetLastError(iErrCode, sErrMsg)
            SBO_Application.MessageBox(iErrCode & " " & sErrMsg) ' Display error message
            Exit Sub
        End If
        SBO_Application.StatusBar.SetText("Order Added", _
          SAPbouiCOM.BoMessageTime.bmt_Short, _
          SAPbouiCOM.BoStatusBarMessageType.smt_Success)
        'Navigate to new document:
        Dim sDocEntry As String = oCompany.GetNewObjectKey()
        If oOrder.GetByKey(CInt(sDocEntry)) Then
            ' to "Find" the document we need the Document Number instead of the (internal) Doc Entry number...
            Dim sDocNum As String = CStr(oOrder.DocNum)
            ' Open a new SO Form... and set form to "Find" mode
            SBO_Application.ActivateMenuItem("2050")
            Dim oFormNew As SAPbouiCOM.Form
            oFormNew = SBO_Application.Forms.Item(SBO_Application.Forms.ActiveForm.UniqueID)
            oFormNew.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE
            ' fill the document number (visible to the user) into the corresponding input field
            Dim oEdt As SAPbouiCOM.EditText = oFormNew.Items.Item("8").Specific
            oEdt.String = sDocNum
            ' "Find" the document...
            oFormNew.Items.Item("1").Click()
            ' "Cancel" the old one...
            oFormOrig.Items.Item("2").Click()
        Else
            SBO_Application.StatusBar.SetText("Internal error: Order not found; DocEntry = " & sDocEntry, _
                            SAPbouiCOM.BoMessageTime.bmt_Short, _
            SAPbouiCOM.BoStatusBarMessageType.smt_Error)
        End If
    End If
Catch ex As Exception
    SBO_Application.StatusBar.SetText(ex.Message, _
            SAPbouiCOM.BoMessageTime.bmt_Short, _
           SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End Try
Message was edited by:
        Frank Moebius

Similar Messages

  • Does refreshing the order status page over and over push delivery dates up?

    I've been a caged animal for the past week. Pacing back and forth methodically refreshing the page every 5 minutes. I couldn't eat, sleep, nor defecate. I did nothing but wait. I waited for the return of my 9/19 delivery confirmation for my gold iPhone 6 Plus 128GB. During this time my delivery date has been bounced around more than the two balls I always carry. As of now, the fruits of my labor has resulted in a 10/14 delivery date. What progress. Should I stop refreshing the order status page? Does anyone know if refreshing the page over and over pushes the delivery date up? TIA.

    Settle down, eat something, take a nap or something. It's just a phone. Wearing out your mouse refreshing the page is not going to make your phone come faster.

  • Refreshing Sales Order Screens with new BP data

    My customer service department is entering sales orders and have to create new "ship to" addresses on a regular basis.  They open a new sales order, enter the BP Code for the bill to customer and then use teh golden arrow to enter BP Master data and enter a new ship to address.  After they save and close the new information, it is not available for them on the old sales order screen until they close and start a new sales order.
    Is there a way to refresh a screen that you are currently in in order to import the new information that has been entered into the BP Master Data?

    I appreciate the information, but the sarcasm is not necessary.
    It is not hard to add the data beforehand but these orders are for a sales agency we contract with.  One bill to customer and unlimited ship to addresses.  Some are repeat shipments, some are not.  So when the order is taken, they open the bill to customer account and if the ship to address is not there, they must then add it and cancel out the order and start over.  For one transaction it is not a significant amount of time but over the course of 1000 a day, it becomes significant.
    I was looking for a way to facilitate the process.

  • Auto-Refresh and Order By for view accessors

    Hi,
    We have set auto-refresh to true on a VO(LovVO) in shared AM and used the same to create an lov in another VO. Now if we have Order By in LovVO then we get the exception:
    ORA-29983: Unsupported query for Continuous Query Notification
    This is because of the Order By clause. When i remove the order by then there is no error. But we need the data to be ordered. So I have added the below code LovVOImpl.java executeQueryForCollection method:
    if(this.getSortBy() == null){
    this.setSortBy("Name");
    super.executeQueryForCollection(object, object2, i);
    and this is working fine. Is there any other declarative solution for this scenario?
    I tried setting the order by in the view accessor but that also appends to the sql query and throws the above error.
    Thanks
    Thiru

    Please see http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17125/adfns_cqn.htm#CHDGEBFH. Look like OREDER By is supported only in Best-Effort mode.
    When you call .setSortBy("Name"), it happens in memory not part of SQL, apparently that works

  • Reference Object to Refresh Work Order Field Data

    Dear Gurus,
    In IW21/IW22 the reference object will populate the Responsibilities section of the Notification tab, and fields on the Location Data tab.  When the reference object is changed, those same fields will update or refresh.  The reference object will also populate field data in a work order if the work order is created from the notification, however, work order fields will not refresh if the reference object on the notification is changed.  Nor will work order fields change if the reference object is changed directly within the work order.
    Can anyone explain why fields will refresh in IW21/IW22 when the reference object is changed, but similar fields in the work order will not refresh when the reference object is changed in IW31/IW32?

    Hi Lisa,
    When you execute IW31/IW32 transaction, in back ground standard SAP programs are called to perform order related task.
    When transaction IW21 / IW22 is executed and order is created or changed at that point also standard SAP programs are called to perform order related task.
    But program called by IW31/IW32 are different then that will called with IW21/IW22 and thus refresh dont happen if u change reference object in notification once after order is created.
    You need to manually change in work order.

  • SD material price change should refresh Delivery order.

    There was a price change for the material after creation of  outbound delivery. a dynamic credit limit management is enabled which blocks the creation of delivery order if there is no sufficient credit available for party. Now after change in prices the delivery order should go to credit block while doing PGI. which is not happeining. At Billing creation the prices gets refreshed and party is billed with new rate. This is creating debit balance in customer account. Kindly suggest solution how to block the PGI in such cases?
    Regards
    Sanjay Petkar

    Hi,
    Please check the VOV8 credit group filed configuration. If it is 2 at delivery level. Then only it do credit check at delivery level...
    Regards
    sankar

  • Why do I have to keep refreshing in order to maintain the sound for incoming text messages

    How do I maintain the volume of the sound for incoming text messages without having to keep refreshing  my phone

    qualmtge wrote:
    How do I maintain the volume of the sound for incoming text messages without having to keep refreshing  my phone
    What do you mean refresh your phone?

  • Dbms_refresh : order of refresh

    When I make a refresh group and execute the refresh, are the materialized views refreshed one at a time in the order they were made (list), or are they refreshed all at once? I need them to be refreshed in order because some are multi-tier (based on other materialized views).
    Thanks.

    well you can refresh single snapshot, instead of entire group,
    also in mv refresh group, the mviews are refreshed in the order in which they are added into the refresh group,
    so if you want your mviews to be refreshed in particular order, maintain the same order when you add them to refresh group...
    Message was edited by:
    Nicloei W
    Message was edited by:
    Nicloei W

  • SDK-UI - Control of the Metadata Refresh Option

    When creating metadata the SBO Client need to do a meta-data refresh in order to see new data. In a developers world that is no big problem, but to the customer it means that every time something must be changed, they need to be aware of the Refresh-window (since I closes all windows). Also we canu2019t trigger the metadata refresh form (we only have the option to suppress it while creating data. We should have at least have the option to trigger it, but best solution would of cause to not need it at all).

    When creating metadata the SBO Client need to do a meta-data refresh in order to see new data. In a developers world that is no big problem, but to the customer it means that every time something must be changed, they need to be aware of the Refresh-window (since I closes all windows). Also we canu2019t trigger the metadata refresh form (we only have the option to suppress it while creating data. We should have at least have the option to trigger it, but best solution would of cause to not need it at all).

  • Unable to do Allocation with Reference to Sales Order For SAP AFS

    Dear Experts
                      Error is showing while doing Allocation for Sales Order .
                      Our Business Scenario is ( Sales Order ( VA01)- Allocation Run(J3AT) - Delivery (VL01N) - Invoice ( VF01).
                      Yesterday a user Created a sales Order  & then did Allocation  & allocation was successfully saved & started doing Delivery through VL01N  , he entered Order No & did picking & as he hit enter in Post Goods Issue SAP automatically closed coz backup had started & it was around 8'o clock .
    And today morning he didn't change Req delivery date for  doing delivery but also he De-Allocated the allocation through TC - J4AB & did de-allocation & later changed Req delivery date / refreshed Sales Order & gone through J3AT For allocation but its showing  following error while doing Allocation  .
    Material LCM.22.1586.0 locked by user ...............
    Please give any suggestion if possible.
    Thx In Advance
    Kamlesh

    Sorry for delay.
    We got the solution by Our-self .
    Articles were blocked due to system shut down without any indication. And then forwarded this to BASIS Team . They unblocked the user & hence problem got solved.
    Kamlesh

  • Refresh UIX Page from DataForwardAction

    Version: JDeveloper 9.0.5
    How would I go about refreshing my uix page after returning from a Struts DataForwardAction?
    Why do I want to do this? I am setting a session variable based upon some code in the DataForwardAction. I have a button on the uix page that reads the value of the sessionScope variable and is either rendered or not rendered on the page. Currently, the design works, with the exception that I have to click the browser refresh in order for my page to read the new value on the session.
    Any help will be greatly appreciated.
    Thanks,
    Connie

    Steve,
    Thanks for asking!
    My uix page has the following code:
    <tableSelection>
      <singleSelection model="${bindings.MyViewIterator}" >
         <!--     <primaryClientAction>
           <firePartialAction targets="_uixSate" source="MyView139" event = "select" />
         </primaryClientAction>-->
         <primaryClientAction>
           <firePartialAction targets="_uixSate" source="MyView139" event = "rowSelect" />
         </primaryClientAction>
         <contents>
            <submitButton id="PageUpdateBtn" name="PageUpdateBtn" text="Update" event="update" rendered="${sessionScope.RenderPageUpdateBtn" />
            <submitButton id="PageReviewBtn" name="PageReviewBtn" text="Update" event="update" rendered="${sessionScope.RenderPageReviewBtn" />
            <submitButton text="Delete" model="${bindings.Delete}" id="Delete8" event="action" rendered="${sessionScope.RenderDeleteBtn}"/>
         </contents>
       </singleSelection>
      </tableSelection>My DataForwardAction has the following code:
    public void setSelectedRow(DataActionContext ctx) {
      JUIteratorBinding iter = (JUIteratorBinding)ctx.getBindingContainer().findIteratorBinding("MyViewIterator");
    int iterRow = Integer.partseInt(ctx.getHttpServletRequest().getParameter("MyView139:selected"));
      iter.setCurrentRowIndexInRange(iterRow);
    public void onRowSelect(DataActionContext ctx) throws Exception{
      setSelectedRow(ctx);
       //code to determine how to set buttons
       // if have ability to update this record then
       session.setAttribute("RenderPageUpdateBtn","true");
       session.setAttribute("RenderPageReviewBtn","false");
       session.setAttribute("RenderDeleteBtn","true");
       // else
       session.setAttribute("RenderPageUpdateBtn","false");
       session.setAttribute("RenderPageReviewBtn","true");
       session.setAttribute("RenderDeleteBtn","false");
    }Any ideas?
    Thanks!
    Connie

  • ADF-JClient Refresh (Newbie question)

    I've gotta believe this is an easy thing to do with ADF, yet after perusing the documentation I could find (most is struts oriented) I just can't seem to get this working and I'm sure somebody here has done it. Also I'm pretty green when it comes to this ADF stuff so hopefully I use all the right terms, etc.
    I have a simple app, that hooks up to a EJB application using a session facade. I have an Order bean, and I have an order line item bean and as you may guess there is a 1-M relationship between the two.
    I set up the page with all the ADF stuff, and basically both are displayed as JTables. When I go to add a line item I:
    1)want to call the ADF operation to do so
    2) refresh both tables with their appropriate data (orders has a total price item that needs to be incremented)
    3) select the orders JTable's order record that corresponds to the line item I just inserted
    4) select the lineItems JTable's line item record that I just inserted.
    The way I currently try to do this, which doesn't quite work is:
    1) call the ADF operation "addLineItem" passing it appropriate details
    2) define an ActionBindingListener class that has an afterActionPerformed() method that:
    a) calls panelBinding.execute() (to refresh the orders table)
    b) calls ordersTable.changeSelection(x, y, false, false) to try and select the appropriate row in the orders table
    c) calls "getLineItems" operation which looks at the row that ordersTable is pointing to to update the line items table
    d) calls lineItemsTable.changeSelect(x, y, false, false) to select the appropriate row in the line items table
    Doing this, after I add an item, I see the correct order get selected, but then the table seems to switch off of it and select the row at the top of the table (as if a refresh had been requested again). The odd thing is that sometimes the above logic seems to work. I'm thinking my problems probably stem from calling panelBinding.execute(), but I haven't found any other clear way to refresh the data without doing that. What am I doing wrong? or am I right and there is a bug with the refresh?
    Any ideas/suggestions, no matter how stupid it may seem are appreciated. I think this is something simple, I'm convinced I've just missed something obvious.

    I think I figured out my problem. The key was to not use the JTable.changeSelection() method to set my selection post update. I needed to set it on the the JUTableBinding via a using a NavigatableRowset, so I did something like:
    void selectLineItemRecord(Long oid)
    JUTableBinding tableBinding = (JUTableBinding) panelBinding.findControlBinding("lineItemList");
    NavigatableRowIterator iter = tableBinding.getIteratorBinding().getNavigatableRowIterator();
    if(oid != null)
    for(int i = 0; i < iter.getRowCount(); i++)
    Row row = iter.getRowAtRangeIndex(i);
    if(oid.equals(row.getAttribute("oid")))
    iter.setCurrentRow(row);
    return;
    // fall through if not found or oid doesn't exist
    iter.reset();
    This seems to work much better now. Now if I just need to figure out some scroll bar stuff and I should be all set.
    FYI, the thread I garnered this information from is Re: JTable returning to previously selected row after executeQuery()

  • Refresh Issue in XMLDataSet with IE

    I'm running into this issue on Internet Explorer 6, not on
    Firefox or Safari. I'm basically using the Product Table Example
    app, and use the XMLDataSet object pointing to a PHP page called
    getOrders.php that returns the XML dynamically, based on mySQL
    queries. Whenever I make changes to the records, the XMLDataSet
    doesn't load a fresh copy of th PHP file thus not reflecting the
    changes in the display page. Even if I use the usecache: false
    option or define a reload interval, it is not refreshing the page.
    So I went ahead and directly opened the .php file in the browser
    and it returns the XML displayed in the browser... and it is the
    outdated content. So I'll have to ctrl-click Refresh in order to
    force download fresh content and then it seems to update itself.
    Again, this is on IE browser only (6.0 <), not on Firefox, not
    on Safari...
    Anyone out there that ran into the same / similar issue?
    Thanks for your help, much appreciated!
    -ralf

    Thanks for the hint. I have tried to insert the meta tags,
    but it didn't work for me, unfortunately. Now, what I found out is,
    that this only happens if the HTTPRequest Object opens a URL that
    is named always the same. So, If I were to change something in the
    URL every time, it would basically be a new URL and IE has to load
    it, because it's brand new, and the cache could serve no purpose.
    The way I did this is by adding a parameter that changes all the
    time: a random number.
    the line in my source code:
    var dsOrders = new Spry.Data.XMLDataSet("
    http://www.my-domain.com/my-subdir/loadOrders.php",
    "/my-results", { useCache: false, loadInterval: 60000 });
    has been altered to include the current timestamp:
    var rightnow = new Date();
    var var_random = rightnow.toGMTString();
    var dsOrders = new Spry.Data.XMLDataSet("
    http://www.my-domain.com/my-subdir/loadOrders.php?random="+var_random,
    "/response/result/orders/order", { useCache: false, loadInterval:
    60000 });
    This worked for me. Thanks for the hint though, it opened my
    mindset to come up with this solution.
    thx,
    -ralf

  • Order Numbers

    Hi,
    I can see that it is the internal webtools OrderID that is displayed to the customer during confirmation and within order history. I have added the SynchID as well as the OrderID in order history to at least provide some point of reference.
    To avoid the inevitable confusion, is it possible to have it so that both the number that Webtools presents to the customer at confirmation and the So number generated by SAP is the same?. Maybe create a dedicated WEB order series in SAP?.
    Thanks.
    Martin.

    This is not really possible, based on the fact that the synch only runs every 5 minutes or so, so during that time there may be more orders placed in SBO, throwing the number sequence off.
    You can however display the SBO order number on the shipping document.

  • I just upgrated to 14 and now pages aren't fully loading, I have to do a hard refresh and that doesn't always work.

    I just upgraded to version 14 and now pages aren't fully loading. I have to do a hard refresh in order to get them to load but sometimes that's not an option. For instance when I want to upload a picture to tinypic.com a pop up comes up where you enter a security code. the code and the entry box never load and I can't refresh it.

    I noticed in the box that comes up that the author named a portion of that page with "ad" in the name:
    <br>&lt;div id="adcopy-outer">
    This can sometimes trigger an ad blocker. If you're using one, can you make an exception for tinypic.com and see whether that helps?
    More generally, try clearing your Firefox cache:
    orange Firefox button ''or'' classic Tools menu > Options > Advanced
    On the Network mini-tab > Offline Storage : "Clear Now"

Maybe you are looking for

  • HT1338 how can i find username and password for MobileMe ?

    please let me know which username and password should use for Mobileme.

  • Having Problem with con object

    Can anyone help? I keep getting this error message. cannot resolve symbol symbol : variable con statement stmt = con.createStatement ( ); Here is my code. If you find anything else, please point it out to me. Thanks. import java.sql.*; class mysql {

  • Report server Load balancing

    short description of the setup: 2 hosts running report services say reportsvc_1, reportsvc_2 in the sanme subnet. reports are called using run_report_object from within oracle forms. Is there any mechanism that these two hosts can share the load, loa

  • Flex 4.1: alert button label is null.

    When an Alert dialog was displayed its button showed the label "null" rather than the expected "OK". I tried to do this: http://www.sapphiresteel.com/Tutorials/Amethyst-Tutorials/case-studies/article/debugging-i nto-the-flex-sdk but it's not working

  • Execute BMP Failed

    Hello, I m a beginner of J2EE and I try execute the J2EE Tutorial Example. So, when I execute the storage bin example, I have this error : javax.ejb.EJBException: ejbFindByWidgetId: Invalid table name "STORAGEBIN" specified at position 25.      at St