5 weeks horrendus performance

Efibre installed may23
From day 1 constant drops in connection5 engineer have called out 
modem replaced exchange checked each time dls splitter changed
every time an engineer come out connection gets worse 
were down to connection being up for 2 secs at a time now
had a engineer refuse to change the interal wiring of the house
and to top it all last engineer arrived on Monday 
Rang tech support to be told on the system the engineer said no one at home even though he was here for at least an hour
What does it take to be able to get the internal cable relaced, then cable to the pole and so on
Seeing as nothing else works at would be a way to start a procces of elemination

Hi Alan Thanks for your responce
Had a engineer out last Friday
He changed the cable from the exchange to the fist pole and the cable to the next poleWeve had no drops since then so i am satisfied the issue has ben resolved
Thanks 

Similar Messages

  • How to send a Weekly E-mail to a Distribution list from Sharepoint by collecting all the events available in all Sharepoint calendars

    Hi,
        I have created many Calendars in my Sharepoint site like Meeting Calendar, Downtime Calendar etc. I will be creating some events in these calendars every week. My requirement is to collect all the events available in the calendar for that week
    and send a weekly mail with all this events to the distribution list
         Is this requirement can be done using the Sharepoint designer workflow or does it require any code related activities to accomplish this? If so can you please provide me the Steps by step process to complete this and can you also share
    the code in case if you have it
    Thanks in Advance

    Hi,
    Try with worklfow timer control and send mail to weekly.(Performance good)
    http://infomoss.blogspot.in/search/label/Workflow2010
    one more option try with Timerjob..(if no way use it)
    http://infomoss.blogspot.in/2013/05/companymicrosoft-todo-update-copyright.html
    http://infomoss.blogspot.in/2013/01/webclient-sharepoint-2010-read-image-uri.html
    Thanks
    Jaison A
    http://infomoss.blogspot.in

  • After adding seperate performance collections to MAP 9.1 database, the database has become corrupted

    Hi,
    I have installed MAP 9.1(9.1.265.0) on my notebook, with Windows 7 Enterprise. The inventory of our environment was successfull and I have successfully added some performance collections to the database.
    First I ran the performance collection for one hour, then added a performance collection of one week. this was okay.
    Then I waited one week and added another collection of about five days. That collection would not stop: It was scheduled to run between 2014-07-28 12:49:31 until 2014-08-01 05:00:04. But it was still running at 2014-08-01 05:30:25. I waited for a little
    bit longer, but the collection kept on running according to the status screen.
    So I cancelled out of the collection at 2014-08-01 05:45. In the performance data it said that the colection ran from Jul 14 2014 08:04 AM until Aug 1 2014 4:57AM. So that looked okay.
    But now, when I try to Get the performance metrics data from MAP, it states that I have to do a "Refressh Assessment", because I problably have cancelled out of a collection. This "Refresh Assessment" wil run for about an hour and than
    completes with a message "Failed"
    I get these errors in the MapToolkit.log
    <2014-08-05 05:14:51.09
    AssessInventoryWorker@StoredProcAssessment,I> RunAssessment() - [Perf] [[Perf_Assessment].[ClearPerfdata]] : 125 ms
    <2014-08-05 05:14:56.13
    AssessInventoryWorker@StoredProcAssessment,I> RunAssessment() - [Perf] [[Perf_Assessment].[CreateTimeIntervals]] : 5039 ms
    <2014-08-05 05:22:47.76
    AssessInventoryWorker@StoredProcAssessment,I> RunAssessment() - [Perf] [[Perf_Assessment].[CreateMetricsPerTimeInterval]] : 471591 ms
    <2014-08-05 05:52:54.66
    AssessInventoryWorker@DataAccessCore,W> DoWorkInTransaction<T>() - Caught InvalidOperationException trying to roll back the transaction: This SqlTransaction has completed; it is no longer usable.
    <2014-08-05 05:52:54.79
    AssessInventoryWorker@DataAccessCore,W> DoWorkInTransaction<T>() - Caught a SQL transaction timeout exception. Will retry 3 more time(s). Retrying in 5000 milliseconds.
    <2014-08-05 05:53:15.86
    AssessInventoryWorker@DataAccessCore,W> OpenConnection() - Caught a SqlException trying to connect to the database.  Will retry connection 3 more time(s).  Retrying in 5000 milliseconds.
    <2014-08-05 05:53:20.99
    AssessInventoryWorker@DataAccessCore,W> OpenConnection() - Caught a SqlException trying to connect to the database.  Will retry connection 2 more time(s).  Retrying in 10000 milliseconds.
    <2014-08-05 05:53:45.00
    AssessInventoryWorker@DataAccessCore,W> OpenConnection() - Caught a SqlException trying to connect to the database.  Will retry connection 1 more time(s).  Retrying in 15000 milliseconds.
    <2014-08-05 06:24:03.69
    AssessInventoryWorker@DataAccessCore,W> DoWorkInTransaction<T>() - Caught a SQL transaction timeout exception. Will retry 2 more time(s). Retrying in 10000 milliseconds.
    <2014-08-05 06:54:13.91
    AssessInventoryWorker@DataAccessCore,W> DoWorkInTransaction<T>() - Caught a SQL transaction timeout exception. Will retry 1 more time(s). Retrying in 15000 milliseconds.
    <2014-08-05 07:24:28.99 AssessInventoryWorker@Analyzer,E> RunAssessments() - Assessment threw an exception:
    <2014-08-05 07:24:29.03
    AssessInventoryWorker@AssessInventoryWorker,I> AssessmentCompletedEventHandler: Assessment completed event.
    <2014-08-05 07:24:29.09
    AssessInventoryWorker@TaskProcessor,I> WorkerCompleted: Worker: 'AssessInventoryWorker'
    <2014-08-05 07:24:29.15 TID-16@TaskProcessor,I> Run: Completed. Status: Failed
    Is there maybe a restriction to the intervalls of adding performance collection data, or is there something else I am doing wrong?
    (I made a backup of the database after the first week of performance data, that database is still usable, so I can try to add more performance collections to that version of the database)
    I hope someone has an idea what is going on.
    Thanks!

    Time between isn't the problem. If you look in the log file, SQL is timing out. I think the problem is machine resources and time related. After the performance data collection has run for the predefined amount of time, MAP has SQL execute various assessments
    on the data to aggregate the raw data into something MAP can use. The more raw data that exists, the longer SQL will take and the more CPU and memory resources SQL will need.
    I would recommend that you have at least 4 cores or vCPU's and 6-8 GB of memory dedicated to the machine on which MAP is running. I would also follow the directions in this Wiki article to increase the timeout in MAP so that MAP will give SQL the time it
    needs to complete the job.
    http://social.technet.microsoft.com/wiki/contents/articles/10397.map-toolkit-increasing-the-sql-database-timeout-value.aspx
    Please remember to click "Mark as Answer" on the post that helps you, and to click
    "Unmark as Answer" if a marked post does not actually answer your question. Please
    VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • Degraded system performance - possibly caused by external LaCie HD

    I'm stumped over what to do to solve a serious performance problem with my iMac. Here's the setup:
    Prior to today, I've been running:
    An iMac Intel Core 2 Duo 17" (late 2006). The guts of it all OEM: 1 GB (2x512) RAM, 250 GB HD, SuperDrive.
    A 500 GB LaCie USB 2.0 External HD.
    Two external optical drives; one that can read/burn CDs and one that can read//burn DVDs/CDs. Both of these are connected via FireWire
    Operating system: Mac OS 10.4.x
    Network: Wireless Airport on iMac to DLink wireless router to Sympatico DSL. Using OpenDNS
    Over the last few weeks, system performance (and by this, I mean basic tasks like copying a file or selecting a menu option or switching between apps) has degraded to the point where it could take several seconds simply switching from one app to another. No new software or devices were added over this time.
    Running Apple's Hard Disk Utility, I discovered some "Minor" problems on the internal hard drive. I booted up in safe mode, which automatically forces a disk repair, and, upon running disk utility again, the disk appears fine.
    Performance problems persisted.
    I ran disk utility on the external drive. No problems.
    Earlier this week, I decided to upgrade the OS.
    The upgrade took 5+ hours to install. (I'd heard it can take a while but 5 hours seems silly).
    Performance problems persisted.
    Last night, I loaded everything I needed on the internal drive and backed up to the external drive. THen I proceeded to do a clean install of the OS 10.5.6. I ran Software Update to get the latest Java machine and other updates.
    Still got problems. (Copying 2 GB of files I'd backed up on my external drive back to the internal drive took more than 2 hours! via USB 2.0)
    Ran Hard Disk Utility again. Everything's fine. Still have performance problems.
    Shut power down on all external drives and re-booted.
    Ah-ha! Now we're gettin' somewhere. Performance seems normal. System is responding to basic commands in the what seems like a normal way.
    But I need those external drives. First bright idea: Perhaps it's the cheap Dyntech 5-port USB hub that's gumming things up. To test, I disconnected the hub and connected the LaCie external drive directly to the iMac.
    Back to the same old problem.
    Ok -- so it seems pretty clear that the iMac and the LaCie drive, which once got along famously, are now like an old married couple -- grumpy and slow to respond to each other's requests. Again -- neither the LaCie drive nor the iMac internal drive report any problems via Hard Disk Utility. Files are being successfully copied back and forth albeit at a mind-numbingly slow speed. But for all intents and purposes, so long as the iMac is attached to the LaCie drive, it has all the zip and functional usefulness of my old Centris 610.
    Any and all suggestions gratefully welcomed.

    True unless you frequently attach and detach the drive so that indexing never is completed. To see if this may be the case with the drive attached, open Spotlight preferences, click on the Privacy tab, then drag the drive's icon into the list.
    You can also try a few other things, but start by downloading and installing AppleJack - VersionTracker or MacUpdate. Read instructions and run the program to do some cleanup. For other maintenance tips see:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility. For situations DU cannot handle the best third-party utilities are: Disk Warrior; DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation. TechTool Pro 4.5.1 or higher are Intel Mac compatible; Drive Genius is similar to TechTool Pro in terms of the various repair services provided. Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep. Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.
    OS X automatically defrags files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.
    For emergency repairs install the freeware utility Applejack. If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline. Note that AppleJack 1.5 is required for Leopard.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    1. Retrospect Desktop (Commercial - not yet universal binary)
    2. Synchronize! Pro X (Commercial)
    3. Synk (Backup, Standard, or Pro)
    4. Deja Vu (Shareware)
    5. Carbon Copy Cloner (Donationware)
    6. SuperDuper! (Commercial)
    7. Intego Personal Backup (Commercial)
    8. Data Backup (Commercial)
    9. SilverKeeper 2.0 (Freeware)
    10. MimMac (Commercial)
    11. CloneTool Hatchery (Shareware)
    12. Clone X (Commercial)
    The following utilities can also be used for backup, but cannot create bootable clones:
    1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
    2. Toast
    3. Impression
    4. arRSync
    Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.
    Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at www.versiontracker.com and www.macupdate.com.

  • GarageBand Performance Issues

    Greetings:
    I've been using GarageBand 3.04 for a couple of years without any problems. However, these past couple of weeks my performance has been sluggish. I've received "Core Audio - Disk is too slow" notices and also notices that I'm playing too many tracks simultaneously, even when there are only 3 tracks. I read some comments on another forum that suggested hard disk space may be the culprit, so I moved my working file to an external hard drive. I suppose my performance is now marginally better, but I'm still running into some slowness issues.
    The more obnoxious problem, in both cases (regular hard drive and external), is that when I play two tracks simultaneously (say a podcast voice track and a music track), the aggregate volume seems to decrease. Often I will fade out the music and add a speaking voice on my podcast, but I can't control it like I used to. If I have music underneath, and my voice is set at a steady volume, the voice will be relatively low while the music is still playing. Only once the music fades out to a very low volume will the volume of the voice approach its appropriate level very suddenly, despite my settings indicating that the volume should be steady the entire time. If I remember correctly, I used to be play a music track and have a voice over simultaneously without having any drop-off in the voice volume.
    I don't know why I'm encountering this problem but it is affecting the quality of my podcast. Is this also a memory issue? Do I need more RAM (I only have 1 GB - 2 more GB are on order).
    I'd appreciate any advice people have. I can live with some slow performance and memory issues occasionally, as long as it doesn't affect the end result. In this case, though, the quality of the podcast is compromised.
    With many thanks!

    Hi,
    I do not have a solution but I do get the"too many tracks..."
    notice all the time, and r
    then it plays OK.
    I have 3 GB memory and 2.16 GHz Intel core 2 duo.
    I have plenty of spare memory.
    I just played a song on GB and still had 1.27 GB free memory!!
    I am using GB version 3.0.4.
    Henry.

  • IMac performance slow again after installing memory

    Hi,
    I installed an extra 4g of ram in my iMac about 4 weeks ago (so now has 8g).  Initiallly, it was super fast and very smooth.  A couple of weeks on, performance has slipped.  It feels as it did prior to installing. For example, I was running Logic files and getting Core Audio overload messages. After extra ram no more issues but in the last couple of weeks they've come back again.  Screen sharing is now back to being jerky.  Any ideas??
    Granger

    This is a few lines from each of the main blocks of text, it goes on for ages though......
    Where it refers to Graphtec, thats a cutting plotter I have hooked up
    15/10/2013 17:04:34          com.apple.UserEventAgent-Aqua[148]          2013-10-15 17:04:34.684 makequeuesagent[1464:903] There are no drivers posted for 'MANUFACTURER:Graphtec;MODEL:CE5000'.
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          Passphrase Length = 448560
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          Cannot find feature = EXPIRATION_DATE
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          Cannot find feature = DEMO_DURATION
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          Cannot open security config
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          LoadSentinel::LoadSentinel
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          error LoadSentinel::LoadSentinel CFBundleCreate
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          main
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          Run
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::StartUp
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::StartUp InitializeLM
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::StartUp PreferenceManager::initialize
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          plgIn
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          end run
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::StartUp Exit
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::StartUp SendAEQuit
    15/10/2013 17:10:44          [0x0-0xa30a3].biz.saintl.flexisignpro[1462]          AIPluginApp::AttemptQuitSelf
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          ].modelPID = 16422
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][1].modelName = 5300
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][1].modelType = 1
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][2].modelVID = 1034
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][2].modelPID = 16423
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][2].modelName = 5500
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          2].modelType = 2
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][3].modelVID = 1034
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][3].modelPID = 16433
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][3].modelName = ESP 3
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][3].modelType = 3
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][4].modelVID = 1034
    15/10/2013 19:20:00          com.kodak.KODAK AiO Firmware Updater[1800]          gPrinterDescriptorArray[0][4].modelPID = 16434
    10/2013 23:38:18          [0x0-0x4d04d].com.apple.iTunes[639]          ATHostConnectionDestroy 0x1b5dda30
    15/10/2013 23:38:19          [0x0-0x4d04d].com.apple.iTunes[639]          AppleGVA:: Error creating the accelerator 1
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          mDNSPlatformLock m->p->ep NULL!
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          mDNSPlatformUnlock m->p->ep NULL!
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          mDNSPlatformLock m->p->ep NULL!
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          mDNSPlatformUnlock m->p->ep NULL!
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Passphrase Length = 4
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = EXPIRATION_DATE
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = DEMO_DURATION
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot open security config
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          LoadSentinel::LoadSentinel
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          error LoadSentinel::LoadSentinel CFBundleCreate
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_RIP_ORIENTATION
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_Default_Color_Mode
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_Device_ID
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_RIP_ORIENTATION
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_Default_Color_Mode
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = PM_Device_ID
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Image Color Rendering Intent
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Vector Color Rendering Intent
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Text Color Rendering Intent
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Gradient Color Rendering Intent
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Image Color Rendering Intent NonCMYK
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Vector Color Rendering Intent NonCMYK
    15/10/2013 23:38:20          [0x0-0x39039].biz.saintl.monitor[453]          Cannot find feature = Default Text Color Rendering Intent NonCMYK
    6/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][14].modelName = HERO 8.2
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][14].modelType = 802
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][15].modelVID = 1034
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][15].modelPID = 16488
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][15].modelName = HERO 2.2
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][15].modelType = 202
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][16].modelVID = 1034
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][16].modelPID = 16489
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][16].modelName = HERO 4.2
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          gPrinterDescriptorArray[1][16].modelType = 402
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          Obtained all of gPrinterDescriptorArray[][]!
    16/10/2013 09:16:37          com.kodak.BonjourAgent[169]          Read 518 bytes from the local plist.
    17/10/2013 15:04:18          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:18 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetLineWidth: invalid context 0x0
    17/10/2013 15:04:18          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:18 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetLineDash: invalid context 0x0
    17/10/2013 15:04:18          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:18 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextStrokeLineSegments: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextClipToRects: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextTranslateCTM: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextScaleCTM: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetShouldAntialias: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetLineWidth: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetLineDash: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextStrokeLineSegments: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextClipToRects: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextTranslateCTM: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextScaleCTM: invalid context 0x0
    17/10/2013 15:04:34          [0x0-0x24024].com.adobe.illustrator[256]          Thu Oct 17 15:04:34 Granger-Mortons-iMac.local Adobe Illustrator[256] <Error>: CGContextSetShouldAntialias: invalid context 0x0

  • American Idol performances not avail on iTunes for iPhone?

    Am I blind or dumb? I am trying to find and download some of the recent American Idol performances / studio recordings, but none of them come up on iTunes on my iPhone. I can get them fine on iTunes on my computer, but nothing comes up when searching directly on the iPhone.
    I've done some searching for this topic to no avail.
    What gives?!?
    Message was edited by: ijgordon

    Go to the Store on your phone, tap music at the bottom and scroll all the way to the bottom of the page, just above your account info you'll see the Idol logo and a link to download this week's performances.

  • Difference in the performance of Quality and Production system

    Hi All,
    We have a scenario wherein we refreshed the production system data into quality system 1 month ago.
    Few days back we noticed that when we are trying to fetch data from COMM_PRODUCT database table (in CRM Production system) based on the product description.....it was taking 2-3 mins.
    However, when we try the same in quality system, it takes only 10 secs. Any idea as to how there is such a difference when both the production and quality contain nearly same data (was refreshed only one month ago).
    Any thoughts on this?

    You should really search the forum before asking. Exactly the same question was asked and answered here two weeks ago: Performance of the program is very good in Quality but Very poor in Prod.
    Rob

  • Gui_upload

    Hi  i have  one zprogram, it is written for to get the data from application server ,
    now i need to change the code to take the file from local drive.
    here iam giving the code ,could any one help me in this.
    INCLUDE zppiforecasttop.
    INCLUDE zppiforecastf01.
    SELECTION SCREEN EVENTS
    *Check the splitting rules against source file format
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP r4.
    IF rb_spmon = 'X' AND rb_week = 'X'.
    MESSAGE e005(z1) WITH text-t13.
    ENDIF.
    IF rb_spday <> 'X' AND rb_daily = 'X'.
    MESSAGE e005(z1) WITH text-t14.
    ENDIF.
    F4 value help on filename field
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR: w_choice, t_filelist.
    REFRESH: t_filelist.
    w_proc = 'proc'.
    w_txt = 'txt'.
    get and open logical filename
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    logical_filename = p_lognam
    parameter_1 = i_para_1
    parameter_2 = i_para_2
    parameter_3 = i_para_3
    IMPORTING
    file_name = w_dir
    EXCEPTIONS
    file_not_found = 1
    OTHERS = 2.
    IF sy-subrc NE 0.
    MESSAGE e005(z1) WITH text-t18.
    ENDIF.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
    EXPORTING
    dir_name = w_dir
    file_mask = '.'
    TABLES
    dir_list = t_files
    EXCEPTIONS
    invalid_eps_subdir = 1
    sapgparam_failed = 2
    build_directory_failed = 3
    no_authorization = 4
    read_directory_failed = 5
    too_many_read_errors = 6
    empty_directory_list = 7
    OTHERS = 8.
    *If the return code is not 0 exit from event
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    *Loop at list of files and convert to display format
    LOOP AT t_files.
    only show processed files with filename 'proc'
    SEARCH t_files-name FOR w_proc.
    IF sy-subrc = 0.
    t_filelist-name = t_files-name.
    t_filelist-size = t_files-size.
    APPEND t_filelist.
    ENDIF.
    only show processed files with filename 'txt'
    SEARCH t_files-name FOR w_txt.
    IF sy-subrc = 0.
    t_filelist-name = t_files-name.
    t_filelist-size = t_files-size.
    APPEND t_filelist.
    ENDIF.
    ENDLOOP.
    IF t_filelist[] IS INITIAL.
    EXIT.
    ENDIF.
    ENDIF.
    *Display list of available files in a popup screen
    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
    endpos_col = '100'
    endpos_row = '23'
    startpos_col = '10'
    startpos_row = '5'
    titletext = 'Select File'
    IMPORTING
    choise = w_choice
    TABLES
    valuetab = t_filelist
    EXCEPTIONS
    break_off = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    READ TABLE t_filelist INDEX w_choice.
    CONCATENATE w_dir t_filelist-name INTO p_file.
    ELSE.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Start of Selection
    START-OF-SELECTION.
    *Check that the filetype corresponds to the selection
    PERFORM check_file.
    *Upload the file by resolving logical filename.
    PERFORM upload_file.
    *Depending on the selection criteria, alter the input data into the
    *desired format and store.
    PERFORM populate_post_split_table.
    *Build the idoc of type SOPGEN01
    PERFORM post_idoc.
    Rename the file extension from '.txt' to '*.proc_yyyymmdd', if
    *reprocessing a file do nothing
    SEARCH p_file FOR '*txt'.
    IF sy-subrc = 0.
    PERFORM rename_file.
    ENDIF.
    End of Selection
    END-OF-SELECTION.
    *Output error report
    PERFORM error_report.
    Top of Page
    TOP-OF-PAGE.
    PERFORM top_of_page.
    &#9668;.........this is the first include........................
    &#9668;----
    INCLUDE ZPPIFORECASTTOP *
    TABLES
    TABLES: marc, "Plant Data for Material
    marm, "Units of Measure for Material
    edidd, "Data record (IDoc)
    edidc, "Control Segment
    e1lipm0, "General characteristic segment
    e1lipv0, "General version segment
    e1lipp0. "Performance measure segment
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.
    PARAMETERS: rb_1000 RADIOBUTTON GROUP r1 DEFAULT 'X',
    rb_1005 RADIOBUTTON GROUP r1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t02.
    PARAMETERS: rb_mgx RADIOBUTTON GROUP r2 DEFAULT 'X',
    rb_other RADIOBUTTON GROUP r2.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-t03.
    PARAMETERS: rb_month RADIOBUTTON GROUP r3 DEFAULT 'X',
    rb_week RADIOBUTTON GROUP r3,
    rb_daily RADIOBUTTON GROUP r3.
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-t04.
    PARAMETERS: rb_spmon RADIOBUTTON GROUP r4 DEFAULT 'X',
    rb_spwk RADIOBUTTON GROUP r4,
    rb_spday RADIOBUTTON GROUP r4.
    SELECTION-SCREEN END OF BLOCK b5.
    SELECT-OPTIONS: so_datum FOR sy-datum, " (Planning time horizon)
    so_matnr FOR marc-matnr. " (Material Master)
    PARAMETERS: p_lognam LIKE filenameci-fileintern
    DEFAULT 'ZPPIFORECAST_FILENAME' NO-DISPLAY,
    p_file LIKE rlgrap-filename OBLIGATORY. "(Input file)
    SELECTION-SCREEN END OF BLOCK b1.
    TYPES
    TYPES: BEGIN OF workdate,
    datum LIKE sy-datum,
    day TYPE p,
    workday(1) TYPE c,
    END OF workdate.
    TYPES: BEGIN OF postsplit.
    INCLUDE STRUCTURE zppiforecast.
    TYPES: fromdat LIKE sy-datum,
    todat LIKE sy-datum,
    split_date LIKE sy-datum,
    split_value(10) TYPE c,
    flg_noscp(1) TYPE c,
    END OF postsplit.
    TYPES: BEGIN OF exception.
    INCLUDE STRUCTURE zppiforecast.
    TYPES: docnum TYPE docnum,
    message TYPE edi_statx_,
    END OF exception.
    TYPES: BEGIN OF filelist,
    name TYPE epsfilnam,
    size(10) TYPE c,
    END OF filelist.
    DATA
    DATA: t_files TYPE TABLE OF epsfili INITIAL SIZE 0 WITH HEADER LINE,
    i_file TYPE TABLE OF zppiforecast INITIAL SIZE 0 WITH HEADER LINE,
    t_exception TYPE TABLE OF exception INITIAL SIZE 0
    WITH HEADER LINE,
    i_post_split TYPE TABLE OF postsplit INITIAL SIZE 0
    WITH HEADER LINE,
    t_workdates TYPE TABLE OF workdate INITIAL SIZE 0
    WITH HEADER LINE,
    t_filelist TYPE TABLE OF filelist INITIAL SIZE 0 WITH HEADER LINE.
    DATA: t_edidc TYPE TABLE OF edidc INITIAL SIZE 0 WITH HEADER LINE,
    t_edidd TYPE TABLE OF edidd INITIAL SIZE 0 WITH HEADER LINE,
    t_edids TYPE TABLE OF edids INITIAL SIZE 0 WITH HEADER LINE.
    DATA: w_choice TYPE sy-tabix, "Index of chosen file
    w_line(100), "100 character string
    w_dir LIKE epsf-epsdirnam, "Directory path
    w_hiper LIKE t445p-hiper, "Forecast lower limit
    w_fuper LIKE t445p-fuper, "Forecast upper limit
    w_count TYPE i, "Counter
    w_total TYPE i, "Total
    w_start LIKE sy-datum, "Start date in the range
    w_end LIKE sy-datum, "End date in the range
    w_date LIKE sy-datum, "Curent Date
    w_first LIKE sy-datum, "First working date in range
    w_flg_noscp(1) TYPE c, "No SCP UoM flag
    w_days TYPE butag, "No of days
    w_day TYPE p, "Day of the week indicator
    w_value LIKE zppiforecast-value, "Record Value
    w_post_split TYPE postsplit, "Work area for post split table line
    w_docnum LIKE edidc-docnum, "IDOC number
    w_docnum_no_zero LIKE w_docnum, " IDOC number wthout zeros
    w_statva LIKE stacust-statva,
    w_error(1) TYPE c,
    w_matnr TYPE matnr,
    w_tabix TYPE sytabix,
    w_messg TYPE message,
    w_msgln TYPE i,
    w_todat LIKE sy-datum,
    w_fromdat LIKE sy-datum,
    w_lines TYPE i,
    w_count_idoc_errors TYPE i,
    w_count_recs_uploaded TYPE i,
    w_count_idoc_posted TYPE i.
    DATA: w_proc(4) TYPE c.
    DATA: w_txt(4) TYPE c.
    DATA: logsys LIKE tbdls-logsys.
    CONSTANTS
    CONSTANTS: c_uom LIKE marm-meinh VALUE 'SCP', "Unit of measure
    c_delim TYPE x VALUE '09',
    c_type LIKE rlgrap-filetype VALUE 'DAT',
    c_werks_1000 LIKE marc-werks VALUE '1000',
    c_werks_1005 LIKE marc-werks VALUE '1005',
    c_pltyp_805 LIKE t445p-sctyp VALUE 'Z_805',
    c_pltyp_810 LIKE t445p-sctyp VALUE 'Z_810',
    c_mestyp_805 TYPE edi_mestyp VALUE 'LIP805',
    c_mestyp_810 TYPE edi_mestyp VALUE 'LIP810',
    c_rcvprt TYPE edi_rcvprt VALUE 'LS',
    c_sndprn TYPE edi_sndprn VALUE 'WEBM_LS',
    c_sndprt TYPE edi_sndprt VALUE 'LS'.
    &#9668;..............this is the second include.................
    &#9668;----
    INCLUDE ZPPIFORECASTF01 *
    *& Form upload_file
    form upload_file.
    data: w_matnr like mara-matnr,
    w_datum like sy-datum.
    *Open file in read mode
    open dataset p_file for input in text mode.
    if sy-subrc = 0.
    do.
    clear: t_exception.
    *Read line of data into text string variable
    read dataset p_file into w_line.
    *If successful. append the internal file table
    if sy-subrc = 0.
    add 1 to w_count_recs_uploaded.
    *Split the string at delimiter into internal file table
    split w_line at c_delim into i_file-matnr
    i_file-datum
    i_file-value.
    call function 'CONVERSION_EXIT_MATN1_INPUT'
    exporting
    input = i_file-matnr
    importing
    output = w_matnr
    exceptions
    length_error = 1
    others = 2.
    i_file-index = sy-index.
    *Check that the date is in the correct format.
    call function 'CONVERT_DATE_TO_INTERN_FORMAT'
    exporting
    datum = i_file-datum
    dtype = 'DATS'
    importing
    error = w_error
    idate = i_file-datum
    messg = w_messg
    msgln = w_msgln.
    *If an error has occurred write entry to error table, otherwise append
    *record list
    if not w_error is initial.
    t_exception = i_file.
    t_exception-message = text-006.
    append t_exception.
    else.
    check i_file-datum in so_datum.
    append i_file.
    endif.
    else.
    exit.
    endif.
    enddo.
    else.
    message w005(z1) with 'File ' p_file ' cannot be opened'.
    endif.
    *Close the file
    close dataset p_file.
    endform. " upload_file
    *& Form process_monthly
    form process_monthly.
    data: w_mm type bumon,
    w_yyyy type bdatj.
    w_mm = i_file-datum+4(2).
    w_yyyy = i_file-datum(4).
    *Get the number of days in the month
    call function 'NUMBER_OF_DAYS_PER_MONTH_GET'
    exporting
    par_month = w_mm
    par_year = w_yyyy
    importing
    par_days = w_days.
    *Set date variable to first day
    w_date = i_file-datum.
    *Get the first working day in the month
    perform get_first_day.
    *Set date variable to last day in the month
    w_date = i_file-datum + w_days - 1.
    *Get the last working day in the month
    perform get_last_day.
    *Populate the post split table with monthly value
    i_post_split-split_value = w_value.
    i_post_split-matnr = i_file-matnr.
    i_post_split-fromdat = w_fromdat.
    i_post_split-todat = w_todat.
    i_post_split-datum = i_file-datum.
    i_post_split-value = i_file-value.
    i_post_split-index = i_file-index.
    i_post_split-split_date = i_file-datum.
    i_post_split-flg_noscp = w_flg_noscp.
    append i_post_split.
    endform. " process_monthly
    *& Form check_material
    form check_material using value(plant) value(pltyp).
    *Check that the material plant combination exists
    select single matnr from marc into w_matnr
    where matnr = i_file-matnr
    and werks = plant.
    *Check return code, if no record found, write to error table and delete
    if sy-subrc <> 0.
    w_tabix = sy-tabix.
    t_exception = i_file.
    t_exception-message = text-001.
    append t_exception.
    delete i_file index w_tabix.
    w_error = 'X'.
    exit.
    endif.
    Start DEVK931385
    if plant = c_werks_1000. "DEVK931385
    *Check that the material exists in the infotype hierarchy
    select single matnr from s805e into w_matnr where ssour = space
    and werks = plant
    and matnr = i_file-matnr.
    else. "DEVK931385
    *Check that the material exists in the infotype hierarchy S810e
    select single matnr from s810e into w_matnr where ssour = space
    and werks = plant
    and matnr = i_file-matnr.
    endif. "DEVK931385
    End DEVK931385
    if sy-subrc <> 0.
    w_tabix = sy-tabix.
    t_exception = i_file.
    t_exception-message = text-006.
    append t_exception.
    delete i_file index w_tabix.
    w_error = 'X'.
    exit.
    endif.
    *Get the forcast limits from info structure
    select single hiper fuper from t445p into (w_hiper, w_fuper)
    where sctyp = pltyp.
    *Determine start and end limits for forecasting based on current date
    w_start = sy-datum - w_hiper.
    Start DEVK931340
    w_end = sy-datum + w_fuper. "DEL
    w_end = sy-datum + ( ( w_fuper * 7 ) / 5 ).
    END DEVK931340
    endform. " check_material
    12:33:06 PM&#9668;&----
    *& Form process_weekly
    form process_weekly.
    data: w_mm type bumon,
    w_yyyy type bdatj.
    clear: w_total.
    w_date = i_file-datum.
    w_mm = i_file-datum+4(2).
    w_yyyy = i_file-datum(4).
    *If the souce file is in monthly format
    if rb_month = 'X'.
    *Get the number of days in the current month
    call function 'NUMBER_OF_DAYS_PER_MONTH_GET'
    exporting
    par_month = w_mm
    par_year = w_yyyy
    importing
    par_days = w_days.
    *Set date variable to last day in the month
    w_date = i_file-datum + w_days - 1.
    *Get the last working day in the month
    perform get_last_day.
    *Set date variable to first day
    w_date = i_file-datum.
    *Get the first working day in the month
    perform get_first_day.
    else.
    *Otherwise set for days in week
    w_days = 7.
    endif.
    do w_days times.
    *Clear the table of workdates
    clear: t_workdates.
    *Check if the day is a working day
    call function 'DATE_CHECK_WORKINGDAY'
    exporting
    date = w_date
    factory_calendar_id = 'GB'
    message_type = 'I'
    exceptions
    date_after_range = 1
    date_before_range = 2
    date_invalid = 3
    date_no_workingday = 4
    others = 5.
    *If successful, set the workday flag to (Y)es
    if sy-subrc = 0.
    t_workdates-datum = w_date.
    t_workdates-workday = 'Y'.
    *Increment the counter for total number of workdays
    add 1 to w_total.
    else.
    *Otherwise (N)o
    t_workdates-datum = w_date.
    t_workdates-workday = 'N'.
    endif.
    *Get the day in the week of the current date, (1 = Monday, 7 = Sunday)
    call function 'DAY_IN_WEEK'
    exporting
    datum = w_date
    importing
    wotnr = t_workdates-day.
    append t_workdates.
    add 1 to w_date.
    enddo.
    loop at t_workdates.
    *If the day is a workday
    if t_workdates-workday = 'Y'.
    *If the fromdate is blank, set to current date in loop (first working
    *day)
    if i_post_split-fromdat is initial.
    i_post_split-fromdat = t_workdates-datum.
    i_post_split-split_date = t_workdates-datum.
    endif.
    *Set variable to pick up last working date
    i_post_split-todat = t_workdates-datum.
    *Increment loop counter
    add 1 to w_count.
    endif.
    *If the day is a Sunday
    if ( ( t_workdates-day = 7 or t_workdates-datum+6(2) = w_days )
    and w_count <> 0 ).
    *Poplulate the post split table
    if rb_month = 'X'.
    i_post_split-fromdat = w_fromdat.
    i_post_split-todat = w_todat.
    endif.
    i_post_split-matnr = i_file-matnr.
    i_post_split-datum = i_file-datum.
    i_post_split-value = i_file-value.
    i_post_split-index = i_file-index.
    i_post_split-split_value = ( ( w_value / w_total ) * w_count ).
    i_post_split-flg_noscp = w_flg_noscp.
    append i_post_split.
    clear: w_count,
    i_post_split.
    endif.
    endloop.
    endform. " process_weekly
    *& Form get_first_day
    form get_first_day.
    do w_days times.
    call function 'DATE_CHECK_WORKINGDAY'
    exporting
    date = w_date
    factory_calendar_id = 'GB'
    message_type = 'I'
    exceptions
    date_after_range = 1
    date_before_range = 2
    date_invalid = 3
    date_no_workingday = 4
    others = 5.
    if sy-subrc = 0.
    w_fromdat = w_date.
    exit.
    endif.
    add 1 to w_date.
    enddo.
    endform. " get_first_day
    *& Form get_last_day
    form get_last_day.
    do w_days times.
    call function 'DATE_CHECK_WORKINGDAY'
    exporting
    date = w_date
    factory_calendar_id = 'GB'
    message_type = 'I'
    exceptions
    date_after_range = 1
    date_before_range = 2
    date_invalid = 3
    date_no_workingday = 4
    others = 5.
    if sy-subrc = 0.
    w_todat = w_date.
    exit.
    endif.
    subtract 1 from w_date.
    enddo.
    endform. " get_last_day
    12:33:30 PM&#9668;
    *& Form process_daily
    form process_daily.
    data: w_mm type bumon,
    w_yyyy type bdatj,
    new_w_date like w_date.
    clear: w_total.
    w_mm = i_file-datum+4(2).
    w_yyyy = i_file-datum(4).
    w_date = i_file-datum.
    if rb_month = 'X'.
    *Get the number of days in the current month
    call function 'NUMBER_OF_DAYS_PER_MONTH_GET'
    exporting
    par_month = w_mm
    par_year = w_yyyy
    importing
    par_days = w_days.
    *If the source file is in weekly format set to days in week
    elseif rb_week = 'X'.
    w_days = 7.
    else.
    *If source file is daily, set to day
    w_days = 1.
    endif.
    do w_days times.
    clear: t_workdates.
    *Check the current day is a workday
    call function 'DATE_CHECK_WORKINGDAY'
    exporting
    date = w_date
    factory_calendar_id = 'GB'
    message_type = 'I'
    exceptions
    date_after_range = 1
    date_before_range = 2
    date_invalid = 3
    date_no_workingday = 4
    others = 5.
    *If successful, set workday flag to (Y)es and append workday table
    if sy-subrc = 0.
    t_workdates-datum = w_date.
    t_workdates-workday = 'Y'.
    append t_workdates.
    *Increment total
    add 1 to w_total.
    START PKA01
    else.
    Add 1 to w_date and w_days to make it loop again until a the next work
    day is found!!!!!
    END PKA01
    if rb_daily = 'X'.
    new_w_date = w_date.
    while new_w_date ne ''.
    add 1 to new_w_date.
    *Check the current day is a workday
    call function 'DATE_CHECK_WORKINGDAY'
    exporting
    date = new_w_date
    factory_calendar_id = 'GB'
    message_type = 'I'
    exceptions
    date_after_range = 1
    date_before_range = 2
    date_invalid = 3
    date_no_workingday = 4
    others = 5.
    if sy-subrc = 0.
    t_workdates-datum = new_w_date.
    t_workdates-workday = 'Y'.
    append t_workdates.
    add 1 to w_total.
    exit.
    endif.
    endwhile.
    endif.
    endif.
    *Increment date
    add 1 to w_date.
    enddo.
    *Get the number of workdays in the period
    describe table t_workdates lines w_lines.
    *Get the first entry in the table
    read table t_workdates index 1.
    w_fromdat = t_workdates-datum.
    *Get the last entry in the table
    read table t_workdates index w_lines.
    w_todat = t_workdates-datum.
    loop at t_workdates.
    *Populate the post split table
    i_post_split-fromdat = w_fromdat.
    i_post_split-todat = w_todat.
    i_post_split-split_date = t_workdates-datum.
    i_post_split-matnr = i_file-matnr.
    i_post_split-datum = i_file-datum.
    i_post_split-value = i_file-value.
    i_post_split-index = i_file-index.
    i_post_split-split_value = w_value / w_total.
    i_post_split-flg_noscp = w_flg_noscp.
    START PKA01
    For daily sorce data which is split daily check that an entry doesnt
    already exist in the post split table for this date - only the fromdat
    is checked because for daily split fromdat = todat
    read table i_post_split into w_post_split
    with key matnr = i_file-matnr
    fromdat = i_file-datum
    split_date = t_workdates-datum.
    if sy-subrc = 0.
    ...an entry exist so add the new value to the existing one and update
    the table record
    i_post_split-split_value = i_post_split-split_value +
    w_post_split-split_value.
    append i_post_split.
    MODIFY i_post_split from w_post_split index sy-tabix.
    else.
    END PKA01
    append i_post_split.
    START PKA01
    endif.
    END PKA01
    endloop.
    endform. " process_daily
    *& Form check_range
    form check_range.
    *If file date is not in forcast range discard
    if i_file-datum < w_start or i_file-datum > w_end.
    w_tabix = sy-tabix.
    t_exception = i_file.
    t_exception-message = text-002.
    append t_exception.
    delete i_file index w_tabix.
    w_error = 'X'.
    endif.
    endform. " check_range
    *& Form check_uom
    form check_uom.
    *Get the alternative UoM for Material
    select single * from marm where matnr = i_file-matnr
    and meinh = c_uom.
    if sy-subrc = 0.
    w_value = ( i_file-value * ( marm-umren / marm-umrez ) ).
    else.
    w_value = i_file-value.
    w_flg_noscp = 'X'.
    endif.
    w_flg_noscp = 'X'. "jsa01
    endform. " check_uom
    *& Form check_first_day
    form check_first_day.
    *If the date is not the first of the month, copy to error table, delete
    *and end current loop process
    if i_file-datum+6(2) <> '01'.
    w_tabix = sy-tabix.
    t_exception = i_file.
    t_exception-message = text-003.
    append t_exception.
    delete i_file index w_tabix.
    w_error = 'X'.
    endif.
    endform. " check_first_day
    12:34:00 PM&#9668;&----
    *& Form check_monday
    form check_monday.
    call function 'DAY_IN_WEEK'
    exporting
    datum = i_file-datum
    importing
    wotnr = w_day.
    *If the day is not a monday, copy to error table, delete
    *and end current loop process
    if w_day <> 1.
    w_tabix = sy-tabix.
    t_exception = i_file.
    t_exception-message = text-004.
    append t_exception.
    delete i_file index w_tabix.
    w_error = 'X'.
    endif.
    endform. " check_monday
    *& Form populate_post_split_table
    form populate_post_split_table.
    *Sort the uploaded table by material and date
    sort i_file by matnr datum.
    loop at i_file.
    perform material_internal_format.
    *clear loop variables
    clear: w_hiper,
    w_fuper,
    w_count,
    w_error,
    w_fromdat,
    w_todat,
    w_flg_noscp,
    t_exception.
    *Clear the contents of the internal table which holds work days
    refresh: t_workdates.
    *If plant radiobutton is set
    if rb_1000 = 'X'.
    *Check the material/plant combination
    perform check_material using c_werks_1000 c_pltyp_805.
    else.
    *Check the material/plant combination
    perform check_material using c_werks_1005 c_pltyp_810.
    endif.
    if w_error = 'X'.
    continue.
    endif.
    *If the uploaded file is in monthly format
    if rb_month = 'X'.
    *Check that the record is for the first day of the month
    perform check_first_day.
    if w_error = 'X'.
    continue.
    endif.
    *Check the value is within the range for the infotype
    perform check_range.
    if w_error = 'X'.
    continue.
    endif.
    *Check that an 'SCP' unit of measure exists and convert value
    perform check_uom.
    *Otherwise if the file is in weekly format
    elseif rb_week = 'X'.
    *Check that the record corresponds to a monday
    perform check_monday.
    if w_error = 'X'.
    continue.
    endif.
    *Check the value is within the range for the infotype
    perform check_range.
    if w_error = 'X'.
    continue.
    endif.
    *Check that an 'SCP' unit of measure exists and convert value
    perform check_uom.
    else.
    *Check the value is within the range for the infotype
    perform check_range.
    if w_error = 'X'.
    continue.
    endif.
    *Check that an 'SCP' unit of measure exists and convert value
    perform check_uom.
    endif.
    *If split monthly flag has been chosen
    if rb_spmon = 'X'.
    *Process value using split monthly process
    perform process_monthly.
    *Otherwise, if weekly split
    elseif rb_spwk = 'X'.
    *Process value using split weekly process
    perform process_weekly.
    *Otherwise daily split
    else.
    *Process value using split daily process
    perform process_daily.
    endif.
    endloop.
    endform. " populate_post_split_table
    *& Form build_idoc
    Build and submit the idoc for processing
    form post_idoc.
    *Get the logical system for ALE processing
    perform get_ale_data.
    check not logsys is initial.
    *Populate the IDOC control record
    perform build_control_data.
    *Sort the data by material, date and value
    sort i_post_split by matnr datum value fromdat todat split_date.
    *Build idocs and post them
    loop at i_post_split.
    clear: e1lipp0,
    t_exception.
    *Move i_post_split header to a work area
    w_post_split = i_post_split.
    at new datum.
    clear: e1lipm0, e1lipv0, t_edidd.
    refresh t_edidd.
    *Build the general characteristic segment
    perform build_e1lipm0_segment.
    *Build the general version segment
    perform build_e1lipv0_segment.
    endat.
    *Build the performance measure segment
    perform build_e1lipp0_segment.
    at end of datum.
    *Submit IDOC for inbound processing
    perform submit_idoc.
    endat.
    endloop.
    endform. " build_idoc
    12:34:22 PM&#9668;&----
    *& Form submit_idoc
    Start inbound processing of IDOC
    form submit_idoc.
    clear: w_docnum_no_zero.
    call function 'IDOC_WRITE_AND_START_INBOUND'
    exporting
    i_edidc = edidc
    do_commit = 'X'
    importing
    docnum = w_docnum
    tables
    i_edidd = t_edidd
    exceptions
    idoc_not_saved = 1
    others = 2.
    if sy-subrc = 0.
    call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
    exporting
    input = w_docnum
    importing
    output = w_docnum_no_zero.
    perform check_idoc_status_records.
    else.
    t_exception-index = w_post_split-index.
    t_exception-matnr = w_post_split-matnr.
    t_exception-datum = w_post_split-datum.
    t_exception-message = t_edids-statxt.
    append t_exception.
    w_error = 'X'.
    endif.
    *If the no SCP UoM flag is set, write an entry to exception table
    if w_post_split-flg_noscp = 'X'.
    t_exception-index = w_post_split-index.
    t_exception-matnr = w_post_split-matnr.
    t_exception-datum = w_post_split-datum.
    t_exception-value = w_post_split-value.
    t_exception-docnum = w_docnum_no_zero.
    t_exception-message = text-005.
    append t_exception.
    endif.
    endform. " write_idoc
    *& Form build_control_data
    *& Build the IDOC control record
    form build_control_data.
    clear edidc.
    edidc-idoctp = 'SOPGEN01'. " Basic type
    if rb_1000 = 'X'.
    edidc-mestyp = c_mestyp_805. " Message type
    else.
    edidc-mestyp = c_mestyp_810. " Message type
    endif.
    edidc-rcvprt = c_rcvprt. " Partner type of receiver
    concatenate 'SAP' sy-sysid(3) into edidc-rcvpor. " Receiver port
    concatenate sy-sysid(3) 'CLNT' sy-mandt into edidc-rcvprn.
    edidc-direct = '2'. " Inbound
    concatenate 'SAP' sy-sysid(3) into edidc-sndpor.
    edidc-sndprt = c_sndprt. " Partner type of sender
    edidc-sndprn = c_sndprn. " Partner number of sender
    endform. " get_control_data
    *& Form get_ale_data
    Get logical system for ALE processing
    form get_ale_data.
    call function 'OWN_LOGICAL_SYSTEM_GET'
    importing
    own_logical_system = logsys
    exceptions
    own_logical_system_not_defined = 1
    others = 2.
    if sy-subrc <> 0.
    clear logsys.
    endif.
    endform. " get_ale_data
    *& Form build_e1lipv0_segment
    Create the general version segment
    form build_e1lipv0_segment.
    e1lipv0-vrsio = 'A00'.
    e1lipv0-avrsi = 'X'.
    e1lipv0-vetxt = 'Active Version'.
    move e1lipv0 to t_edidd-sdata.
    move 'E1LIPV0' to t_edidd-segnam.
    t_edidd-hlevel = '02'.
    append t_edidd.
    endform. " send_idoc
    *& Form build_e1lipm0_segment
    form build_e1lipm0_segment.
    e1lipm0-vontg = w_post_split-fromdat.
    e1lipm0-bistg = w_post_split-todat.
    e1lipm0-perio = '0'.
    if rb_1000 = 'X'.
    e1lipm0-m01 = c_werks_1000.
    else.
    e1lipm0-m01 = c_werks_1005.
    endif.
    e1lipm0-m02 = w_post_split-matnr.
    e1lipm0-m03 = 'SCP'.
    e1lipm0-m06 = 'T'.
    move e1lipm0 to t_edidd-sdata.
    move 'E1LIPM0' to t_edidd-segnam.
    t_edidd-hlevel = '01'.
    append t_edidd.
    endform. " build_e1lipm0_segment
    *& Form build_e1lipp0_segment
    form build_e1lipp0_segment.
    e1lipp0-sptag = w_post_split-split_date.
    if rb_mgx = 'X'.
    e1lipp0-kz02 = w_post_split-split_value.
    e1lipp0-kz03 = '/'.
    else.
    e1lipp0-kz02 = '/'.
    e1lipp0-kz03 = w_post_split-split_value.
    endif.
    move e1lipp0 to t_edidd-sdata.
    move 'E1LIPP0' to t_edidd-segnam.
    t_edidd-hlevel = '03'.
    append t_edidd.
    endform. " build_e1lipp0_segment
    *& Form check_idoc_status_records
    form check_idoc_status_records.
    clear: t_edids.
    refresh: t_edids.
    select * from edids into table t_edids where docnum = w_docnum.
    clear: w_error.
    loop at t_edids.
    clear: w_statva.
    select single statva from stacust into w_statva
    where status = t_edids-status.
    case w_statva.
    *When the status group is of type 'E' or 'F'.
    when 'E' or 'F'.
    t_exception-value = w_post_split-value.
    t_exception-index = w_post_split-index.
    t_exception-matnr = w_post_split-matnr.
    t_exception-datum = w_post_split-datum.
    t_exception-docnum = w_docnum_no_zero.
    t_exception-message = t_edids-statxt.
    append t_exception.
    w_error = 'X'.
    when others.
    endcase.
    endloop.
    if w_error is initial.
    add 1 to w_count_idoc_posted.
    else.
    add 1 to w_count_idoc_errors.
    endif.
    endform. " check_idoc_status_records
    12:34:35 PM&#9668;&----
    *& Form rename_file
    Form to rename file
    form rename_file.
    data: l_filename_new(120), " New filename
    l_filename_temp(120), " Temporary filename
    l_command(250), " Unix command line
    w_extension(14).
    move p_file to l_filename_new.
    *Replace the file extension of the file to indicate that it has been
    *processed
    concatenate '.proc_' sy-datum into w_extension.
    replace '.txt' with w_extension into l_filename_new.
    Create UNIX rename command
    concatenate 'mv' p_file l_filename_new
    into l_command separated by space.
    Create temporary unique file name
    concatenate p_file 'TEMP'
    into l_filename_temp.
    move l_filename_new to p_file.
    Open temporary dataset but use the filter command to execute the UNIX
    rename command 'mv'.
    This method has been used instead of SAP external commands because
    of file length limitations. The external command only allows a line of
    128 chars which means filenames can only be about 62chars when doing
    a move i.e. mv <file1> <file2>
    open dataset l_filename_temp for output filter l_command.
    if sy-subrc ne 0.
    message e005(z1) with text-007.
    exit.
    endif.
    Close the temporary dataset
    close dataset l_filename_temp.
    if sy-subrc ne 0.
    message e005(z1) with text-007.
    exit.
    endif.
    Delete the temporary dataset
    delete dataset l_filename_temp.
    if sy-subrc ne 0.
    message e005(z1) with text-007.
    exit.
    endif.
    endform. " rename_file
    *& Form material_internal_format
    form material_internal_format.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
    exporting
    input = i_file-matnr
    importing
    output = i_file-matnr.
    endform. " material_internal_format
    *& Form error_report
    form error_report.
    format color col_normal.
    skip.
    *Loop at exception table and output contents
    loop at t_exception.
    write: / t_exception-index,
    t_exception-matnr,
    24 t_exception-datum,
    t_exception-value right-justified,
    t_exception-docnum,
    t_exception-message.
    endloop.

    hi,
    define internal table. e.g. it_data & follow the steps
    PARAMETERS: p_rfname LIKE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_rfname.
      PERFORM get_desktop_file_help.
         Form  get_desktop_file_help
    FORM get_desktop_file_help.
      DATA : v_file LIKE rlgrap-filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = syst-repid
          dynpro_number = syst-dynnr
          field_name    = 'P_RFNAME'
        CHANGING
          file_name     = v_file
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE i368(00) WITH 'Enter Correct File'.
        STOP.
      ELSE.
        MOVE : v_file TO p_rfname.
      ENDIF.
    ENDFORM.                    " get_desktop_file_help
    START-OF-SELECTION.
      PERFORM upload_file_from_desktop CHANGING g_error.
         Form  upload_file_from_desktop
    FORM upload_file_from_desktop CHANGING p_error.
      IF NOT sy-batch IS INITIAL.
        MESSAGE e368(00) WITH 'Files can only be uploaded'
                              'in foreground'.
      ELSE.
        CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
            filename                = p_rfname
            filetype                = 'DAT'
          TABLES
            data_tab                = it_data
          EXCEPTIONS
            conversion_error        = 1
            invalid_table_width     = 2
            invalid_type            = 3
            no_batch                = 4
            unknown_error           = 5
            gui_refuse_filetransfer = 6
            OTHERS                  = 7.
        IF sy-subrc NE 0.
          MESSAGE i368(00) WITH 'Error while reading data from file'.
          MOVE : 'X' TO p_error.
        ENDIF.
      ENDIF.
    ENDFORM.                    "upload_file_from_desktop
    raj

  • 2012 SQL Server Management Studio Intellisense Not Working

    Hi,
    I have read just about every article and checked many options with SSMS and the Server.  The server is MS SQL SERVER 2012 SP1 Version 11.0.3339.0 X64.   SMSS is 11.0.2100.60.
    I have refreshed the intellisense cache, made sure I wasn't in the SQLCommand Mode and that I had intellisense enabled under the Tools Options and Text_editor.
    Intellsense worked great for me when I was running 2008 R2....now nothing, feeling frustrated.   Any new ideas on how to get intellisense back in line would certainly be appreciated.

    We were having problems also with intellisense, as it completely stopped working on a SQL Server 2012 instance that was hosting over 100 client databases in a non-transactional development only environment.  We tried everything and nothing seemed to
    work until I ran an optimize routine that included running DBCC DBReindex, sp_updateStats, and sp_Recompile.  This seemed to clean up what ever was blocking intellisense.  Now it is working with no problem.  I added a SQL Agent job that runs
    once a week to perform this optimization.  We have not had a problem with intellisense since.
    begin
        select identity(int,1,1) as [ID], sd.name as [DBName] into #Databases from master.sys.databases sd where sd.name not in ('master', 'tempdb', 'model', 'msdb')
        declare @DB varchar(128)
                , @SQL varchar(max)
                , @MinID int
                , @MaxID int
        select @MinID = min(id), @MaxID = max(id) from #Databases
        while @MinID <= @MaxID
        begin
            select @DB = DBName from #Databases where ID = @MinID
            print '*** Processing: ' + @DB + ' *****************************************************************************************************'
            set @SQL = @DB + '.sys.sp_MSforeachtable @command1="print ''?'' dbcc dbreindex (''?'', '' '', 80)"'
            exec (@SQL)
            set @SQL = @DB + '.sys.sp_updatestats'
            exec (@SQL)
            set @SQL = @DB + '.sys.sp_MSforeachtable @command1="exec sp_recompile ''?''";'
            exec (@SQL)
            set @MinID = @MinID + 1 --increment
        end
        drop table #Databases
    end

  • No Hard Drive Or Volume Icon In Powerbook G4 Firewire (aluminium) Disk Utilities: Reads Error: No Valid Packages (-9997)

    Whilst performing a zero/erase install on my Powerbook G4 Firewire (aluminium) with an OSX Tiger install disk (Tiger was the OSX i had erased), I had to force quite the installer as it appeared to be stuck on the Chinese script install section. I crashed the Powerbook down using the power button method. Now, when i power up the computer, it stays on the grey screen and just beeps at me. If i insert the install disks (both OSX Tiger or the original Powerbook Panther ones) there is no volume found  during the install process. In disk utilities no hard drive icon or volumes appear in the left hand list, just 2 headings regarding the OSX install disk. I have clicked 'Verify Disk Permissions' on these headings and receive this message in the action box: Error: No Valid Packages (-9997). All other options in disk utilities are not available to use (partitions section etc), as there is no hard drive recognized to perform anything on. I presume my erase install has wiped out my previous OSX Tiger without installing some essential on the Powerbook (receipts perhaps?). My Powerbook was working 100% before this install attempt. It's a very lightly used machine with no noises/whirrs coming from the hard drive that would suggest failure of some kind. Any advice would be much appreciated.

    Many thanks for your advice old comm guy.
    I have run the Hardware Test as supplied with the Powerbooks install disks and everything has passed. I presume i can put my mind at rest about it being a problem in any of those departments. I have been browsing for a couple of weeks now and think my problem could be a loss in receipts/permissions somewhere. I remember looking for a lost file awhile back using a hard drive search programme through Terminal. It filled my hard drive almost to the maximum with unwanted retrieved files, it took me hours to erase all this again (never found the document i was looking for either). Perhaps a receipt was erased/trashed at this time?. Sometime later (prob weeks) i performed a fresh OSX install to give me an uncluttered faster running machine (I do this once a year). I zero erased the hard drive (including free space) and it was during this install that i had to force quit. It seemed to be stuck loading the Chinese Script so i had no option. After this the problem as described above has been persistent. Is there a way to restore receipts/permissions through Terminal or something like that?. Or maybe a procedure that one has to do when installing a new hard drive?. A step by step guide from someone would be a real help as i am not really confident using these advanced procedures.

  • Home Sharing Broken.

    I'm running a home share on a Mac Mini running 10.7.1 and iTunes 11. I use an airport express to bridge my Linksys router. My iTunes library is fairly large, but I would hope that wouldn't be an issue.
    I don't have any trouble seeing the home share, but it rarely works properly.
    None of my iOS devices can reliably connect to and access the home share. A number of things happen:
    1) the iOS devices hangs up trying to connect to the home share.
    2) the iOS devices hangs up trying to read a playlist
    3) the iOS device shows me a playlist, but then doesn't play any audio — the player just skips over songs like they don't exist.
    4) When it does work, audio is about is skip prone as a bad CD.
    The funny thing is, when I first installed the Airport Express it worked without a hitch and I was elated. In the weeks since, performance has degraded to this point and I'm not sure what recourse to take.
    I've restarted the router, restarted home sharing on all the devices, restarted iTunes on the Mac Mini.
    To my knowledge, there are no alternatives out there, either. If there are, I'd be willing to hear about them. Though it seems silly to go pay for something that Apple is providing for free, this frustration has gone beyond "free" into severe opportunity costs for me. It is just as silly to me to continue to try to use something that is obviously so flawed. I wonder how Apple continues to sell Apple TVs and such with so many people having this issue — it's false advertising!

    FYI: https://discussions.apple.com/message/25915348#25915348
    Thank you Ian. You've inadvertently answered another question, which is how do I send music and videos to Airport Expresses and Apple TVs. That's the Remote app? Rather than the music and video apps.
    My library is actually 67GB with 6300 songs. Not massive I don't think. And it's only going to grow.
    It looks like I am going the same way as you: Mac mini server, with Airport Expresses for music and Apple TVs for videos, so actually the music app would just be a stop-gap while the rest of the hardware came and the Remote app solved all my problems. That said, now that I know Home Sharing is so flakey I'm reluctant to make the investment.
    (However, the only way to get mobile music around the house with a bluetooth speaker is with the music app.)
    I'm playing round with Plex at the moment. Will play around with Plex and docking stations/bluetooth speakers for music, and Plex and Chromecasts for video. Then maybe a cheap Windows PC for a media server.
    Thanks for your reply Ian.
    Chris

  • Could anyone please tell me how to tuning my program?

    I have already executed the program with SE30.
    I think that the program has some problem SQL in form
    "GET_BACK_ORDER       (Fetch VBAP, Net % = <b>26.2</b>)" and
    "GET_PENDING_ORDER (Fetch AUFK,  Net % = <b>25.7</b>)"
    but I can not find the data that I want from others table and I don't know how to tuning both form.
    Source code for Review of Sales Forecast
    REPORT  ZLPPRP26
            LINE-SIZE 573
            NO STANDARD PAGE HEADING.
      T A B L E S                                                        *
    TABLES: pbed,      "Independent Requirements Data
            pbim.      "Independent Requirements for Material
    TABLES: afko,      "Order header data PP orders
            aufk,      "Order master data
            t399x,     "Plant/order type
            tj02t,     "Text Status for check status of Process Order
            s003,      "Sale Order
            vbep,      "Sales Document: Schedule Line Data (QTY)
            vbap,      "Sales Document: Item Data (Material)
            vbup,      "Sales Document: Item Status
            mchb,      "Stock
            mcha,      "Stock description
            mara.      "General Material Data
    *................................ Include ISO declarations
    INCLUDE zstprpi1.
      T Y P E S                                                          *
    TYPES: boolean(1).
    TYPE-POOLS : slis.
      W O R K I N G   S T O R A G E   D A T A                            *
    DATA: BEGIN OF wa_pbim,
            matnr  LIKE  pbim-matnr,     " MATERIAL NO.
            werks  LIKE  pbim-werks,     " PLANT.
            bedae  LIKE  pbim-bedae,     " REQUIREMENT TYPE.
            versb  LIKE  pbim-versb,     " VERSION.
            pbdnr  LIKE  pbim-pbdnr,     " REQUIREMENT PLAN NO.
            bdzei  LIKE  pbim-bdzei,     " INQ REQUIREMENT POINTER.
            vervs  LIKE  pbim-vervs,     " STATUS ACTIVE-INACTIVE.
          END OF wa_pbim.
    DATA: BEGIN OF wa_pbed,
            pdatu  LIKE  pbed-pdatu,     " FINISH DATE
            bdzei  LIKE  pbed-bdzei,     " INQ REQUIREMENT POINTER.
            aenam  LIKE  pbed-aenam,     " NAME OF PERSON CHANGE.
            laeda  LIKE  pbed-laeda,     " DATE CHANGE.
            meins  LIKE  pbed-meins,     " UM.
            plnmg  LIKE  pbed-plnmg,     " PLAN QTY.
            entlu  LIKE  pbed-entlu,     " PERIOD INDICATOR
            perxx  LIKE  pbed-perxx,     " PLANNING PERIOD
          END OF wa_pbed.
    DATA: BEGIN OF wa_marc,     
            matnr  LIKE  marc-matnr,      " MAT CODE
            werks  LIKE  marc-werks,      " PLANT
            maabc  LIKE  marc-maabc,     " Class
            dismm  LIKE  marc-dismm,     " MRP Type
            dispo  LIKE  marc-dispo,     " MRP Controller
            eisbe  LIKE  marc-eisbe,     " Safety Stock
            bstfe  LIKE  marc-bstfe,     " Fix
            bstmi  LIKE  marc-bstmi,     " Min
            bstma  LIKE  marc-bstma,     " Max
          END OF wa_marc.
    DATA : BEGIN OF wa_mchb,
            matnr  LIKE  mchb-matnr,     " Mat Code
            werks  LIKE  mchb-werks,     " Plant
            clabs  LIKE  mchb-clabs,      " UR
            cinsm  LIKE  mchb-cinsm,      " QI
            cspem  LIKE  mchb-cspem,      " BL
            lgort  LIKE  mchb-lgort,     " Storage Location
            charg  LIKE  mchb-charg,     " Batch
          END OF wa_mchb.
    DATA : BEGIN OF wa_all_material,     " **MAIN OF PROGRAM**
            matnr  LIKE  mara-matnr,     " Mat Code
            werks  LIKE  marc-werks,      " Plant
            maabc  LIKE  marc-maabc,     " Class
            dismm  LIKE  marc-dismm,     " MRP Type
            dispo  LIKE  marc-dispo,     " MRP Controller
            meins  LIKE  mara-meins,     " UoM
            mseht  LIKE  t006a-mseht,    " UoM Text
            maktx  LIKE  makt-maktx,     " Mat Description
          END OF wa_all_material.
    DATA: BEGIN OF wa_ind_req,
            matnr  LIKE  pbim-matnr,     " MATERIAL NO.
            werks  LIKE  pbim-werks,     " PLANT.
            bedae  LIKE  pbim-bedae,     " REQUIREMENT TYPE.
            versb  LIKE  pbim-versb,     " VERSION.
            pbdnr  LIKE  pbim-pbdnr,     " REQUIREMENT PLAN NO.
            bdzei  LIKE  pbim-bdzei,     " INQ REQUIREMENT POINTER.
            vervs  LIKE  pbim-vervs,     " STATUS ACTIVE-INACTIVE.
            pdatu  LIKE  pbed-pdatu,     " FINISH DATE &#3585;&#3619;&#3603;&#3637; DAY Period
            aenam  LIKE  pbed-aenam,     " NAME OF PERSON CHANGE.
            laeda  LIKE  pbed-laeda,     " DATE CHANGE.
            plnmg  LIKE  pbed-plnmg,     " PLAN QTY.
            entli  LIKE  pbed-entli,     " Date type (1day, 2week, 3month)
            perxx  LIKE  pbed-perxx,     " PLANNING PERIOD
          END OF wa_ind_req.
    DATA: BEGIN OF wa_ind_req1,
            matnr  LIKE  pbim-matnr,     " MATERIAL NO.
           meins  LIKE  pbed-meins,     " UM. [Tiwa 31072006]
            plnmg  LIKE  pbed-plnmg,     " PLAN QTY.
            entli  LIKE  pbed-entli,     " Date type (1day, 2week, 3month)
            perxx  LIKE  pbed-perxx,     " PLANNING PERIOD
            pdatu  LIKE  pbed-pdatu,     " FINISH DATE &#3585;&#3619;&#3603;&#3637; DAY Period
          END OF wa_ind_req1.
    DATA: BEGIN OF wa_ind_rep,
            matnr  LIKE  pbim-matnr,     " MATERIAL NO.
            cw4    LIKE  pbed-plnmg,     " PLAN QTY of week from user
            nw1    LIKE  pbed-plnmg,     " PLAN QTY next month week1
            nw2    LIKE  pbed-plnmg,     " PLAN QTY next month week2
            nw3    LIKE  pbed-plnmg,     " PLAN QTY next month week3
            nw4    LIKE  pbed-plnmg,     " PLAN QTY next month week4
            nw5    LIKE  pbed-plnmg,     " PLAN QTY next month week5
            mxx    LIKE  pbed-plnmg,     " PLAN QTY next month(Period Month)
            ntotal LIKE  pbed-plnmg,     "
          END OF wa_ind_rep.
    DATA: BEGIN OF wa_sales_hist,
            spbup    LIKE  s003-spbup,      " Period to analyze
            vkorg    LIKE  s003-vkorg,      " Sales Organization(Plant)
            matnr    LIKE  s003-matnr,      " Mat Code
            aemenge  LIKE  s003-aemenge, " incoming orders Qty
            ummenge  LIKE  s003-ummenge, " Billing Qty
            ssour    LIKE  s003-ssour,   " for key
            vrsio    LIKE  s003-vrsio,   " for key
            spmon    LIKE  s003-spmon,   " for key
            sptag    LIKE  s003-sptag,   " for key
            spwoc    LIKE  s003-spwoc,   " for key
            vtweg    LIKE  s003-vtweg,   " for key
            spart    LIKE  s003-spart,   " for key
            bzirk    LIKE  s003-bzirk,   " for key
            kunnr    LIKE  s003-kunnr,   " for key
          END OF wa_sales_hist.
    DATA: BEGIN OF wa_sales_report,
            matnr    LIKE  s003-matnr,      " Mat Code
            m_3      LIKE  s003-aemenge, " incoming orders Qty m-3
            m_2      LIKE  s003-aemenge, " incoming orders Qty m-2
            m_1      LIKE  s003-aemenge, " incoming orders Qty m-1
            m_0      LIKE  s003-aemenge, " incoming orders Qty m-0
            estim    TYPE  P DECIMALS 3,
            avg_sale TYPE  P DECIMALS 3,
          END OF wa_sales_report.
    DATA: BEGIN OF wa_back_order,
            matnr    LIKE  vbap-matnr,     " Mat Code
            wmeng    LIKE  vbep-wmeng,     " Order quantity
            bmeng    LIKE  vbep-bmeng,     " Confirmed quantity
           vrkme    LIKE  vbep-vrkme,     " Sales unit [Tiwa 31072006]
          END OF wa_back_order.
    DATA: BEGIN OF wa_backord_rep,
            matnr    LIKE  vbap-matnr,     " Mat Code
            back     LIKE  vbep-wmeng,     " Order quantity
          END OF wa_backord_rep.
    DATA: BEGIN OF wa_pending_order,
            objnr    LIKE  jest-objnr,  " Object
            matnr    LIKE  afpo-matnr,  " Material
            psmng    LIKE  afpo-psmng,  " Order Item QTY
            wemng    LIKE  afpo-wemng,  " GR QTY
            amein    LIKE  afpo-amein,  " UoM for Inhouse Prod
          END OF wa_pending_order.
    DATA: BEGIN OF wa_pending_rep,
            matnr    LIKE  afpo-matnr,  " Material
            psmng    LIKE  afpo-psmng,  " Order Item QTY
          END OF wa_pending_rep.
    DATA: BEGIN OF wa_batch_safety,
            matnr    LIKE  marc-matnr,  " Mat Code
            eisbe    LIKE  marc-eisbe,     " Safety Stock
            bstfe    LIKE  marc-bstfe,     " Fix
            bstmi    LIKE  marc-bstmi,     " Min
            bstma    LIKE  marc-bstma,     " Max
          END OF wa_batch_safety.
    DATA: BEGIN OF wa_vbep,
            vbeln    LIKE  vbep-vbeln,  "Sales Document
            posnr    LIKE  vbep-posnr,  "Sales Document Item
            wmeng    LIKE  vbep-wmeng,  "Order quantity in sales units
            bmeng    LIKE  vbep-bmeng,  "Confirmed quantity
          END OF wa_vbep.
    DATA: BEGIN OF wa_vbap,
            vbeln    LIKE  vbap-vbeln,    "Sales Document
            posnr    LIKE  vbap-posnr,    "Sales Document Item
            matnr    LIKE  vbap-matnr,    "Material Code
            kwmeng   LIKE  vbap-kwmeng,   "Order Qty.
            kbmeng   LIKE  vbap-kbmeng,   "Comfirmed Qty.
            klmeng   LIKE  vbap-klmeng,   "Back Order.
          END OF wa_vbap.
    DATA: BEGIN OF wa_vbup,
            vbeln    LIKE  vbup-vbeln,  "Sales Document
            posnr    LIKE  vbup-posnr,  "Sales Document Item
          END OF wa_vbup.
    DATA: BEGIN OF wa_vbfa,
            VBELV    LIKE  vbfa-VBELV,   "Preceding SO
            POSNV    LIKE  vbfa-POSNV,   "Preceding item of an SD document
            VBTYP_N  LIKE  vbfa-VBTYP_N, "Document category J = D/O
            RFMNG    LIKE  vbfa-RFMNG,   "QTY in D/O
            MATNR    LIKE  vbfa-MATNR,   "Material
            VBELN    LIKE  vbfa-VBELN,   "Subsequent SD Doc.
            POSNN    LIKE  vbfa-POSNN,   "Subsequent item of an SD document
          END OF wa_vbfa.
    DATA:  matclss  LIKE  marc-maabc,      " SLECTION OPTION
           mrpcont  LIKE  marc-dispo,      " SLECTION OPTION
           p_week   LIKE  scal-week,       " Apply from parameter P_WEEK
           p_week4  LIKE  scal-week VALUE 999999, "add in 270706
           tmpweek  LIKE  scal-week,       " return of FORM date_2_week
           tmpdate  LIKE  scal-date,       " return of FORM week_get_1st_day
           tmp_next_week  LIKE  scal-week, " return of FORM next_week.
           yyyymm_nextmonth(6) TYPE C,
           firstdate_of_week_of_monthend LIKE  scal-date, "1st&#3586;&#3629;&#3591;week&#3626;&#3640;&#3604;&#3607;&#3657;&#3634;&#3618;
           all_mat_found  TYPE I VALUE 1.  " Use in FORM read_all_material
    DATA : next_month      LIKE  scal-date,
           next_next_month LIKE  scal-date,
           next_month_w1   LIKE  scal-week,
           next_month_w2   LIKE  scal-week,
           next_month_w3   LIKE  scal-week,
           next_month_w4   LIKE  scal-week,
           next_month_w5   LIKE  scal-week,
           next_next_month_w1  LIKE  scal-week,
           next_next_month_w2  LIKE  scal-week,
           next_next_month_w3  LIKE  scal-week,
           next_next_month_w4  LIKE  scal-week,
           next_next_month_w5  LIKE  scal-week.
    DATA : prev_month  LIKE  scal-date,  "GLOBAL
           prev_month0(6)  TYPE  C,      "Current Month
           prev_month1(6)  TYPE  C,
           prev_month2(6)  TYPE  C,
           prev_month3(6)  TYPE  C.
    DATA : date1_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "MON
           date2_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "TUE
           date3_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "WED
           date4_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "THU
           date5_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "FRI
           date6_in_currweek4_1  LIKE scal-date  VALUE 99999999,  "SAT
           date7_in_currweek4_1  LIKE scal-date  VALUE 99999999.  "SUN
    DATA : date1_in_currweek4  LIKE scal-date,  "MON
           date2_in_currweek4  LIKE scal-date,  "TUE
           date3_in_currweek4  LIKE scal-date,  "WED
           date4_in_currweek4  LIKE scal-date,  "THU
           date5_in_currweek4  LIKE scal-date,  "FRI
           date6_in_currweek4  LIKE scal-date,  "SAT
           date7_in_currweek4  LIKE scal-date.  "SUN
    DATA : date1_in_nextmonth_week1  LIKE scal-date,  "MON
           date2_in_nextmonth_week1  LIKE scal-date,  "TUE
           date3_in_nextmonth_week1  LIKE scal-date,  "WED
           date4_in_nextmonth_week1  LIKE scal-date,  "THU
           date5_in_nextmonth_week1  LIKE scal-date,  "FRI
           date6_in_nextmonth_week1  LIKE scal-date,  "SAT
           date7_in_nextmonth_week1  LIKE scal-date.  "SUN
    DATA : date1_in_nextmonth_week2  LIKE scal-date,  "MON
           date2_in_nextmonth_week2  LIKE scal-date,  "TUE
           date3_in_nextmonth_week2  LIKE scal-date,  "WED
           date4_in_nextmonth_week2  LIKE scal-date,  "THU
           date5_in_nextmonth_week2  LIKE scal-date,  "FRI
           date6_in_nextmonth_week2  LIKE scal-date,  "SAT
           date7_in_nextmonth_week2  LIKE scal-date.  "SUN
    DATA : date1_in_nextmonth_week3  LIKE scal-date,  "MON
           date2_in_nextmonth_week3  LIKE scal-date,  "TUE
           date3_in_nextmonth_week3  LIKE scal-date,  "WED
           date4_in_nextmonth_week3  LIKE scal-date,  "THU
           date5_in_nextmonth_week3  LIKE scal-date,  "FRI
           date6_in_nextmonth_week3  LIKE scal-date,  "SAT
           date7_in_nextmonth_week3  LIKE scal-date.  "SUN
    DATA : date1_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "MON
           date2_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "TUE
           date3_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "WED
           date4_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "THU
           date5_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "FRI
           date6_in_nextmonth_week4  LIKE scal-date VALUE 99999999,  "SAT
           date7_in_nextmonth_week4  LIKE scal-date VALUE 99999999.  "SUN
    DATA : date1_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "MON
           date2_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "TUE
           date3_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "WED
           date4_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "THU
           date5_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "FRI
           date6_in_nextmonth_week5  LIKE scal-date VALUE 99999999,  "SAT
           date7_in_nextmonth_week5  LIKE scal-date VALUE 99999999.  "SUN
    DATA : t_fieldcat   TYPE  slis_t_fieldcat_alv.
      I N T E R N A L   T A B L E S                                      *
    DATA: it_pbim           LIKE wa_pbim          OCCURS 0 WITH HEADER LINE,
          it_pbed           LIKE wa_pbed          OCCURS 0 WITH HEADER LINE,
          it_stock          LIKE wa_mchb          OCCURS 0 WITH HEADER LINE,
          it_stock_rep      LIKE wa_mchb          OCCURS 0 WITH HEADER LINE,
          it_ind_req        LIKE wa_ind_req       OCCURS 0 WITH HEADER LINE,
          it_ind_req1       LIKE wa_ind_req1      OCCURS 0 WITH HEADER LINE,
          it_ind_rep        LIKE wa_ind_rep       OCCURS 0 WITH HEADER LINE,
          it_tmp_sales_hist LIKE wa_sales_hist    OCCURS 0 WITH HEADER LINE,
          it_sales_hist     LIKE wa_sales_hist    OCCURS 0 WITH HEADER LINE,
          it_back_order     LIKE wa_back_order    OCCURS 0 WITH HEADER LINE,
          it_pending_order  LIKE wa_pending_order OCCURS 0 WITH HEADER LINE,
          it_sales_report   LIKE wa_sales_report  OCCURS 0 WITH HEADER LINE,
          it_backord_rep    LIKE wa_backord_rep   OCCURS 0 WITH HEADER LINE,
          it_batch_safety   LIKE wa_batch_safety  OCCURS 0 WITH HEADER LINE,
          it_pending_rep    LIKE wa_pending_rep   OCCURS 0 WITH HEADER LINE,
          it_all_material   LIKE wa_all_material  OCCURS 0 WITH HEADER LINE,
          t_vbap            LIKE wa_vbap          OCCURS 0 WITH HEADER LINE,
          t_vbep            LIKE wa_vbep          OCCURS 0 WITH HEADER LINE,
          t_vbfa            LIKE wa_vbfa          OCCURS 0 WITH HEADER LINE,
          t_vbup            LIKE wa_vbup          OCCURS 0 WITH HEADER LINE.
      R A N G E S                                                        *
    RANGES: r_month    FOR  pbed-pdatu,
            r_matnr    FOR  pbim-matnr.
      S E L E C T - O P T I O N S   A N D   P A R A M E T E R S          *
    SELECTION-SCREEN: BEGIN OF BLOCK bk1 WITH FRAME TITLE text-007.
      PARAMETERS:     p_werks  LIKE pbim-werks OBLIGATORY. "DEFAULT '1100'.
      SELECT-OPTIONS: s_matnr  FOR  mara-matnr.
      SELECT-OPTIONS: s_matc   FOR  matclss.
      SELECT-OPTIONS: s_mrpc   FOR  mrpcont OBLIGATORY.
      PARAMETERS :    p_month  LIKE s003-spbup OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK bk1.
      M A C R O   C O M M A N D   D E F I N I T I O N                    *
    DEFINE m%print_right.
      write at sy-linsz ''.
    END-OF-DEFINITION.
      MAIN PROGRAM                                                       *
    START-OF-SELECTION.
      PERFORM date_2_week USING sy-datum.  "return to tmpweek
      PERFORM get_last_week_of_month.
      PERFORM process_get_month_for_sales.
      PERFORM get_week_next_month.
      PERFORM get_week_next_next_month.
      PERFORM get_date_in_currweek4.
      PERFORM get_date_in_week_in_nextmonth.
      PERFORM read_all_material.
      IF all_mat_found EQ 1.        "Found some of material
        PERFORM read_stock.
        PERFORM read_pbim_pbed_data.
        PERFORM get_sales_history.
        PERFORM get_back_order.
        PERFORM get_pending_order.
        PERFORM print_report.
      ENDIF.
    *&      Form  read_pbim_pbed_data
    FORM read_pbim_pbed_data.
      yyyymm_nextmonth = next_month+0(6).
      SELECT pbimmatnr pbimwerks pbim~bedae
             pbimversb pbimpbdnr pbimbdzei pbimvervs
             pbedpdatu pbedaenam pbed~laeda
             pbedplnmg pbedentli pbed~perxx
      INTO TABLE it_ind_req
      FROM pbim
      INNER JOIN pbed
            ON pbimbdzei = pbedbdzei
      FOR ALL ENTRIES IN it_all_material
      WHERE pbim~vervs = 'X'  AND      "Active Version
            pbim~werks = p_werks AND
            pbim~matnr EQ it_all_material-matnr AND
            ( ( pbedperxx = next_month_w1 AND pbedentli = 2 ) OR
              ( pbedperxx = next_month_w2 AND pbedentli = 2 ) OR
              ( pbedperxx = next_month_w3 AND pbedentli = 2 ) OR
              ( pbedperxx = next_month_w4 AND pbedentli = 2 ) OR
              ( pbedperxx = next_month_w5 AND pbedentli = 2 ) OR
              ( pbedperxx = p_week        AND pbedentli = 2 ) OR
              ( pbedperxx = p_week4       AND pbedentli = 2 ) OR "27072006
              ( pbed~pdatu between date1_in_currweek4 AND
                                   date7_in_currweek4 ) OR
              ( pbed~pdatu between date1_in_currweek4_1 AND   "add 27072006
                                   date7_in_currweek4_1 ) OR  "add 27072006
              ( pbed~pdatu between date1_in_nextmonth_week1 AND
                                   date7_in_nextmonth_week1 ) OR
              ( pbed~pdatu between date1_in_nextmonth_week2 AND
                                   date7_in_nextmonth_week2 ) OR
              ( pbed~pdatu between date1_in_nextmonth_week3 AND
                                   date7_in_nextmonth_week3 ) OR
              ( pbed~pdatu between date1_in_nextmonth_week4 AND
                                   date7_in_nextmonth_week4 ) OR
              ( pbed~pdatu between date1_in_nextmonth_week5 AND
                                   date7_in_nextmonth_week5 ) OR
              ( pbedperxx = yyyymm_nextmonth AND pbedentli = 3 ) ).
      LOOP AT it_ind_req.
        wa_ind_req1-matnr = it_ind_req-matnr.
        wa_ind_req1-plnmg = it_ind_req-plnmg.
        wa_ind_req1-entli = it_ind_req-entli.
        wa_ind_req1-perxx = it_ind_req-perxx.
        wa_ind_req1-pdatu = it_ind_req-pdatu.
        COLLECT wa_ind_req1 INTO it_ind_req1.
      ENDLOOP.
      PERFORM get_ind_rep.
      PERFORM get_batch_safe.
    ENDFORM.
    *&      Form  get_batch_safe
    FORM get_batch_safe.
      DATA: wl_marc LIKE marc,
            safety  LIKE marc-eisbe VALUE 0,
            fix     LIKE marc-eisbe VALUE 0,
            min     LIKE marc-eisbe VALUE 0,
            max     LIKE marc-eisbe VALUE 0.
      LOOP AT it_all_material.
        CLEAR : wl_marc, safety, fix, min, max.
        SELECT SINGLE * FROM marc INTO wl_marc
        WHERE  matnr = it_all_material-matnr AND
               werks = p_werks.
        IF sy-subrc EQ 0.
          safety = wl_marc-eisbe.  " Safety Stock
          fix    = wl_marc-bstfe.  " Fix
          min    = wl_marc-bstmi.  " Min
          max    = wl_marc-bstma.  " Max
        ENDIF.
        it_batch_safety-matnr = it_all_material-matnr.
        it_batch_safety-eisbe = safety.  " Safety Stock
        it_batch_safety-bstfe = fix.     " Fix
        it_batch_safety-bstmi = min.     " Min
        it_batch_safety-bstma = max.     " Max
        APPEND it_batch_safety.
      ENDLOOP.
    ENDFORM.
    *&      Form  get_ind_rep
    FORM get_ind_rep.
      DATA: cw4     TYPE  P VALUE 0 DECIMALS 3,
            nw1     TYPE  P VALUE 0 DECIMALS 3,
            nw2     TYPE  P VALUE 0 DECIMALS 3,
            nw3     TYPE  P VALUE 0 DECIMALS 3,
            nw4     TYPE  P VALUE 0 DECIMALS 3,
            nw5     TYPE  P VALUE 0 DECIMALS 3,
            mxx     TYPE  P VALUE 0 DECIMALS 3, "Add in 12/07/2006 by Tiwa
            ntotal  TYPE  P VALUE 0 DECIMALS 3.
      LOOP AT it_all_material.
        CLEAR: ntotal, cw4, nw1, nw2, nw3, nw4, nw5, mxx, wa_ind_rep.
        LOOP AT it_ind_req1 WHERE matnr = it_all_material-matnr.
          IF ( ( ( it_ind_req1-perxx EQ p_week  ) AND
                 ( it_ind_req1-entli EQ 2 ) ) OR
               ( ( it_ind_req1-pdatu EQ date1_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date2_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date3_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date4_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date5_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date6_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date7_in_currweek4 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-perxx EQ p_week4 ) AND
                 ( it_ind_req1-entli EQ 2 ) ) OR
               ( ( it_ind_req1-pdatu EQ date1_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date2_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date3_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date4_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date5_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date6_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) OR
               ( ( it_ind_req1-pdatu EQ date7_in_currweek4_1 ) AND
                 ( it_ind_req1-entli EQ 1 ) ) ).
            cw4 = cw4 + it_ind_req1-plnmg.
          ELSEIF ( ( ( it_ind_req1-perxx EQ next_month_w1 ) AND
                     ( it_ind_req1-entli EQ 2 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date1_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date2_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date3_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date4_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date5_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date6_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date7_in_nextmonth_week1 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) ).
            nw1 = nw1 + it_ind_req1-plnmg.
          ELSEIF ( ( ( it_ind_req1-perxx EQ next_month_w2 ) AND
                     ( it_ind_req1-entli EQ 2 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date1_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date2_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date3_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date4_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date5_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date6_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date7_in_nextmonth_week2 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) ).
            nw2 = nw2 + it_ind_req1-plnmg.
          ELSEIF ( ( ( it_ind_req1-perxx EQ next_month_w3 ) AND
                     ( it_ind_req1-entli EQ 2 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date1_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date2_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date3_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date4_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date5_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date6_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date7_in_nextmonth_week3 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) ).
            nw3 = nw3 + it_ind_req1-plnmg.
          ELSEIF ( ( ( it_ind_req1-perxx EQ next_month_w4 ) AND
                     ( it_ind_req1-entli EQ 2 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date1_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date2_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date3_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date4_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date5_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date6_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date7_in_nextmonth_week4 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) ).
            nw4 = nw4 + it_ind_req1-plnmg.
          ELSEIF ( ( ( it_ind_req1-perxx EQ next_month_w5 ) AND
                     ( it_ind_req1-entli EQ 2 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date1_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date2_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date3_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date4_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date5_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date6_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) OR
                   ( ( it_ind_req1-pdatu EQ date7_in_nextmonth_week5 ) AND
                     ( it_ind_req1-entli EQ 1 ) ) ).
            nw5 = nw5 + it_ind_req1-plnmg.
          ELSEIF ( ( it_ind_req1-perxx EQ yyyymm_nextmonth ) AND
                   ( it_ind_req1-entli EQ 3 ) ).
            mxx    = mxx + it_ind_req1-plnmg.
            ntotal = ntotal + it_ind_req1-plnmg.
          ENDIF.
        ENDLOOP.
        ntotal = ntotal + ( nw1 + nw2 + nw3 + nw4 + nw5 ).
        wa_ind_rep-matnr   = it_all_material-matnr.
        wa_ind_rep-cw4     = cw4.
        wa_ind_rep-nw1     = nw1.
        wa_ind_rep-nw2     = nw2.
        wa_ind_rep-nw3     = nw3.
        wa_ind_rep-nw4     = nw4.
        wa_ind_rep-nw5     = nw5.
        wa_ind_rep-mxx     = mxx.
        wa_ind_rep-ntotal  = ntotal.
        IF wa_ind_rep-ntotal > 0.
          APPEND wa_ind_rep TO it_ind_rep.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    *&      Form  date_2_week
    FORM date_2_week USING inp_date.
      CLEAR tmpweek.
      CALL FUNCTION 'DATE_GET_WEEK'
        EXPORTING
          date = inp_date
        IMPORTING
          week = tmpweek
        EXCEPTIONS
          date_invalid = 1
          others = 2.
    ENDFORM.
    *&      Form  get_date_in_currweek4
    FORM get_date_in_currweek4.
      PERFORM week_get_1st_day USING p_week.  "return to tmpdate
      date1_in_currweek4 = tmpdate.                "MON
      date2_in_currweek4 = date1_in_currweek4 + 1. "TUE
      date3_in_currweek4 = date2_in_currweek4 + 1. "WED
      date4_in_currweek4 = date3_in_currweek4 + 1. "THU
      date5_in_currweek4 = date4_in_currweek4 + 1. "FRI
      date6_in_currweek4 = date5_in_currweek4 + 1. "SAT
      date7_in_currweek4 = date6_in_currweek4 + 1. "SUN
      IF p_week4 NE 999999.
        PERFORM week_get_1st_day USING p_week4.  "return to tmpdate
        date1_in_currweek4_1 = tmpdate.                  "MON
        date2_in_currweek4_1 = date1_in_currweek4_1 + 1. "TUE
        date3_in_currweek4_1 = date2_in_currweek4_1 + 1. "WED
        date4_in_currweek4_1 = date3_in_currweek4_1 + 1. "THU
        date5_in_currweek4_1 = date4_in_currweek4_1 + 1. "FRI
        date6_in_currweek4_1 = date5_in_currweek4_1 + 1. "SAT
        date7_in_currweek4_1 = date6_in_currweek4_1 + 1. "SUN
      ENDIF.
    ENDFORM.
    *&      Form  get_date_in_week_in_nextmonth
    FORM get_date_in_week_in_nextmonth.
    *Date in week1 of next month
      PERFORM week_get_1st_day USING next_month_w1.  "return to tmpdate
      date1_in_nextmonth_week1 = tmpdate.                      "MON
      date2_in_nextmonth_week1 = date1_in_nextmonth_week1 + 1. "TUE
      date3_in_nextmonth_week1 = date2_in_nextmonth_week1 + 1. "WED
      date4_in_nextmonth_week1 = date3_in_nextmonth_week1 + 1. "THU
      date5_in_nextmonth_week1 = date4_in_nextmonth_week1 + 1. "FRI
      date6_in_nextmonth_week1 = date5_in_nextmonth_week1 + 1. "SAT
      date7_in_nextmonth_week1 = date6_in_nextmonth_week1 + 1. "SUN
    *Date in week2 of next month
      PERFORM week_get_1st_day USING next_month_w2.  "return to tmpdate
      date1_in_nextmonth_week2 = tmpdate.                      "MON
      date2_in_nextmonth_week2 = date1_in_nextmonth_week2 + 1. "TUE
      date3_in_nextmonth_week2 = date2_in_nextmonth_week2 + 1. "WED
      date4_in_nextmonth_week2 = date3_in_nextmonth_week2 + 1. "THU
      date5_in_nextmonth_week2 = date4_in_nextmonth_week2 + 1. "FRI
      date6_in_nextmonth_week2 = date5_in_nextmonth_week2 + 1. "SAT
      date7_in_nextmonth_week2 = date6_in_nextmonth_week2 + 1. "SUN
    *Date in week3 of next month
      PERFORM week_get_1st_day USING next_month_w3.  "return to tmpdate
      date1_in_nextmonth_week3 = tmpdate.                      "MON
      date2_in_nextmonth_week3 = date1_in_nextmonth_week3 + 1. "TUE
      date3_in_nextmonth_week3 = date2_in_nextmonth_week3 + 1. "WED
      date4_in_nextmonth_week3 = date3_in_nextmonth_week3 + 1. "THU
      date5_in_nextmonth_week3 = date4_in_nextmonth_week3 + 1. "FRI
      date6_in_nextmonth_week3 = date5_in_nextmonth_week3 + 1. "SAT
      date7_in_nextmonth_week3 = date6_in_nextmonth_week3 + 1. "SUN
    *Date in week4 of next month
      IF next_month_w4 NE 999999.
        PERFORM week_get_1st_day USING next_month_w4.  "return to tmpdate
        date1_in_nextmonth_week4 = tmpdate.                      "MON
        date2_in_nextmonth_week4 = date1_in_nextmonth_week4 + 1. "TUE
        date3_in_nextmonth_week4 = date2_in_nextmonth_week4 + 1. "WED
        date4_in_nextmonth_week4 = date3_in_nextmonth_week4 + 1. "THU
        date5_in_nextmonth_week4 = date4_in_nextmonth_week4 + 1. "FRI
        date6_in_nextmonth_week4 = date5_in_nextmonth_week4 + 1. "SAT
        date7_in_nextmonth_week4 = date6_in_nextmonth_week4 + 1. "SUN
      ENDIF.
    *Date in week5 of next month
      IF next_month_w5 NE 999999.
        PERFORM week_get_1st_day USING next_month_w5.  "return to tmpdate
        date1_in_nextmonth_week5 = tmpdate.                      "MON
        date2_in_nextmonth_week5 = date1_in_nextmonth_week5 + 1. "TUE
        date3_in_nextmonth_week5 = date2_in_nextmonth_week5 + 1. "WED
        date4_in_nextmonth_week5 = date3_in_nextmonth_week5 + 1. "THU
        date5_in_nextmonth_week5 = date4_in_nextmonth_week5 + 1. "FRI
        date6_in_nextmonth_week5 = date5_in_nextmonth_week5 + 1. "SAT
        date7_in_nextmonth_week5 = date6_in_nextmonth_week5 + 1. "SUN
      ENDIF.
    ENDFORM.
    *&      Form  get_week_next_month
    FORM get_week_next_month.
      DATA : date_by_week_of_parameter  LIKE  scal-date,
             date  LIKE  scal-date,
             week  LIKE  scal-week.
      PERFORM week_get_1st_day USING p_week. "return to tmpdate
      CALL FUNCTION 'LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in             = tmpdate
        IMPORTING
          LAST_DAY_OF_MONTH  = next_month
        EXCEPTIONS
          DAY_IN_NO_DATE     = 1
          OTHERS             = 2.
      next_month = next_month + 1.  "YYYYMMDD 2006.xx.01
      PERFORM date_2_week USING next_month. "return to tmpweek
      week = tmpweek.
      PERFORM week_get_1st_day USING week. "return to tmpdate
      date = tmpdate.
      IF next_month NE date.
        PERFORM next_week USING week.
        next_month_w1 = tmp_next_week.
        week = tmp_next_week.
      ENDIF.
      next_month_w1 = week.          "**WEEK1**
      PERFORM next_week USING week.
      week = tmp_next_week.
      next_month_w2 = week.          "**WEEK2**
      PERFORM next_week USING week.
      week = tmp_next_week.
      next_month_w3 = week.          "**WEEK3**
      PERFORM next_week USING week.
      PERFORM week_get_1st_day USING tmp_next_week. "return to tmpdate
      IF tmpdate4(2) EQ next_month4(2).
        week = tmp_next_week.
        next_month_w4 = week.        "**WEEK4**
        PERFORM next_week USING week.
        PERFORM week_get_1st_day USING tmp_next_week. "return to tmpdate
        IF tmpdate4(2) EQ next_month4(2).
          week = tmp_next_week.
          next_month_w5 = week.      "**WEEK5**
        ELSE.
          next_month_w5 = 999999.
        ENDIF.
      ELSE.
        next_month_w4 = 999999.
        next_month_w5 = 999999.
      ENDIF.
    ENDFORM.
    *&      Form  get_week_next_next_month
    FORM get_week_next_next_month.
      DATA : date  LIKE  scal-date,
             week  LIKE  scal-week.
      CALL FUNCTION 'LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in             = next_month
        IMPORTING
          LAST_DAY_OF_MONTH  = next_next_month
        EXCEPTIONS
          DAY_IN_NO_DATE     = 1
          OTHERS             = 2.
      next_next_month = next_next_month + 1.  "YYYYMMDD 2006.xx.01
      PERFORM date_2_week USING next_next_month. "return to tmpweek
      week = tmpweek.
      PERFORM week_get_1st_day USING week. "return to tmpdate
      date = tmpdate.
      IF next_next_month NE date.
        PERFORM next_week USING week. "Return to tmp_next_week
        week = tmp_next_week.
      ENDIF.
      next_next_month_w1 = week.          "**next_next_month WEEK1**
      PERFORM next_week USING week.
      week = tmp_next_week.
      next_next_month_w2 = week.          "**next_next_month WEEK2**
      PERFORM next_week USING week.
      week = tmp_next_week.
      next_next_month_w3 = week.          "**next_next_month WEEK3**
      PERFORM next_week USING week.
      PERFORM week_get_1st_day USING tmp_next_week. "return to tmpdate
      IF tmpdate4(2) EQ next_next_month4(2).
        week = tmp_next_week.
        next_next_month_w4 = week.             "**next_next_month WEEK4**
        PERFORM next_week USING week.
        PERFORM week_get_1st_day USING tmp_next_week. "return to tmpdate
        IF tmpdate4(2) EQ next_next_month4(2).
          week = tmp_next_week.
          next_next_month_w5 = week.           "**next_next_month WEEK5**
        ELSE.
          next_next_month_w5 = 999999.
        ENDIF.
      ELSE.
        next_next_month_w4 = 999999.
        next_next_month_w5 = 999999.
      ENDIF.
    ENDFORM.
    *&      Form  GET_SALES_HISTORY
    FORM get_sales_history.
      DATA : m_3  LIKE  s003-aemenge VALUE 0,
             m_2  LIKE  s003-aemenge VALUE 0,
             m_1  LIKE  s003-aemenge VALUE 0,
             m_0  LIKE  s003-aemenge VALUE 0.
      SELECT s003spbup s003vkorg s003~matnr
             s003aemenge s003ummenge
             s003ssour s003vrsio s003spmon s003sptag
             s003spwoc s003vtweg s003spart s003bzirk s003~kunnr
      INTO TABLE it_tmp_sales_hist
      FROM   s003
      WHERE  ( s003~spbup = prev_month0 OR
               s003~spbup = prev_month1 OR
               s003~spbup = prev_month2 OR
               s003~spbup = prev_month3
             ) AND
             s003~vkorg = p_werks AND
             s003~matnr IN s_matnr.
      LOOP AT it_tmp_sales_hist.
        CLEAR wa_sales_hist.
        wa_sales_hist-spbup   = it_tmp_sales_hist-spbup.
        wa_sales_hist-vkorg   = it_tmp_sales_hist-vkorg.
        wa_sales_hist-matnr   = it_tmp_sales_hist-matnr.
        wa_sales_hist-aemenge = it_tmp_sales_hist-aemenge.
        wa_sales_hist-ummenge = it_tmp_sales_hist-ummenge.
        COLLECT wa_sales_hist INTO it_sales_hist.
      ENDLOOP.
      LOOP AT it_all_material.
        CLEAR : m_3, m_2, m_1, m_0, wa_sales_report.
        LOOP AT it_sales_hist WHERE matnr = it_all_material-matnr.
          IF it_sales_hist-spbup = prev_month3.
            m_3 = it_sales_hist-ummenge.
          ELSEIF it_sales_hist-spbup = prev_month2.
            m_2 = it_sales_hist-ummenge.
          ELSEIF it_sales_hist-spbup = prev_month1.
            m_1 = it_sales_hist-ummenge.
          ELSEIF it_sales_hist-spbup = prev_month0.
            m_0 = it_sales_hist-ummenge.
          ENDIF.
        ENDLOOP.
        wa_sales_report-matnr = it_all_material-matnr.
        wa_sales_report-m_3   = m_3.
        wa_sales_report-m_2   = m_2.
        wa_sales_report-m_1   = m_1.
        wa_sales_report-m_0   = m_0.
        wa_sales_report-avg_sale = ( m_3 + m_2 + m_1 ) / 3.
        IF ( ( m_0 > 0 ) OR ( m_1 > 0 ) OR ( m_2 > 0 ) OR ( m_3 > 0 ) ).
          APPEND wa_sales_report TO it_sales_report.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    *&      Form  PROCESS_GET_MONTH_FOR_SALES
    FORM process_get_month_for_sales.
      "Current Month
      PERFORM week_get_1st_day USING p_week.    "return to tmpdate
      prev_month0 = tmpdate+0(6).
      "Month -1
      PERFORM get_prev_month USING tmpdate.     "return to prev_month
      prev_month1 = prev_month+0(6).
      "Month -2
      PERFORM get_prev_month USING prev_month.  "return to prev_month
      prev_month2 = prev_month+0(6).
      "Month -3
      PERFORM get_prev_month USING prev_month.  "return to prev_month
      prev_month3 = prev_month+0(6).
    ENDFORM.
    *&      Form  GET_PREV_MONTH
    FORM get_prev_month USING inp_date LIKE sy-datum.
    inp_date+6(2) = '01'.
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
      EXPORTING
        months        =  -1
        olddate       =  inp_date
      IMPORTING
        newdate       =  prev_month.
    ENDFORM.
    *&      Form GET_LAST_DAY_OF_MONTH
    FORM get_last_day_of_month USING inp_date LIKE sy-datum.
    DATA : last_day_of_month LIKE scal-date.
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        day_in                 =  inp_date
    IMPORTING
       LAST_DAY_OF_MONTH       =  tmpdate
    EXCEPTIONS
       DAY_IN_NO_DATE          = 1
       OTHERS                  = 2.
    ENDFORM.
    *&      Form  WEEK_GET_FIRST_DAY
    FORM week_get_1st_day USING inp_week LIKE scal-week.
      CALL FUNCTION 'WEEK_GET_FIRST_DAY'
        EXPORTING
          week = inp_week
        IMPORTING
          date = tmpdate
        EXCEPTIONS
          week_invalid  = 1
          others        = 2.
    ENDFORM.
    *&      Form  NEXT_WEEK
    FORM next_week USING inp_week LIKE scal-week.
      CALL FUNCTION 'NEXT_WEEK'
        EXPORTING
          current_week       =  inp_week
        IMPORTING
          NEXT_WEEK          =  tmp_next_week.
    ENDFORM.
    *&      Form  GET_BACK_ORDER
    FORM get_back_order.
      DATA : back              TYPE P VALUE 0 DECIMALS 3,
             subtract          TYPE P VALUE 0 DECIMALS 3,
             do_qty    

    Hi ,
    Replace your  select statements as below in
    subroutines get_back_order and get_pending_order.
    Let me know your status of program from your rewards.
    Regards,
    Sankar
    FORM get_back_order.
    ranges : r_posnr for vbrp-posnr.
    r_posnr-low =  '000000'.
    r_posnr-high = '999999'.
    r_posnr-sign = 'I'.
    r_posnr-option = 'BT'.
    append r_posnr.
    SELECT vbapvbeln vbapposnr vbap~matnr
    vbapkwmeng vbapkbmeng vbap~klmeng
    INTO TABLE t_vbap FROM vbap
    WHERE
    ( vbeln LIKE '21%' OR " Sales Order
    vbeln LIKE '25%' OR " Exchange
    vbeln LIKE '26%' ) and
    posnr in r_posnr  and
    matnr IN s_matnr AND
    werks = p_werks 
    FORM get_pending_order.
    SELECT jestobjnr afpomatnr afpopsmng afpowemng
    INTO TABLE it_pending_order
    FROM aufk
    INNER JOIN afko
    ON aufkaufnr = afkoaufnr
    INNER JOIN afpo
    ON afkoaufnr = afpoaufnr
    INNER JOIN jest
    ON aufkobjnr = jestobjnr
    FOR ALL ENTRIES IN it_all_material
    WHERE
    jest~stat = 'I0002' AND "Status REL
    jest~inact <> 'X' AND
    afpo~matnr EQ it_all_material-matnr AND
    aufk~werks = p_werks.

  • Collective Invoice - Actual Goods Issue date

    Hi Friends,
    Collective invoice topic has been discussed many times but I didn't find exact solution to solve my issue.
    From sap help and few other threads it is learnt that Billing type, Billing date, Payer, Billing unit, Terms of payment, Incoterms, Letter of credit should be same to have collective invoice. During my tests it is understood that apart from those Actual Goods Issue date (Post Goods Issue) date should be same to have collective invoice for different sales orders/deliveries. In my tests SAP didn't consider Billing date but it did consider Actual GI date. In other words, even the billing date and other requirements are same invoice split happend due to different Actual GI date. However collective invoice created even though the billing date is different but Actual GI date is same.
    My user creates one sales order and one delivery for a customer once in a week (so 4 orders/deliveries in a month) and creates Invoice by end of the month with collective invoice. So based on the above tests I can ask the user to create sales orders, deliveries every week but perform Post Goods Issue month end and then create invoice so that collective invoice can be done. But the issue is they want to do the Post Goods Issue every week because the stock levels should reduce on weekly basis. So how can we create collective invoice even though the Post Goods Issue is done weekly (so Actual GI date will be different)
    Any idea? Please let me know if further information required.
    Thank you

    Hi,
    You may consider writing a routine under copying requirements so that invoice is not split even if the Actual GI date is different.
    Consider the following [thread|Collective billing; for more info.
    Regards,
    Amit

  • Kernel Panics, Gray screen of death, and hard drives, oh my!

    Last week, while performing multiple tasks on my G4, Safari froze up and completely locked up the entire computer. I rebooted by manually pushing the glowing power button the front of the tower. During reboot, I got the gray screen of death with the "you need to restart your macintosh... by holding down the power button for several seconds" message.
    After a couple tries and getting that exact same gray screen of death, I started to worry about all my data.
    I took both drives out of the G4 Quicksilver - one, a 500gb Barracuda Seagate (Master/bay 1), the other a 200gb Hitachi (slave/bay 2). I hooked them up to an older G4 and ran DiskWarrior and DiskUtility on both of them. The master drive had serious (>34%) fragmentation, which has since been cleaned up. The slave drive was relatively fine.
    here's my current problem:
    When I hook up:
    1. Just the Master with no jumper pins, the drive runs fine, no problems, all settings and prefs are there, etc.
    2. Just the Master with the correct pin settings, I get the kernel panic screen of death
    3. The Master with correct pin settings and Slave with correct pin settings, kernel panic screen of death
    4. If I swap the Master and Slave, and make the correct pin settings, the booting process starts and then I get a light gray screen with the "ghostbusters/do not enter" circle.
    I put the original Slave drive in an external HD firewire enclosure, and it will mount on the desktop after the original Master drive has booted up - BUT - if I have the external drive powered up before I boot the Master, I get a gray screen with nothing on it - no message, nothing but grayscreen.
    I've backed up my critical data, but would like to get these two drives back into their normal operating Master/Slave relationship that served them well for the last couple years.
    Any help greatly appreciated.

    New wrinkle:
    This morning trying at boot up, the Mac chime sounded, the gray screen w/the apple logo appeared, and then the machine sounded like either the main fan or one of the two drives spun down. Shortly thereafter, I got the prohibitory sign again.
    I rebooted and then got something completely different: a black screen with a small blinking vertical rectangle in the top left of the screen, with nothing else happening for a long time, so I manually rebooted and tried to boot into safe mode.
    Trying to boot into safe mode gave me the chime, the apple logo, and then the sound of either the fan or drive spinning down and leaving me at the prohibitory sign once again.
    Finally I option-booted to the slave drive and upon startup, received the following crash report, which might as well be in Swahili as far as my being able to make sense of it:
    Sat Apr 11 09:59:48 2009
    Unresolved kernel trap(cpu 0): 0x300 - Data access DAR=0x0000000003DFFF70 PC=0x000000000032F68C
    Latest crash info for cpu 0:
    Exception state (sv=0x2d409780)
    PC=0x0032F68C; MSR=0x00009030; DAR=0x03DFFF70; DSISR=0x40000000; LR=0x00287A40; R1=0x2D3BFDD0; XCP=0x0000000C (0x300 - Data access)
    Backtrace:
    0x2D3BFE20 0x00287AA0 0x00288658 0x0030C5AC 0x000B34C8 0xFFFFDFFF
    Proceeding back via exception chain:
    Exception state (sv=0x2d409780)
    previously dumped as "Latest" state. skipping...
    Exception state (sv=0x24459500)
    PC=0x93091180; MSR=0x0000D930; DAR=0x00100AE4; DSISR=0x40000000; LR=0x000067FC; R1=0xBFFFED50; XCP=0x00000030 (0xC00 - System call)
    BSD process name corresponding to current thread: launchd
    Mac OS version:
    9G55
    Kernel version:
    Darwin Kernel Version 9.6.0: Mon Nov 24 17:39:01 PST 2008; root:xnu-1228.9.59~1/RELEASE_PPC
    System model name: PowerMac3,5
    panic(cpu 0 caller 0xFFFF0003): 0x300 - Data access
    Latest stack backtrace for cpu 0:
    Backtrace:
    0x0009BCF0 0x0009C694 0x00029EA0 0x000AFA90 0x000B32F8
    Proceeding back via exception chain:
    Exception state (sv=0x2d409780)
    PC=0x0032F68C; MSR=0x00009030; DAR=0x03DFFF70; DSISR=0x40000000; LR=0x00287A40; R1=0x2D3BFDD0; XCP=0x0000000C (0x300 - Data access)
    Backtrace:
    0x2D3BFE20 0x00287AA0 0x00288658 0x0030C5AC 0x000B34C8 0xFFFFDFFF
    Exception state (sv=0x24459500)
    PC=0x93091180; MSR=0x0000D930; DAR=0x00100AE4; DSISR=0x40000000; LR=0x000067FC; R1=0xBFFFED50; XCP=0x00000030 (0xC00 - System call)
    BSD process name corresponding to current thread: launchd

Maybe you are looking for

  • How do i set up a wireless itunes network in multiple rooms???

    I'm trying to add multiple Airport express units(in different rooms), to my wireless network (internet only). I have two express units and apple TV and want to be able to play music via itunes through 1 or more, or all of the rooms! I'm buggered if I

  • Reader 9.2

    Can't open pdf files in Workspace using Reader 9.2. Getting this error "The Adobe Acrobat/Reader that is running cannot be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and try again. I also have Acrobat 8.1.6 on my workst

  • Difficulty to display a newspaper page

    Connecting to http://www.corriere.it the page download indication stops at 3 of 27 elements and after a while I have the information that Safari cannot display the page. this does not appen with other http. Why does it happen? how can I solve this pr

  • I have a MBP with Parallels. I deleted Firefox from OSX and lost all bookmarks. Is there a way to retrive them?

    I have a MBP with Lion as well as Parallels and Windows 7. In Lion, I completely uninstalled Firefox using "Clean My Mac." Don't ask me why:( Understandably, my bookmarks are gone. Are they hidden anywhere they can be retrieved? I have been trying to

  • Windows 7 won't load and keeps restarting on my macbook pro?

    So my windows 7 bootcamp works perfectly fine. But I downloaded something on windows 7 and it says it needs to restart. It restarted automatically and then it tries to load w7. The blinking "_" on top left shows and then it restarts itself again and