Point by Point p-th order derivative using Savitzky Golay filter coefficien​ts

I am trying to implement a Point by Point p-th order derivative using Savitzky Golay filter coefficients.  The  point by point available in LV doesn't use the Differential Filter coefficients.  I tried converting it so it could but it didn't differentiate for me, it just gave hte original signal (probably smoothed).  Refer to my attachment.  So I then took a look at another method partly documented in the NI help file.
In prior posts Damien (DFGray) has described the Savitzky Golay derivative filter as"essentially a convolution filter".    The latest LV help file example shows this by using the dot product to calculate the p'th order derivative using such a filter.  So my plan now is to convert that NI help example below (from here) into a point by point version (sorry no LV code existed that I could find, just a pic).  Before I try this out, will this work with just one shift register or do I need a shift register history that is 2k+1 deep ?
thanks
Peter Badcock
Product Development
ResMed Ltd.
Attachments:
Savitzky Golay Differentiator PtByPt.vi ‏21 KB

I replied a tad too soon.  I discovered that the amplitude output from the derivative had been scaled down by (100/2xPI) for some reason I don't understand, so I updated both the test harness and the point by point vi and attached them.
I added a sine wave input for one test signal and my example volume input (without the glitches I'm trying to remove though) for another test signal.  Both derivative outputs show discontinuities at the input as expected,  additionally each are delayed by the number of Side Points (currently constants on the BD)
BTW, thanks for adding in the dx/dt text into the icon, I was going to but was too lazy !!
Peter Badcock
Product Development
ResMed Ltd.
Attachments:
TestSVDerivPntByPnt.vi ‏42 KB
Savitzky Golay Differentiator PtByPt.vi ‏21 KB

Similar Messages

  • Savitzky golay filter for finding second derivative

    Hello friends,
     I want to find second derivative using Savitzky golay filter for the data as shown in image.
    Three different spacings are used.
    Region AB and EF= ∆f1
    Region  BC and DE=∆f2
    Region  CD=∆f3
    Can some one help me to understand to to decide side points and polynomial order for my input data.?
    Thanks in advance.

    The polynomial order must be at least one larger than the highest derivative. So a third order polynomial is required for a second deriviative. In general it is better to keep the polynomial order as low as possible while getting a good fit to the data.
    The number of side points is somewhat arbitrary and depends on how much smoothing is needed. Often some experimentation and judgement is required.
    Have you considered resampling the data to create a new dataset with uniform sampling throughout? That might be easier than trying to match derivatives at the transition points.There are several resampling VIs available.
    How many data points do you have in each segment?
    Lynn

  • Change pointer for Sales Order

    Hi,
    Using change pointers I want to create an IDOC when ever a specific field in the sales order line item is changed. I have activated the change pointer for message type ORDRSP. Also maintained the following entries in BD52
    VERKBELEG(Object) VBAP(Table) ABGRU(field).
    After this when I change this field at the sales order line item, it inserts entries into change pointer table.
    But my problem is creating IDOC's from those change pointer entries. I am not sure which function module (MASTERIDOC_CREATE_XXXXX) works for this.
    Anyhelp on this highly appreciated.
    Thanks
    Ram

    Hi Ram,
    I don't think so you can use change pointer for sales order changes. Usually, it is done through transaction code<b> NACE</b> - configuring condition for output type.
    You can setup requeirement in procedure control to trigger IDoc ORDRSP for any changes in item level.
    Hope this will help you and give an idea.
    Regards,
    Ferry Lianto

  • Acquire single point 12 bit data @ 200Khz using PXIe 6535 DIO RT

    I want to acquire single point 12 bit data @ 200Khz using PXIe 6535 DIO, PXIe 1072 chasis and 8820 controller in RT. Problem is I am unable to acquire data as triggered input. Loop execution time takes ~10us (measured using rt tick count). Thus It misses the samples. Am I missing something? What are the proper ways to acquire digital data in RT?
    Also I am wondering whether I can use the SMB connector of 8820 controller as my acquision trigger input pulse. I am completely new to RT. Any help will be appriciated.
    Thank you.

    Hi jtele1,
    To make sure that the data gets written in the correctly order I would recommend monitoring the Time Out of the write. If a time out occurs you could stop writing all FIFOs and then start when all the Time Outs are no longer there. Another option is to look at your host side and determine if you can read larger chunks of data at a time and allow the host side to deal with processing the data. An additional option would be to look into high throughput streaming for FlexRIO. In this setup you will be writing the data directly to disk on your host side and then you could process the data at a later time. I have linked an example below, this example was giving me trouble so please let me know if you have trouble loading this example. Depending on your situation these may not all be acceptable options but you will need to ensure that you are not filling any of your FIFOs. Lastly, from what I can tell you are using a Windows OS as your host and in that situation you have no way of controlling when your LabVIEW application gets processor time. If you were to switch to a Real Time controller you would be able to ensure when certain tasks are run and add priority to tasks. Please let me know if you have further questions. 
    High Throughput Streaming
    https://decibel.ni.com/content/docs/DOC-26619
    Patrick H | National Instruments | Software Engineer

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • TS3297 iTunes puts up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one. How I can clear that messag

    I've been running iTunes on WinXP for years with few problems.  I have all my iTunes files on an external USB drive. I just bought a new PC running Win7, 64-bit.
    I connected the external USB drive to the new PC and installed 64-bit iTunes on it. When iTunes started up, I pointed it at the iTunes directory in the external drive, using Edit > Preferences > Advanced > iTunes Media Folder Location. It showed a progress bar that it was updating the iTunes Library. I signed in and authorized the new machine. I have one spare authorization.
    Then iTunes put up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one.
    When I click OK, the iTunes Store page remains blank, apart from saying "iTunes Store" in the middle of the page.
    I went to "View My Account" and pressed the Reset button to "Reset all warnings for buying and downloading items", but that doesn’t fix this particular warning. I also tried Edit > Preferences > Advanced > Reset Warnings and Rest Cache.
    But still, every time I click the “App Store” button in the iTunes Store window, the message appears. If I click the Books, Podcasts or iTunesU buttons, these display normally.  So I’m stuck with being unable to purchase apps, other than through my iPad and iPhone.
    If I move the external drive back to the XP machine, the same thing happens.  If I go to another PC - a notebook running Vista - everything is normal.
    Any idea how I can clear that message?
    Thanks for any help you can offer.

    Further info on my question above.
    I have tried re-validating my credit card, which apparently fixed it for some. 
    I have also tried uninstalling, re-downloading and installing again.
    Neither of these steps fixed the problem.

  • Need to connect to upgraded Oracle EBS R12 version from R11. The current ODI set up is pointing to R11, Can i use the same connection to point to R12? Please hele experts..

    Need to connect to upgraded Oracle EBS R12 version from R11. The current ODI set up is pointing to R11, Can i use the same connection to point to R12? Please hele experts...
    Rp

    1. in physical connections part can i use the same work schema
    2. Can i use same contexts created or do i need to create everything as new and then try?
    Thanks,
    Rp.
    Hi,
    As you mentioned that you just upgraded the database, so the data is same and schema is same you can connect with the same work schema.
    Yes, you can use the same contexts , but need to do Reverse Engineering for your new database.
    And about data server, i think you also have no need to create new data server, if hostname,sid and port etc are same as these were with R11(consult with your DBAs regarding it)

  • When the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently.but in fact,when the app in background ,the app need data update to make the

    when the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently。but in fact,when the app in background ,the app need data update to make the function of  trajectory replay come ture。in fact, we have added function when the app  is in background mode。we have point out the point to them by email。but they still have question on the background mode,we are confused,does anyone can help me,i still don't know why do review team can't find the data update when  the app is in background and how do i modify the app,or what is the really problem they refered,do i misunderstand them?
    the blow is the content of the review team email:
    We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.
    We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.
    It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the "location" setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.
    For more information on these options, please see the "Starting the Significant-Change Location Service" and "Monitoring Shape-Based Regions" sections in the Location Awareness Programming Guide.
    If you choose to add features that use the Location Background Mode, please include the following battery use disclaimer in your Application Description:
    "Continued use of GPS running in the background can dramatically decrease battery life."
    Additionally, at your earliest opportunity, please review the following question/s and provide as detailed information as you can in response. The more information you can provide upfront, the sooner we can complete your review.
    We are unable to access the app in use in "http://www.wayding.com/waydingweb/article/12/139". Please provide us a valid demo video to show your app in use.
    For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
    - complete details of your rejection issue(s)
    - screenshots
    - steps to reproduce the issue(s)
    - symbolicated crash logs - if your issue results in a crash log
    If you have difficulty reproducing a reported issue, please try testing the workflow as described in <https://developer.apple.com/library/ios/qa/qa1764/>Technical Q&A QA1764: How to reproduce a crash or bug that only App Review or users are seeing.

    Unfortunately, these forums here are all user to user; you might try the developer forums or get in touch with the team that you are working with.

  • Can we do a fresh install of TES 6.2.1 on a new server, but point to an database currently used by the older version (v5.3.x)

    The current database is 2.5 gb, but it is already on SQL Server 2008, and doesn’t need to be upgraded.
    In reading the documentation, it looks like the installer can install a fresh copy, which I’m assuming creates the requisite tables in the database.  It can also update an existing install, along with updating the database table structure.  What we weren’t sure of was if it could do a fresh install on a new server, but point to an database currently used by the older version of tidal.  It does say ‘The database modifications are performed when the master is first started after the installation.’ in the upgrade section of 6.2.1 Quickstart Page 6-5.  Hopefully that works regardless of if it was an upgrade or a fresh install.

    We worked with one of their partners gssinfotech to create a custom runbook for "upgrade in place"
    I think you might have to go to SQL2012 with 6.2.1 (there's a ton of benefits like always on that make BCP/DR with Tidal very smooth.) We've been Tidal 6 /SQL2012 for a while now so I forget. we're about 80% done with our 5.3.1 conversion
    We restore our 5.3.1 admiral database to a sandbox SQL2012 server, run some cleanup script (if not upgrade in place, don't forget to set queue to zero and disable all jobs)
    We installed a tidal Master then run every major rev and point to that database. (6.0,6.1,6.2,6.2 sp1)
    The database gets upgraded during the process (we have some trouble with our "older" 531 so we do the same thing each time)
    We then can use transporter to transport "legacy" 531 jobs to our pristine Tidal 6.2.1 (non-prod ) environment so we can take advantage of mapping files, etc. to switch things as needed
    This gives a lot of flexibility to moving things in when one piece or job set at a time.. we use it to move job frameworks into nonprod Tidal 6 so that developers and other groups can review / asses / rewrite / test /  their jobs on tidal 6.
    Marc

  • Pointer table and exception table use

    REPORT  ysubdel212     LINE-SIZE 120                         .
    *       CLASS testclass DEFINITION
    CLASS testclass DEFINITION.
      PUBLIC SECTION.
        METHODS : testmethod.
        CLASS-DATA num TYPE i.
    ENDCLASS.                    "testclass DEFINITION
    *       CLASS testclass IMPLEMENTATION
    CLASS testclass IMPLEMENTATION.
      METHOD : testmethod.
        num = num + 5.
        write : /5 num.
      ENDMETHOD.                    ":
    ENDCLASS.                    "testclass IMPLEMENTATION
    START-OF-SELECTION.
      DATA : my_obj TYPE REF TO testclass.
      DATA: myobj_tab TYPE TABLE OF REF TO testclass.
      DO 5 TIMES.
        CREATE OBJECT : my_obj.
        APPEND my_obj TO myobj_tab.
      ENDDO.
      LOOP AT myobj_tab INTO my_obj.
        CALL METHOD: my_obj->testmethod.
    Question.
    1)I checked in the debugging and checked the value of my_obj in the do loop.
    it generated the following values.
    tell me what this numbers mean lke 9,10,11,12,13 .
    1)9<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>
    2)10<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>
    3)11<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>
    4)12<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>
    5)13<\PROGRAM=YSUBDEL212\CLASS=TESTCLASS>
    2) When we need to use pointer table  & exception table?
    use of pointer table.
    3) we can call a static method with the help of object then why we need to declare as static.
    one reason may be without object we can call with help of class, is there any other uses?
    call method <obj>-> <method>
    or call method <class>=><method>
    Edited by: Matt on Mar 26, 2009 1:34 PM

    Hello
    You define methods (or attributes) as static if they are intended to be INDEPENDENT of any concrete instance of the class.
    >> 3) we can call a static method with the help of object then why we need to declare as static.
    >> one reason may be without object we can call with help of class, is there any other uses?
    >> call method <obj>-> <method>
    >> or call method <class>=><method>
    Example: You want to calculate the VAT amount. Input parameters are the amount and the VAT rate, output is the VAT amount. This method CALCULATE_VAT_AMOUNT should be defined as static because it does not need any additional input from any instance.
    Regards
      Uwe

  • I get /Volumes/Untitled is not a valid volume mount point when I try to use teminal to make bootable usb stick

    I get /Volumes/Untitled is not a valid volume mount point when I try to use teminal to make bootable usb stick. Why and what do I do to fix this. Very frustrating. Thanks for any help. Btw, I went through all the steps properly more than once to fomat and partition etc.
    John

    FYI
    my process just completed:  here is what I see when it is done... (the first you saw in my earlier post.  It took about 15-20 minutes.
    To continue we need to erase the disk at /Volumes/Recovery.
    If you wish to continue type (Y) then press return: y
    Erasing Disk: 0%... 10%... 20%... 30%...100%...
    Copying installer files to disk...
    Copy complete.
    Making disk bootable...
    Copying boot files...
    Copy complete.
    Done.

  • I am making my first keynote presentation.  I transferred the slides from a power point.  I did not use a 'theme' from keynote.  Keynote will not let me 'name' the presentation and the 'save as' option will not come up in the menu.  What have I done wrong

    I am making my first keynote presentation.  I transferred the slides from a power point.  I did not use a 'theme' from keynote.  Keynote will not let me 'name' the presentation and the 'save as' option will not come up in the menu.  What have I done wrong

    When it comes to Keynote, I try and start with a presentation that's 1680 x 1050 preset or something in that range.  Most projectors that you'll get at a conference won't project much higher than that and if they run at a lower resolution, it's better to have the device downsize your Keynote.  Anything is better than having the projector try and upsize your presentation... you work hard to make it look good, and it's mangled by some tired Epson projector.
    As far as slides go, scan them in at 150 dpi or better, and make them at least the dimensions of your presentation.  Keynote is really only wanting 72dpi, but I do them at 150, just in case I need to print out the presentation as a handout later, and having the pix at 150 dpi gives me a little help with their quality on a printer.
    You'd probably have to drop in the 150 versions again if you output the Keynote to .pdf or Word or something, but at least you have the option.
    And Gary's right (above) go ahead and scan them as TIFFs.  Sooner or later you'll want to do something else with these slides (like make something for an iPad or the like) and having them as TIFFs keeps your presentation looking good.
    Finally, and this is a big one, get to the location for your presentation ahead of time if you can, and plug the laptop in and see what you get.  There's always connection problems. Don't let the AV bonehead tell you everything will work just fine ('... I don't have any adapters for a Mac...') .  See it for yourself... you're the one that's standing up there.  Unless it's your boss, then you better be really sure it works.

  • 100 points for pre ordering movies link is dead

    http://www.bestbuy.com/site/promo/my-bby-points-offer-135920
    The offer was live and the movies showed up on Saturday but the prices were changed recently and the link no longer works.

    Good afternoon dariceboij, and welcome to the Best Buy forum,
    The reason why that link is not working is because the 100 bonus points movie pre-orders offer was valid between 3/8/2015 - 3/14/2015, so it has expired.  I do see that the offer is still listed under "My Best Buy™ Exclusive Offers" on BestBuy.com, and I have partnered with our program team to ensure a correction is made as soon as possible.
    I greatly appreciate you bringing this to our attention, and while we do not currently have any other bonus point offers for movies, our Gamers Club Unlocked members (which I can see you are) can currently receive 20% off select movies.  You can read more about the offer and look over the list of eligible movies by visiting the link below.
    20% off select movies for Unlocked members
    Thank you for posting and for being a My Best Buy™ member!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Change only material qunatity in sales order by using BAPI

    Hi All,
    How to change only the material quantity in existing sales order by using BAPI.
    Please help me in this regards.
    Regards
    Deekshitha.

    Hi
    See the sample code and do accordingly
    REPORT Z_SALES_ORDER_CHANGE
    NO STANDARD PAGE HEADING
    LINE-SIZE 132
    LINE-COUNT 65(0)
    MESSAGE-ID ZZ.
    TABLES: VBAP.
    DATA:
    V_FILEIN(90) TYPE C,
    V_RECIN TYPE I,
    V_RECVBAP TYPE I,
    V_RECORDER TYPE I,
    V_VBELN LIKE VBAP-VBELN,
    ORDERHEADERINX LIKE BAPISDH1X.
    DATA: BEGIN OF I_ORDERS OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    BRGEW(18) TYPE C,
    VOLUM(18) TYPE C,
    END OF I_ORDERS.
    DATA: BEGIN OF I_OUTPUT OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    GEWEI LIKE VBAP-GEWEI,
    BRGEW LIKE VBAP-BRGEW,
    VOLUM LIKE VBAP-VOLUM,
    CKWGT TYPE C,
    CKVOL TYPE C,
    END OF I_OUTPUT.
    DATA: BEGIN OF ORDERITEMIN OCCURS 0.
    INCLUDE STRUCTURE BAPISDITM.
    DATA: END OF ORDERITEMIN.
    DATA: BEGIN OF ORDERITEMINX OCCURS 0.
    INCLUDE STRUCTURE BAPISDITMX.
    DATA: END OF ORDERITEMINX.
    DATA: BEGIN OF RETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF RETURN.
    DATA: BEGIN OF BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF BAPIRETURN.
    PARAMETERS:
    P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
    P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
    START-OF-SELECTION.
    CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
    CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
    OPEN DATASET
    IF V_FILEIN IS INITIAL.
    MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
    ELSE.
    OPEN DATASET V_FILEIN
    FOR INPUT
    IN TEXT MODE.
    IF SY-SUBRC = 0.
    READ DATASET
    DO.
    READ DATASET V_FILEIN INTO I_ORDERS.
    IF SY-SUBRC = 0.
    APPEND I_ORDERS.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET
    CLOSE DATASET V_FILEIN.
    IF SY-SUBRC <> 0.
    MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
    ENDIF.
    ELSE.
    MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
    ENDIF.
    ENDIF.
    SORT AND REMOVE DUPLICATES FROM I_ORDERS
    SORT I_ORDERS BY VBELN POSNR.
    DELETE ADJACENT DUPLICATES FROM I_ORDERS.
    POPULATE I_OUTPUT
    LOOP AT I_ORDERS.
    SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
    CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
    SELECT SINGLE BRGEW VOLUM
    FROM VBAP
    INTO (VBAP-BRGEW, VBAP-VOLUM)
    WHERE VBELN = I_ORDERS-VBELN
    AND POSNR = I_ORDERS-POSNR.
    IF SY-SUBRC = 0.
    IF VBAP-BRGEW = 0.
    I_OUTPUT-CKWGT = 'X'.
    ENDIF.
    IF VBAP-VOLUM = 0.
    I_OUTPUT-CKVOL = 'X'.
    ENDIF.
    I_OUTPUT-VBELN = I_ORDERS-VBELN.
    I_OUTPUT-POSNR = I_ORDERS-POSNR.
    I_OUTPUT-GEWEI = 'ST'.
    I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
    I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
    APPEND I_OUTPUT.
    CLEAR: I_OUTPUT.
    ENDIF.
    V_RECIN = V_RECIN + 1.
    ENDLOOP.
    POPULATE BAPI DATA AND RUN BAPI
    CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ORDERHEADERINX-UPDATEFLAG = 'U'.
    LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
    V_RECVBAP = V_RECVBAP + 1.
    IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    CLEAR: ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ENDIF.
    ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
    IF NOT I_OUTPUT-CKWGT IS INITIAL.
    ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
    ORDERITEMINX-GROSS_WGHT = 'X'.
    ENDIF.
    IF NOT I_OUTPUT-CKVOL IS INITIAL.
    ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
    ORDERITEMINX-VOLUME = 'X'.
    ENDIF.
    APPEND ORDERITEMIN.
    ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMINX-UNTOF_WGHT = 'X'.
    ORDERITEMINX-UPDATEFLAG = 'U'.
    APPEND ORDERITEMINX.
    V_VBELN = I_OUTPUT-VBELN.
    ENDLOOP.
    RUN BAPI ON LAST ORDER
    IF NOT ORDERITEMIN IS INITIAL.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    ENDIF.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
    SKIP.
    TOP OF PAGE
    TOP-OF-PAGE.
    WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
    100(8) TEXT-H02, 126(8) SY-PAGNO.
    WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
    20(77) TEXT-H04,
    100(8) TEXT-H05, 108(25) SY-REPID.
    WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
    20(4) TEXT-H07, 25(32) SY-HOST,
    100(13) TEXT-H08, 121(8) SY-SYSID,
    129 '/', 130(3) SY-MANDT.
    ULINE.
    SKIP.
    Reward points if useful
    Regards
    Anji

  • How to change Service order quantity using BAPI/FM

    Hi All,
    Can any body tell me how to change the Service Order quantity (in IW32) using a FM or a BAPI.
    I tried using the BAPI: BAPI_ALM_ORDER_MAINTAIN but I am unable to change the quantity. May be I might be missing some parameter. If anybody has done this please let me know the parameters that needs to be passed or if there is any other way out.
    Points will be rewarded to useful answers!!
    Thanks,
    Susanth.

    Hi!
    I have used this BAPI.read the documentation properly and after calling this bapi call BAPI_TRANSACTION_COMMIT then only expected results com n get saved.
    for ex:
    call function 'BAPI_ALM_ORDER_MAINTAIN'
        tables
          it_methods              = itab_methods
          it_header               = itab_header
      IT_HEADER_UP            =
          it_header_srv           = itab_header_srv
      IT_HEADER_SRV_UP        =
          it_userstatus           = itab_userstatus
          it_partner              = itab_partner
      IT_PARTNER_UP           =
          it_operation            = itab_operation
      IT_OPERATION_UP         =
          it_relation             = itab_relation
      IT_RELATION_UP          =
          it_component            = itab_component
      IT_COMPONENT_UP         =
          it_objectlist           = itab_objectlist
      IT_OBJECTLIST_UP        =
          it_olist_relation       = itab_olist_relation
          it_text                 = itab_text
          it_text_lines           = it_text_lines
          it_srule                = itab_srule
      IT_SRULE_UP             =
          it_tasklists            = itab_tasklists
          extension_in            = itab_extension_in
          return                  = itab_return
          et_numbers              = itab_et_numbers
      call function 'BAPI_TRANSACTION_COMMIT'
       exporting
         wait          = 'X'
    IMPORTING
      RETURN        =
    reward points if helpful.

Maybe you are looking for