Use a "Write" Event on a Specific Drive or to a Specific Folder to Trigger a Task in Task Scheduler

I first posted this question on the Microsoft Community forum. It was suggested that I repost it here.
I have a question!
(Pleas forgive the long post...)
What I am trying to do: (This is what I have not yet figured out!)
I am trying to figure out how to trigger a task, in Windows Task Scheduler (WTS), whenever a "Disk Write" event occurs on a specified drive on the machine. - Or, more specifically, whenever a new file or folder is written or
saved to a specified Folder, or a specific Disk Partition, or a specific Hard Disk on the machine - whichever is more relevant for the end goal.
The overall goal:
When a "disk write" operation occurs and data is written to a specified location on a Hard Drive, start a Program at the beginning of the following hour, that will run a backup of the contents
of that location, (after - of course - the new data has been written). After the backup is complete, disallow the program from being started again at the beginning of the next hour, unless more data is written to the specified location beforehand.
Example:
At 2:27pm, I save a new word document to "D:\My Folder\". When the new Word doc file is saved to "D:\My Folder\", my preferred Backup software application is then scheduled to run a backup at the beginning of
the following hour - at 3:00pm - which will then create a new backup of "D:\My Folder\".
The backup software will NOT be scheduled to run again at the next following hour - at 4:00pm - unless another file or additional data is written to "D:\My Folder\" - between 3:00pm and 4:00pm.
Summary:
The goal here is to only run a backup at the beginning of the next hour, following a “disk write” event to a specified location on the hard drive.
Steps that I have, so far, on how to make this happen:
Whenever data is written to a specified location on a hard drive (i.e. "D:\My Folder\"), "Task A," in Windows Task Scheduler, will be triggered to execute its action.
The Action in "Task A" will run a script that changes the Status of "Task B" to ENABLED.
The Action in "Task B" will, on a continuous hourly schedule, start a program that will perform work on the machine. (In this case, it will run a Backup Task in my preferred backup software.)
Upon completion of work by that program (the Backup software), that program will run another script that will change the Status of "Task B" back to DISABLED; preventing "Task B" from continuing that program every hour
according to its hourly schedule.
How do I do this: ... ?
The thing holding me back on making this work is figuring out how to identify the source that generates the “disk write” event and event ID I need, so I can use it to trigger a task in Windows Task Scheduler - in the way that I need. Furthermore,
the “disk write” event needs to specific to a disk drive that I specify and if at all possible, specific to a location that I specify, i.e. “D:\My Folder\”.
Any help on this as well as other suggestions on making this work is greatly appreciated!
Ryan A Miller

Hello Ryan A Miller,
What is your current situation?
Have you try the script as  Frederik Long mentioned?
To receive better support, it is recommended to post in the TechNet Script forum.
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
The professionals there will be glad to help you.
Best regards,
Fangzhou CHEN
Fangzhou CHEN
TechNet Community Support

Similar Messages

  • I have an iMac about a year old. It has OSX 10.8.3 with iMovie 9.0.8. Is there a way to get iMovie to store and use iMovie Events on an external drive? Raw video is eating up my 1TB internal drive.

    I have an iMac about a year old. It has OSX 10.8.3 with iMovie 9.0.8. Is there a way to get iMovie to store and use iMovie Events on an external drive? Raw video is eating up my 1TB internal drive.

    Yes, you can import to an external drive by choosing it from the Import Screen.
    Once an Event or Project is in iMovie, it is best to move it to the external using iMovie, so the Project does not lose links to the Event.
    For full instructions on how to do this, see this link.
    https://discussions.apple.com/docs/DOC-4141

  • Suddenly can't write to an external hard drive that I have been using consistently

    I have been using a WD 1 terabyte external hard drive to transfer movie files between 2 MBP's and suddenly I cannot write any files to the HD.  The error message is that the external hard "cannot be modified" if I try to add any files.  I have tried the same hard drive on another MBP and it works fine and I can write to the hard drive (with the aid of Paragon NTFS for Mac OS).  I have Paragon NTFS on my computer as well and have been able to write to the hard drive previously. I spoke to Western Digital phone support and told them the problem and noted that the icon for the hard drive is grey with a clock on my computer and is orange on the other MBP.  They explained that the icon change was due to Time Machine on my computer.  I currently have Time Machine turned off.
    Of note, I recently upgraded my internal hard drive on my computer to a WD 500 GB internal drive.  Not sure if this will make a difference.  Any help would be appreciated. Thanks,

    Found the issue.  When I changed the internal hard drive, most softward transferred over, but not all.  I had to reinstall the Paragon NTFS and I was then able to write to the external hard drive.  That seemed to solve the problem.

  • How do I encrypt my external hard drive and subsequently a specific file within it, using my Mac? I tried creating a disk image but permission was denied.

    Encrypting an external hard drive and specific folders within. Permission denied using disk image.

    VKP90 wrote:
    When I tried to encrypt a single file within the hard drive itself, I got the following: Disk Utility Progress: Unable to create "Name of my file" (Permission Denied).
    When I tried encrypting the entire hard disk itself, I got: A GUID Partition Table (GPT) partitioning scheme is required.
    I have also currently used Time Machine on the external hard drive, along with saving other data. Hence, I am not sure if partitioning is going to delete any of this (a video I watched mentioned that using the + button when creating partitions retains current data). Backing up the external hard drive is out of the option since it is the back up to my Mac.
    You can't encrypt a single file. I'm not sure what you did to try. You can make an encrypted disk image which begins with a folder, if desired. Or, you can just create a blank, encrypted disk image, then move your desired files into that.
    While you could partition off the free space without erasing the disk, you cannot encrypt it because you need a GUID Partition table which requires you to repartition the entire drive, not just the free space.

  • How to use vn_rdwr() to write to file  in  a driver context?

    hi!
    i now am trying to write to file in a driver using vn_rdwr(),but
    it returns a value 0x1b ,i think the ioflag parameter is the
    reason for it ,so i kadb into ufs :wrip ,here (wrip) it return
    the 0x1b ,but it seemed the result is unrelationed to the ioflag.
    so what's the reason?
    if i do want to write in this way ,do i need to analysize
    the file system and vm every inch?

    Leaving behind the long discussion of DDI/DDK compliance of the thing
    (see it in old threads here and in Kernel - about half a year ago),
    I can tell you that the thing works for me... Still, wouldn't use it in driver (I have no choice in file system though).
    The return value of vn_* family seems to be the errno,
    so 0x1b == 27 == EFBIG...
    As for flags - see /usr/include/sys/vnode.h for appropiate enums.
    Once more - are you 100% sure you need your driver to write anything to file? There are conventional ways of driver-userland communication (notably, the ioctl() entry point)...
    Hope this helps...
    Sincerely,
    Ilya.
    P.S. You may be pretty sure that your driver won't work in the next version of Solaris if you'll use vn_* functions in it...

  • Fastest way to write raw data to hard drive (PhysicalDrive) on Windows 7

    My company is developing a "fancy" USB Mass Storage Device running under Windows 7.  The Mass Storage Client Driver that handles the reading and writing to the actual storage media on the client side is being written in C++. 
    The problem we are having is very, very slow write speeds.  About 30 times slower than expected.  We are using calls to WriteFile() to write blocks of data to the storage media (specifically the physical drive 'PhysicalDrive2') as they are received
    from the Host device.  I have read in many other forums that people have experience very slow write speeds using WriteFile() especially on Windows 7.  So I am trying to figure out if I am using the best method and function calls for this particular
    task. 
    Below are some blocks of code.  One for Disk_GetHandle() which gets a handle to the physical drive and is called only once.  One for LockVolume() function that gets called one time by the program during initialization.  The other block of
    code is WriteSector() which is used to write the actual data to the physical drive when its received by the USB Client controller driver.  I am hoping that someone can shed some light on what I might be doing wrong or provided suggestions on a better
    way to implement this.
    UINT WriteSector(HANDLE hWriteDisk, PBYTE Buf, ULONG Lba, ULONG Blocks)
    DWORD bytesWritten;
    LPTSTR errMsg = "";
    //setup overlapped structure to tell WriteFile function where to write the data
    OVERLAPPED osWrite;
    memset(&osWrite, 0, sizeof(osWrite));
    osWrite.Offset = (Lba * SIZE_OF_BLOCK);
    osWrite.hEvent = 0;
    //write the data
    if (!WriteFile(hWriteDisk, Buf, (Blocks * SIZE_OF_BLOCK), &bytesWritten, &osWrite))
    DWORD Errorcode = GetLastError();
    if (Errorcode == ERROR_IO_PENDING)
    WaitForSingleObject(osWrite.hEvent, INFINITE);
    else
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("WriteSector() - WriteFile failed (%s)\n", errMsg);
    goto exit;
    if (bytesWritten != (Blocks * SIZE_OF_BLOCK))
    printf("WriteSector() - Bytes written did not equal the number of bytes to be written\n");
    return 0;
    else
    return Blocks;
    HANDLE Disk_LockVolume(LPCWSTR _dsk)
    HANDLE hVol;
    LPWSTR errMsg;
    DWORD status;
    bool success = false;
    //now try to get a handle to the specified volume so we can write to it
    hVol = CreateFile(_dsk, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    //check to see if we were able to obtain a handle to the volume
    if( hVol == INVALID_HANDLE_VALUE )
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - CreateFile failed (%s)\n", errMsg);
    goto exit;
    // now lock volume
    if (!DeviceIoControl(hVol, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &status, NULL))
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - Error attempting to lock device! (%s)\n", errMsg);
    goto exit;
    //dismount the device
    if (!DeviceIoControl(hVol, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &status, NULL))
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - Error attempting to dismount volume. (%s)\n", errMsg);
    goto exit;
    exit:
    return hVol;
    HANDLE Disk_GetHandle(UINT Lun)
    HANDLE hVol;
    LPTSTR errMsg = "";
    DWORD status;
    bool success = false;
    //now try to get a handle to the specified volume so we can write to it
    hVol = CreateFile(MassStorageDisk[Lun].PhysicalDisk, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0);
    //check to see if we were able to obtain a handle to the volume
    if( hVol == INVALID_HANDLE_VALUE )
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_WriteData() - CreateFile failed (%s)\n", errMsg);
    return hVol;

    Good for you for fixing the bug.  On the second go-round, I noticed another one, though.  You are not setting the hEvent handle on the OVERLAPPED structure.  If you ever do get an ERROR_IO_PENDING, it would probably be bad inside WriteFile,
    but even if that returned, you would get a problem when calling WaitForSingleObject.
    It helps that we know the actual WriteFile call is what is taking the time.  From your description, though, it's not clear what the precise issue is.  You are comparing write speeds of your SSD vs. a regular USB flash drive.  Are you also
    comparing your program to that of another program?  If the comparison is just between SSD and the existing USB drive, why do you not believe you have established that IO on the SSD is slow? Your last sentence is confusing: you first say that the IO on
    the USB drive was as expected and IO on the SSD was slower, then say that a file write unto the USB drive took 2.5 mins and copying it to the SSD took 2.5 seconds.  I assume these times were reversed.
    BTW, personally for that kind of benchmarking, I would prefer non-buffered, synchronous IO myself.
    I would also consider using
    Process Monitor, for more information about what is going on with the low-level IO events.  Ignore the benchmarking numbers when procmon is running, but getting a log from it will give you more visibility into what events are firing and their sequence,
    what flags the IFS is seeing, etc.

  • How do I delete Photo Stream photos that are taking up hard drive space in my Masters folder, but not actually appearing in any event, or on the interface at all?

    A couple months ago, I activated photo stream using my apple ID. I was under the impression that all the photos uploaded to my photo stream would only use server space on icloud and wouldn't actually utilize disk space, or at the most, the option was available to only download specific photos to my hard drive. My hope was that I could upload the photos to a specific drive, and view the uploaded thumbs or low-res comps on any device as a reference.
    This is not the case.
    What I have found is that iphoto has been automatically downloading any and all photos uploaded to my photo stream. Not just the thumbnails, the entire thumbnail + all resolutions. I shoot RAW photos so in my case, the original averages about 15-25MB per photo.
    I have been uploading directly to an iphoto library on an external hard drive specifically designated for handling all my RAW high-res images.
    What has been happening is all those RAW files are also being uploaded directly to my iphoto library on my iMac and eating up memory which I cannot reclaim, even after deactivating my Photo Stream in preferences. We're talking almost 100 GB of memory is tied up right now.
    I don't want to just go in and start deleting files and folders in my Masters folder, since I have heard this will break iphoto, but the photos in my photostream do not show up in any event and I need to reclaim the hard drive space.
    How can I safely delete them?

    If the files are loose inside the iPhoto library package here's one way to get them out:
    1 - open your library, select all of the photos in the library and add a unique keyword, XXXX,  to all of them.
    2 - Rebuild the library with  iPhoto Library Manager  as follows:
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.>Click on the Add Library button,
    2 -  select the library you want to add from those in the selection window.
    3 - make sure that in the rebuild window the checkbox  "Scavange orphaned photos" is checked.
    4 - now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option
    5 - in the next  window name the new library and select the location you want it to be placed. Click on the Create button.
    Note 1: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost.
    Note 2:  Your current library will be left untouched for further attempts at a fix if so desired.
    3 - open the library, create a smart album with the criterial "Keyword is not XXXX".
    4 - the smart album will include those photos that were not visible in your original library. Select them and use the key combination of Command+Option+Delete to move them to the iPhoto Trash bin.
    5 - empty the iPhoto Trash bin via the iPhoto ➙ Empty iPhoto Trash Bin menu option.
    6 - empty the Trash bin in the Dock to remove the files from your hard drive completely.
    Be sure to read Note 1 above.  You can use the new library without your books, slideshow, etc. and it will not  contain those errant files.  Of course delete the original library if the new one is satisfactory.

  • DeployJava.js uses doc.write() - why?

    I'm probably asking in the wrong place, but why does deployJava.js use doc.write() to create the applet tag?
    I don't know what authority iof any w3schools.com may have for example, but it states that "the entire HTML page will be overwritten if document.write() is used inside a function, or after the page is loaded."
    This means for example that a JSF page that conditionally displays a call to runApplet(), e.g. as the result of an Ajax transaction, will not work: the entire page content is indeed overwritten and my poor users are getting a blank page instead of a rather heavily populated page containing a new applet after pushing a certain button.
    I'm reluctant to deploy my own version of deployJava.js but in the presence of this problem I may have to. Surely there is a better technique available? JQuery has innerHTMLI() for example, that must map to something in the Javascript space.

    Comments so far:
    1. I am embedding the applet in a page served via HTTPS. I therefore need to load java.com/js/dtjava.js via HTTPS to avoid mixed-content warnings. When I do that I get a browser intervention because the site's certificate isn't valid for java.com, only for *.java.com. Fixing the URL to https://www.java.com/js/dtjava.js avoids that. However the dtjava.js file has internal references to http://java.com which need the same treatment.
    2. The variable 'platform' is mis-spelt in the link provided.
    3. FireFox Error Console reports the following:
    Warning: function aj does not always return a value
    Source File: https://www.java.com/js/dtjava.js
    Line: 1, Column: 11305
    Warning: redeclaration of function ap
    Source File: https://www.java.com/js/dtjava.js
    Line: 1, Column: 18985
    Warning: reference to undefined property at.url
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property at.url
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property top.execScript
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: assignment to undeclared variable v
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: assignment to undeclared variable v
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: assignment to undeclared variable c
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: assignment to undeclared variable p
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: reference to undefined property az[ay]
    Source File: https://www.java.com/js/dtjava.js
    Line: 1
    Warning: assignment to undeclared variable p
    Source File: https://www.java.com/js/dtjava.js
    Line: 14. Example 5.1 appears to be incorrect or incomplete, and no other specification of how to construct a dtjava.App object is provided. I get error messages like
    Warning: Error in parsing value for 'width'.  Declaration dropped.
    Source File: https://localhost:8443/vContent/test/applet/ssh.jsf?tag=dtjava
    Line: 0
    Warning: Error in parsing value for 'height'.  Declaration dropped.
    Source File: https://localhost:8443/vContent/test/applet/ssh.jsf?tag=dtjava
    Line: 0using width and height as per that example. I looked in the source code to establish that there are two parameters: a URL and a set of properties. A 'placeholder' property is mandatory when using embed(), although not specified.
    5. The documentation for onGetSplash() fails to mention that the 'HTML snippet' must have width and height attributes.
    If this is the reference material it is entirely inadequate. If it isn't the reference material, it MUST contain a link to the reference material, using MUST in the same way as in RFCs.
    It really astonishes me that Sun/Oracle is still dithering about how best to deploy applets after fourteen years.
    I attach my entire Javascript:
    <div id="SSH_applet_container">
         <script type="text/javascript" src="#{request.scheme}://www.java.com/js/dtjava.js"></script>
         <script>
              function deployIt()
                   var platform = new dtjava.Platform({ jvm: "1.5+" });
                   var event = dtjava.validate(platform);
                   if (event != null)
                        alert("Java Platform problem: "+event+". Your browser support="+!event.isUnsupportedBrowser());
                   // Undocumented, but first param is URL, 2nd is a set of properties that must include width, height, and placeholder for embed().
                   var app = new dtjava.App(
                        'ssh.jnlp',
                             id: 'SSH',
                             width: 100,
                             height: 25,
                             placeholder: 'SSH_applet_container',
                             params:
                                  config: 'ssh_applet.conf',
                   dtjava.embed
                        app,
                        platform,
              dtjava.addOnloadCallback(deployIt);
         </script>
    </div>

  • Write access blocked on additional drives

    I recently had an issue with my Mac Pro with Leopard where it was stuck in boot loop. I followed the fix of using the disk utility off the Leopard disk to repair permissions and everything seemed to be fixed. Then, for no reason I can think of, after using Compressor to batch process some audio files and copying them to one of my extra internal drives, I lost my write access for all 3 of my extra internal drives. If I try and copy or delete a file on these drives I am prompted that I do not have sufficient access priviliges and I am ask to authenticate. If I choose to do so, and enter my admin password, I receive another error message stating it could not complete.
    If I check my account for admin rights and read/write access for these drives, I don't see my Account under Get Info. If I try and add myself under the Get Info window nothing happens, the account isn't added.
    I read this discussion but the person really didn't explain what they did to fix the issue:
    http://discussions.apple.com/thread.jspa?threadID=1282290
    I was curious if anyone had a quick to do list ofr getting this problem fixed?
    Cheers,
    -E

    Other users on your iMac can easily right-click on the external hard drive icon, get info and check the "Ignore ownership on this volume". Then everyone can read and write on the backup drive which probably isn't what you want. Theoretically, only users with admin rights can check that box, but there's plenty of ways to circumvent this.
    If you want to restrict access more, lauch Disk Utility and create a new Read/Write disk image with encryption on the external drive. This will take some time to create and ask you for a password. I'd recommend a strong password (use the password generator that pops up) and let it be stored in your keychain. This way, Time Machine won't ask you to enter the password to back up or enter time machine. You should write down that password though in case the internal hard drive fails or your home folder (including the keychain) gets corrupted. You will be required to enter the password to do a full restore from Time Machine.
    The downside of this is that the other users of your iMac can't use Time Machine at all.
    Per default, the Time Machine rights are so that you can only access your own home folder plus the shared and public folder (and other non-standard folders within anyone's home folder as it has no specific access rights). Try logging in from another account or the guest account and see if you can access your user account's backup files in, say /Documents. It should deny access and not even reveal the folder's contents.

  • I do not have permission to write in my external Hard Drive

    Hello everybody.
    I have recently bought a MacBook Pro (15, 2.16 Ghz with OS X 10.4.9) and I have a Beyond Micro 300Gb external Hard drive that I have been using with my PC. This drive has a Windows NT File System.
    When I first plugged it to the Mac, I changed its name to recognize it better. Now, I am not able to transfer documents from my Mac to it, but I am able to do so through the PC.
    Am I done something wrong?
    Am I blocked this drive? (Once open, I see a pen crossed on the lower left corner)
    And if so, Could I unblocked it to make it writable?
    When I try to transfer any documents with the Mac I get a message saying that I can't do it and because I do not have permission. (I am the administrator).
    I read a previous posting talking about a similar problem, but I really couldn't understand the solutions and/or differences beteween NTFS, FAT 32, MS-DOS and MacFuse (I am a complete novice).
    I also tried (as suggested in the posting) to use the Disk Utility to set the permissions from there, but when I select the external Hard Drive all the options are dimmed. Also, the info panel says I only have permissions to write, having no other available alternatives to choose from.
    The question is: How can I make this drive available to both Operating Systmes without erasing all the information inside (format)?
    Thank You in advance.
    Cordially,
    Juan Carlos
    MacBookPro   Mac OS X (10.4.9)  
    MacBookPro   Mac OS X (10.4.9)  
    MacBookPro   Mac OS X (10.4.9)  

    Thank You rvdparis
    I have just intalled MacFuse (with Tools and Core) and it does allow me now to read and write in my external Hard Drive.
    Once again, THANK YOU VERY MUCH.
    And yes guys, this seems to work. Forget about formatting your external hard drive. MacFuse changes the permission instantly.
    Cordially,
    Juan Carlos
    MacBookPro   Mac OS X (10.4.9)  

  • Report using internal table events

    Hi,
    i have an internal table with  the fields 1. profitcenter 2. company code 3. gl account 4. amount
    for each profit center i need to seggregate accounts based on company code.
    the report should look like the one below.
    please suggest some code using internal table events at new , at end etc. as im not using alv. your help will be rewarded
    regards,
    ravi.
    -Profitcenter-companycodeglaccount-amount---
    -pfcenter1----
    glaccount1-1000---
    glaccount2-2000---
    4444-total--3000---
    glaccount1-4000---
    glaccount2-1000---
    3333-total--5000---
    -profitcentre1*total8000---
    profitcentre2.........

    Hi.
    TYPES: BEGIN OF G_I_DATA,
             PROFIT(4)   TYPE C,
             COMPANY(4)  TYPE C,
             ACCOUNT(10) TYPE C,
             AMOUNT      TYPE P,
           END OF G_I_DATA.
    DATA: G_IT_DATA TYPE TABLE OF G_I_DATA,
          G_WA_DATA TYPE G_I_DATA.
    DATA: G_SUM_COMPANY  TYPE P,
          G_SUM_PROFIT   TYPE P,
          G_AMOUNT       TYPE P.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      SORT G_IT_DATA BY PROFIT COMPANY ACCOUNT.
      WRITE: /6 'ProfitCenter', 20 'CompanyCode',
              34 'Glaccount', 48 'Amount'.
      WRITE: /6 SY-ULINE(50).
      LOOP AT G_IT_DATA INTO G_WA_DATA.
        AT NEW PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT.
        ENDAT.
        G_AMOUNT = G_WA_DATA-AMOUNT.
        AT NEW ACCOUNT.
          WRITE: /34 G_WA_DATA-ACCOUNT,
                 48  G_AMOUNT.
        ENDAT.
        G_SUM_PROFIT = G_SUM_PROFIT + G_WA_DATA-AMOUNT.
        G_SUM_COMPANY = G_SUM_COMPANY + G_WA_DATA-AMOUNT.
        AT END OF COMPANY.
          WRITE: /20 G_WA_DATA-COMPANY,
                  34 'Totle',
                  48 G_SUM_COMPANY.
          CLEAR G_SUM_COMPANY.
          WRITE: /6 '*******'.
        ENDAT.
        AT END OF PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT,
                  20 'Totle',
                  48 G_SUM_PROFIT.
          CLEAR G_SUM_PROFIT.
          WRITE: /6 '*************************************'.
        ENDAT.
      ENDLOOP.

  • Smartforms, how to use control break events

    Please help with this requirement.
    Purchase Docu No.111
    Pur Item No       Mat no       Quantity 
    1                        2356      2000
    2                     1256      2000
    3                     8556      2000
    Purchase Docu No.112
    Pur Item No    Mat no    Quantity 
    1                      9656      2000
    2                      7356      2000
    3                      1356      2000
    Purchase Docu No.113
    Pur Item No    Mat no    Quantity 
    1                      5356      2000
    2                      8356      2000
    This i have to design for the smartform.
    1 header data then its item data.
    like is Script i can call the WIndow elements using control break events in the driver prog but how to get this kind of output in Smartforms.???????
    Thanks

    I dont want trigger new page.
    In the same page i want like this
    I have purchase docu data in only 1 internal table.
    So, for every new VBELN, under this i want its corresponding item details.
    I have created the command node for the main window with 2 rows, in the 1st row i am giving VBELN and in the 2nd row i am giving in item details like item no, matnr etc etc and in the condition its askng Field name and Comparison Value.
    How shold i give condition.??????
    Thanks
    Edited by: Jalaaluddin Syed on May 1, 2008 5:03 PM

  • What if you move events from one external drive to another?

    I presently have all my iMovie events on one external drive, and I have some projects on my local iMac drive that use clips from the events on the external drive.
    What happens to the projects if I use iMovie to move the events from the current external drive to another external drive? If I open one of the projects, will it ask me where to find the event clips, or will I break all my projects?

    In theory, if you do it within iMovie, it should work. However, I would recommend that you test a single event first before moving everything.

  • Solved: I cannot manage (bring online, initialize, partition, format, or write to) a VHDX hard drive once it has "Enable Virtual Hard Disk Sharing" enabled.

    Hello,
    Issue:
    On a Virtual Machine with a secondary VHDX attached, I cannot manage (bring online, initialize, partition, format, or write to) the VHDX hard drive once it has "Enable Virtual Hard Disk Sharing (VHD Sharing)" enabled.
    Questions:
    Should I be able to manage (bring online, initialize, partition, format, and write to) a VHDX hard drive once it has VHD Sharing enabled? If I should be able to manage it, what am I missing?
    Topography:
    One SuperMicro Cluster In a Box (CIB) with 2012 R2 Data Center on each node. Microsoft Failover Cluster installed and working on each node. The Failover Cluster Servers on each host passes all cluster validation tests. Two Hyper-V 2012 R2 Data Center Virtual
    Machine (VM) servers, one on each node. 1 common Cluster Shared Volume (CSV) and 1 Generation 2 Scale-Out File Server (SOFS) shared volume both Resilient File System (REFS) formatted. One 5 Gigabit (Gb) Virtual Hard Drive Type X (VHDX) file on the CSV and/or
    SOFS. Integrity bit and read only turned off on VHDX file.
    Each of the two Hyper-V VMs have one 127Gb VHDX Generation 2 primary hard drive and 1 VHDX secondary hard drive attached, both on SCSI Controller #1.
    Background:
    If I start VM1 without the VHD Sharing enabled on the secondary hard drive, I can bring the drive online, initialize, partition, format, and write to the drive.
    If I enable VHD Sharing, I can no longer modify the drive in Disk Management in any way. With or without VM2 running.
    Both VMs and the CSV and SOFS are on the same host cluster server, or not, no difference…
    The VHDX is referenced either by the CSV name C:\ClusterStorage\Volume1\TEST1.VHDX
     or a Shared Folder name
    \\sharedfolder\folder\Test1.VHDX .
    If I start VM1 with VHD Sharing disabled and I format the drive, then shut down and enable VHD Sharing, the drive is offline and requests initialization which fails with an "I/O device error", every other attempt to manage the drive fails with
    the same "I/O device error", error.
    Events:
    VDS fails to write boot code on a disk during clean operation. Error code: 8007045D@02070008
    Log Name:      System
    Source:        Virtual Disk Service
    Date:          3/3/2015 11:39:18 AM
    Event ID:      10
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      Server1.Domain.local
    Description:
    VDS fails to write boot code on a disk during clean operation. Error code: 8007045D@02070008
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Virtual Disk Service" />
        <EventID Qualifiers="49664">10</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2015-03-03T19:39:18.000000000Z" />
        <EventRecordID>27318</EventRecordID>
        <Channel>System</Channel>
        <Computer> Server1.Domain.local </Computer>
        <Security />
      </System>
      <EventData>
        <Data>8007045D@02070008</Data>
      </EventData>
    </Event>
    AND
    Log Name:      System
    Source:        disk
    Date:          3/3/2015 12:16:42 PM
    Event ID:      153
    Task Category: None
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      Server1.Domain.local
    Description:
    The IO operation at logical block address 0x0 for Disk 1 (PDO name: \Device\MPIODisk1) was retried.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="disk" />
        <EventID Qualifiers="32772">153</EventID>
        <Level>3</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2015-03-03T20:16:42.017090000Z" />
        <EventRecordID>27333</EventRecordID>
        <Channel>System</Channel>
        <Computer>Server1.Domain.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>\Device\Harddisk1\DR1</Data>
        <Data>0x0</Data>
        <Data>1</Data>
        <Data>\Device\MPIODisk1</Data>
        <Binary>0F01040004002C00000000009900048000000000000000000000000000000000000000000000000000020488</Binary>
      </EventData>
    </Event>
    Thanks again for any help,
    Robert

    Hi All,
    I had to buy a Willy Wonka bar and spend a golden ticket to get an answer to this one.
    We found that the default LogicalSectorSizeBytes of a VHDX is 512b. It needs to be 4kb.
    The Host drive doesn't seem to matter CSV or SOFS. Below is a way to create a VHDX with the correct LogicalSectorSizeBytes.
    In Power Shell, type --> New-VHD -Path C:\ClusterStorage\Volume4\Cluster2DataDisks\Cluster2Disk1.vhdx -SizeBytes 200Gb -PhysicalSectorSizeBytes 4kb -LogicalSectorSizeBytes 4kb
    Attach the resulting file to your guest cluster servers and set the Enable Virtual Hard Disk Sharing option on both server. You should now be able to bring the drives on-line and initialize them. They will also add to the guest cluster pool.
    Change the size, path and file name above to fit your Cluster Servers configuration.
    Thank You 
    Sachin Kumar Support Engineer | Windows Server Setup Team | Microsoft Enterprise Platform for finding the answer to this one.
    Hope this helps others.
    Robert

  • Error while executing Servlet. java.lang. (Error in loading Specific Driver

    Hi all,
    I am getting the following error while running the servlet.
    Error:
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver,
    The above error arise while I try to access a data from the database table using servlet through browser, but the same driver works well in jdbc program(jdbc alone).
    Here is how I am load the driver:
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con=DriverManager.getConnection("jdbc:microsoft:sqlserver://NODE1:1433","**","**");
    con.setCatalog("senthil");
    Here is my software specification:
    Tomcat5.5.26,
    MS SQL Server 2000 Driver.
    Looking forward to your reply,
    Thanks in advance,
    Senthil.

    Hi,
    Thanks for your reply.
    Yes, I am using the Eclipse IDE, and it doesn't shows any error while I save the servlet source file.
    Please find the below source code:
    *1. JDBC program to retrive data from the database table: No issue works well.*
    The below source code works well and I used it to retrive the data from the database table using the jdbc.Here there is no problem, the source code works well.
    package pak;
    import java.sql.*;
    import java.io.*;
    class UserDataDemo
         public static void main(String args[])
              Connection con;
              ResultSet result;
              try
                   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   con=DriverManager.getConnection("jdbc:microsoft:sqlserver://NODE1:1433","user_name","password");
                   con.setCatalog("datadase_name");
                   Statement stat=con.createStatement();
                   result=stat.executeQuery("select * from table_name");
                   while(result.next())
                        System.out.println("**************************************");
                        System.out.println("Name :"+result.getString(1));
                        System.out.println("Company :"+result.getString(2));
                        System.out.println("Position:"+result.getString(3));
                        System.out.println("Emp Id :"+result.getInt(4));
                        System.out.println("Place :"+result.getString(5));
              catch(Exception e)
                   System.out.println(e);
    *2.Issue: Servlet program used to retrive data from the data base table through jdbc:*
    Here I am getting above said error : java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    Please note, here I dosen't get any compile time error(i.e, eclipse ide doesn't shows any error while saving this file).
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class ServletTest extends HttpServlet
         String name;
         ResultSet result;
         PrintWriter pw;
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
              Connection con;
              try
                   res.setContentType("text/html");
                   pw=res.getWriter();
                   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   con=DriverManager.getConnection("jdbc:microsoft:sqlserver://NODE1:1433","user_name","password");
                   con.setCatalog("database_name");
                   Statement stat=con.createStatement();
                   result=stat.executeQuery("select * from table_name");
                   while(result.next())
                        pw.println(result.getString(1));
              catch(Exception e)
                   pw.println(e);
    Also please note, I have no problem in running the servlet alone.
    Looking forward to your reply,
    Thanks,
    Senthil.

Maybe you are looking for

  • Transaction F-53 Post outgoing payments

    Hi. I have used BAPI_ACC_INVOICE_RECEIPT_POST for posting of invoice receipt / outgoing payment with success. But I futhermore want to mark my reference document / received invoice as cleared. Technically I wants to fill the clearing information on t

  • QM 9 not record anything

    I have installed QM on UCS server, Setup Configuration Setup is done. I have assign phones to user in Record Server Configuration. User, Team, Group in Personnel is created (non-AD) and configured the workflow to record all call. I am able to access

  • F110 REGUH

    Hi friends, We have vendors with alternative payee and the Bank details are configures for alternative payee. Now when we run the payment run on vendors REGUH table doesn't get updated with the Bank details ( of course these are details of alternativ

  • Installing Windows 7 on the new 27-inch I-Mac

    Hi, I have tried to instal windows 7 using the parallels desktop onto my new imac. but every time i get towards the end of the installation, i get a message telling me i need a device driver. i can't find the device driver, so i have no option but to

  • Windows 7 home basic 32 bit

    i have macbook air with a ssd drive, i installed windows 7 home basic 32 bit thru bootcamp and install the boot camp drivers as well but after restart it give me a BSOD and then restart to rpair mode start up options. what could be the cause of this?