Datatype problem in project euler
Today I had nothing to do, so I participated in Project Euler http://projecteuler.net with Labview. I'm at question 10 now. The question itself isn't much of a challenge, but the problem I'm having is that the datatypes are to small for the value I would like to put in there. The value first goes up, then changes from + to - and then goes back to zero. This all happens while I'm just adding up to the value.
I guess there is a sollution to this problem but I don't seem to find it. Is there someone who can and will help me please?
Well, the link you gave said problem 10 was "Find the sum of all the primes below two million", a little different problem than 2^1000.
In order represent 2^1000 at full resolution, you would need a 1000 bit number! Of course a U64 won't be able to hold it. A double will hold it and it comes to about 1.07...e301, so 301 decimal digits. But a double won't store the full resolution.
In order to do what you want, you will have to set up your own math functions using 125+ bytes. You will have to do the multiplication and do all of your own carries. That why they made it a problem, to challenge you to figure out the algorhitm to do it. Otherwise going 2^1000 in any programming language is a trivial exercise.
Similar Messages
-
Project Euler, what am I doing wrong?
Hi
I am working on problems from project euler and I am a little stuck here. I really don't see an error in my program but my solution seems to be wrong.
I don't want you guys to solve the problem in another way or to hold my hand, I just want to make progress but after some hours it seems that I need some feedback. Maybe I'm overlooking something...
The problem it is about is problem 21:
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
Evaluate the sum of all the amicable numbers under 10000.
And this is what I've got (Haskell)
main =
print (sum[ x | x <- [1..9999], spd (spd x) == x])
--_Proper_ divisors so divisors 1 == []
divisors :: Integer -> [Integer]
divisors 0 = []
divisors 1 = []
divisors n = [ x | x <- [1..n-1], n `mod` x == 0]
--Sum of Proper Divisors
spd :: Integer -> Integer
spd n = sum (divisors n)
Does anyone see a flaw in my reasoning?
When I run the list comprehension from my main and manually test the numbers I get, they all are amicable numbers. And I don't see how I could miss some of them as I am really defining them exactly like in the problem...
I hope someone can shed some light because I am probably making some stupid mistake.I just checked it on Project Euler, and it's not accepted as the right answer. So chances are the method you both are using is wrong. I know I started the problem but never finished it (in Python), and, as far as I can tell, I'm doing the same thing as you are. I'm probably not going to be much help, but my only thoughts on the matter are: Have you had a look at the proper divisors? I suggest having that array be printed out, and then figuring out the proper divisors for one or two easy terms that you can easily figure out by hand, and compare them. If they look correct, then make sure that the rest of the problem apply to the two sets you've got (the one by hand and the other via the script), and figure out if there's anything in there that shouldn't be. I'd offer more help if I could, but this is all I'm capable of offering (besides offering to put my python script up here too if you're interested).
Hope that helps a bit,
Lswest -
Problems using projects created in older versions of iMovie
I have a few projects created in older versions of iMovie, as far back as version 2 as well as more recent versions. Most of those projects are finished and I want to burn them to DVD again, but a couple of them could bear a little touch up editing. These projects are precious movies of our kids and hard to replace. Although I could probably find the original video, I put many hours of work into creating these projects.
In any case, when I open up an old project, I get a warning that goes something like this: "The project was saved with an older version of iMovie. Opening it in this version will cause it to be upgraded, which will make it unreadable by older versions. Are you sure you want to open it?"
I clicked okay, thinking "sure, I don't need to play it in an older version. I have iMovie HD."
However, now when I play my old iMovie project, there are a few problems. For example, one original movie's title was over black. When I play the movie, I get a completely white screen and no title. Also, in another movie, when viewing the movie in full screen, the transitions were replaced by a black screen (although the transitions were there when I viewed the movie in the iMovie window). Basically, there are problems cropping up here and there.
I need to do some more experimenting with all this to more fully understand how many problems there are. I don't know if the projects I opened in iMovie HD are now "broken" since I "upgraded" them with iMovie HD (when prompted to save the project's changes when quitting, I said NO, don't save changes).
I don't know if I should use older versions of iMovie to view and burn to DVD these projects. (I still have iMovie 2 and 3, but not 4 or 5. I don't know if older versions would even work on my Quad G5 with OS 10.4.7.) I also don't know if the older versions of iMovie would work with the current version of iDVD. How can I tell which version of iMovie was originally used for a given project? How can I find iMovie 4 or 5 if I need it?
I also wonder if projects I make with iMovie HD can be opened by future versions of iMovie, or if I should export them as Quicktime or something to be safe.
As I start to look into this further, I would appreciate any comments, suggestions, and experiences that you may be able to offer. I need to get these movies back to their former selves, when they looked good!
Message was edited by: Anthony M Kassir MD(when prompted to save the project's changes when
quitting, I said NO, don't save changes).
Excellent! That should leave you in pretty good shape. More below.
I don't know if I should use older versions of iMovie
to view and burn to DVD these projects. (I still have
iMovie 2 and 3, but not 4 or 5. I don't know if older
versions would even work on my Quad G5 with OS
10.4.7.)
The old versions of iMovie will run just fine in today's OSX. (But not iMovie 2 if it was the version that ran in Classic instead of Mac OSX.)
I run versions 2,3,4,5 and 6 today. Problems are minimal.
I also don't know if the older versions of
iMovie would work with the current version of iDVD.
That's not a problem unless your old iMovie projects contain chapters. If you tell iMovie 3 to create a new iDVD project, it might not work. You might not be able to transfer the chapter information to the newer version of iDVD.
(I just tested iMovie 3 to iDVD 6 and everything worked just fine.)
Except for iMovie 2, all old versions of iMovie stored a small QuickTime reference movie in the project folder. If you can't get an old version of iMovie to play nice with iDVD, drag that movie into the iDVD window.
How can I tell which version of iMovie was originally
used for a given project?
Drop the project file (discussed below) onto the TextEdit icon in the Dock. The version of iMovie that last saved the project is shown in the first few lines of the project file.
iMovie 5 used an entirely different project file format, the pList format. The top of the project file will look like this in TextEdit:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
How can I find iMovie 4 or
5 if I need it?
eBay?
I also wonder if projects I make with iMovie HD can
be opened by future versions of iMovie, or if I
should export them as Quicktime or something to be
safe.
We can never assume any new version of iMovie will be able to understand all features of a older project. It's always smart to make a backup.
There can be problems Apple can't anticipate. There may be third-party software used to create titles, transitions and special effects, plug-ins not installed with the new version or (more often, incompatible). The fonts installed on our Mac may have changed too. There's lots of features that can't be anticipated. I've never had a problem converting projects, but I never use third-party add-ons and special fonts.
As I start to look into this further, I would
appreciate any comments, suggestions, and experiences
that you may be able to offer. I need to get these
movies back to their former selves, when they looked
good!
My guess is it should be possible to restore the projects back to their original state.
Note that when imovie 5/6 converts an older project, it does NOT create a true iMovie HD project. Instead of creating an iMovie package, it retains the project FOLDER format. It places new iMovie HD elements inside the old project folder instead of converting it to a package.
When converting the project it changes the old project file name to "Sample Project Name.iMovie2Project", then creates a NEW project file with the plist format, having the name "Sample Project Name.iMovieProj". (There may NOT be the .iMovieProj extension.) When you save the new project, it adds a new project file "Sample Project Name.~iMovieProj". Note the tilde. The tilde file is a backup of the project file as it was when last saved in iMovie HD.
For our purposes, ignore the iMovie HD project files. We'll use the file ".iMovie2Project" to restore the project. (The extension is the same for all old versions of iMovie, not just iMovie 2.)
• In the Finder, Duplicate the entire project folder. Work on the copy.
• Open the project folder in the Finder.
• Discard the "Cache" folder, the "Shared Movies" folder, the "Audio Waveforms" folder and the two iMovie HD project files. (Some of those items may not yet exist yet because you didn't save the converted project.)
• Drop the "Sample Project Name.iMovie2Project" file onto the TextEdit icon in the Dock to get the version. Close it.
• Remove the ".iMovie2Project" extension, if you want.
• Launch that version of iMovie. Drop the "Sample Project Name.iMovie2Project" file icon on the iMovie icon in the Dock. With luck, the project should open normally. It's possible any third-party plug-ins used to create the project may not be available. If they aren't available, there might still be problems.
• Move your unconverted projects to folders that say which version of iMovie created them. To open them in the future, drop the project icon on the appropriate version of iMovie.
If all this fails, there is another way to do the editing you want. That is to import the project.mov file that's inside the converted project folder to a new iMovie HD project. That will deliver the video and audio of the original project as a single clip. Use that to re-edit the project. The name of the movie is "Sample Project Name.mov".
(The movie is a QuickTime reference movie, with no video and audio of its own, just pointers to the files in the Media folder. So long as the Media folder hasn't changed, it can play the original project as last saved.)
Importing the project.mov won't work with iMovie 2 projects, however, for iMovie 2 didn't store a project.mov file in the project folder.
Even if you end up importing the project.mov, you still may want to "unconvert" the project as described above.
Hope I haven't skipped a step. Let me know if you bump your head on something.
Karl -
I downloaded an HD movie onto my laptop from i-tunes. It plays fine on my laptop, but when I plug in my HD projector, the movie quits. When I unplug the projector, the movie starts again. I have never had a problem with projecting an itunes movie before this. Someone told me that i-tunes changed something so that movies can no longer be projected. We have a home theatre and have watched movies this way quite regularly, so it would be a drag if Apple will prevent us from doing this in the future.
I don’t know about projection, but I’m unable to watch HD content in iTunes because my Apple 30-inch Cinema Display is not HDCP-compliant (which is part of an HD copy-protection scheme).
The other movies you’ve projected, were they HD as well? If not, it could be the same problem: your projector is not HDCP-compliant. -
Hi,
I am facing problem in Project progress report CNE5.
System is calculated 300 % poc in Adjusted aggregated actual POC & Aggregated actual POC field only after full confirmed the activity (Degree of Processing is showing in report as 100%).
If I confirmed 50 % then system is showing above value 0% .
Also while CNE1 system is taking default method as :SAP 0-100, so i changed it into activity by 00006 (Work) then system calculate the Progress but only after full confirmation, but again it is 300%. which should not.
The configuration settings are as
1. Progress Version: -
Progress Version : 100
Plan Version : 0
EV Basis : 1 ( Cost Plan)
POC weighting : 4 Work, Basic ( Active Project)
2. Group of Progress version:-
Controlling Area & 1
3. Assign Progress Versions to Group Progress Versions:-
Controlling Area, 100 & 1
4. Define Statistical Key Figure for Percentage of Completion:-
Usage SKF (with unit of measurement= %)
Controlling area 1 10
Controlling area 2 20
Controlling area 3 30
5. Define Measurement Methods:-
Measurement method :0000000006 (Work)
Meas. technique : E ( Degree of Processing)
Max POC : 100
6. Define Measurement Method as Default Value
Progress version(100), Object Type (2:Activity, Internal Processing), Plan/ Actual( 1 &2 :both), Method (00000006 :Work)
7.Maintain Assignment of Cost Element Group
Cost element (PS) , Default selection( Yes) & cost element group(PS_PROP)
I hope above information is sufficient.
My problem is system is calculating poc only after full confirmation but i want at partial confirmation. Also after full confirmation poc is showing 300% which i want 100%.
Regards,
AVIHi Experts,
I am waiting for your valuable inputs.
Regards,
AVI -
Capacity check problem in Project system
hi,
i have some questions for the Capacity check problems in Project System.
1. if one Person is assigned to diffierent Work Centers, for example, person A is assigned to Work Center 01 under Plant 01, and Work Center 02 under Plant 02, how can i do the Capacity check?
if i want to use A of Work Center 01 in the Project, the System will only check the Capacity of 01, or both of 01 and 02?
2. What is the Pooled Capacity?
Rgds,
Lianghi,
1.Capacity check takes place at plant level itself..
2.Pooled capacity:- This is created separately in [u wil find in PP] and this capacity can be used by different work centers.
regards
pushpa -
Problems opening project if I 'log on' with new id
Someone told me that my problem may be fixed if I logged on as a new user. I assume because they thought the problem might go away if I did so. But now when I'm logged on as a new user, I can't open the project. I get the forever beach ball???
Maybe I'm just not waiting long enough, but it seems to be crashing my system.
Any advice??
BryceThe log in as a different user manuever is intended to determine if the FCP application itself , not any particular project, is at issue. This manuever involves only logging in as a different user and then starting FCP. If you get an un named project and normal start-up, that tells you at least that FCP is working OK. In turn that informs you that the preferences used as the "real" user may be the problem. If the project you are working on is not available to the "different" user and the different user tries to open it,an assignment that has to be made in advance of the switch, you could get a beachball and learn very little. You would have to make all components of the project(everything) available to the different user to try to start the project.
But the search for problems within projects are not revealed in this manuever. -
10.1.3 - Compiler problem rebuilding projects
I found a problem compiling projects.
Until 10.1.2 when I compiled a project and I got some errors correct classes where compiled and stored, now only if all is correct compilation succeds and compiled classes are stored.
Is it possible to avoid that odd behaviour ?
Tks
TullioCannot confirm your observation.
I believe it really depends on the location of the error.
With 9.0.5.2 (!), depending on the location of the error, the amount of class files written differs enormously. Sometimes, it seems all class files are written except the ones with error. Sometimes almost no class files make it to the disk.
If that's the odd behaviour you're talking about then this already existed in 9.0.5.2.
Sascha -
Problem of LOV, Datatype Problem
hi experts
When i applied an LOV on Supplier ID field which is foreign key, i am getting this error please see the Snapshot of form.
http://1.bp.blogspot.com/-JsNiNnjdoyg/T5KGcPpzlCI/AAAAAAAAAOk/a51eItBrDWM/s1600/Capture-1.PNG
Datatype of supplierID in Child Table is Integer while in parent table it is type of DBSequence. I have also apply sequence in database.
One Very Important thing is that i am using lot of LOVs in My project but i am not getting this type of error in any LOV. I am using same techniques in other LOVs. I have not any
problem in database.
Please help me to solve this problem.
Thanks.........Regards
Muhammad NasirIn Record group of second LOV(EMPLOYEES) insert where-clause like:
where emp.DEPTNO = :DEPTNO_you get_from_first_lov
P.S. Please, do better if you write in lowercase, It would be more readable -
Problem with project stock valuation class
Dear All,
We have an issue regarding the Revenue Inventory and Capital Inventory. There is a certain balance amount which should be in capital but system is showing in Revenue and vice versa.
The reason for this is that when the material was created, in some materials the main valuation class was 3032(Project) and in some it was maintained as 3030(revenue). But project stock valuation class was not maintained.
Now the problem persists in the G/L balances, the G/L of project stock (132006)displays some amount of revenue(132000) and vice versa.
We tried to maintain the project stock valuation class (3032) for materials for which the main valuation class is 3030 (Revenue),but still the G/L for revenue (132000) is getting hit.
At the end, the requirement is that G/L for revenue (132000) should hit when revenue procurement is there and G/L for capital (132006) should hit when capital procurement is there.
Kindly suggest the way forward.
Regards,
HarshThanks Venkat, we have thought of the same as a last stop but there are hundreds of materials which has this problem and there would be many open documents for them.
If anything could be suggested other then this, and I wanted clarification on one more point that the materials for which main valuation class was 3030 and later we added 3032 in project stk Val class but after maintaining it. When we procure(Capital procurement), it is still showing the balance in G/L 132000(Revenue).
Regards,
Harsh -
Problem with project after upgrading to 10.1 and moving libraties to external drive
I need to make some updates to a project I created over a year ago prior to upgrading to 10.1. Also since creating, I moved my Final Cut Libraries off to an external drive. The only about 25% of the clips in the project appear to be linked to the original media even though all appear to be in the Original Media folder. I have tried as a test to put the original video files into a folder outside of any FCP files and used that to use the "Relink Media" function under "Edit" The attached link to a pdf doc shows the error message I get. I have no idea how to proceed from here to recover this important project.
Running Yosemite
https://www.dropbox.com/sh/96zy244yeh3mjb7/AADGTQRjeJPBlRmQ4L5f9Xcna?dl=0Russ
I copied the Original Media folder to a new location and then relinked to the new folder. The process ran without error. However that did not fix the problem. The clip content isn't there for 80% of the clips. The system was rendering in the background for hours. I went to bed. When I got up and checked using the view background tasks it stalled at some point. I tried exporting the XML and importing into a new library. I got a waring message about an unrecognized cross dissolve transition. When I opened the project in the new library the time line looked exactly the same and it behaved exactly as the original project. Thoughts? -
Problems with project when switched from Labview 8.2.1 to Labview 10
Hi everyone,
I recently switched from Labview 8.2.1 to Labview 10.
Before I can run the project I get the error which you can see in the attachment.
(The project is running well in Labview 8.2.1)
I did already check if variables end with a space, but none of them are.
The variables are also without any slashes, so that couldn't be the problem either.
Does anybody has any idea what the problem can be, please let me know.
I hope to hear from some of you soon.
Regards,
Kenny
Attachments:
Error Labview 10.JPG 19 KBYour other post in the other thread indicates you've looked at that thread. Based on that have you checked your variable names to see if any of them are multi-line? The error message is basically telling you that you have illegal characters. A carriage return (\r) or a new line (\n) is an illegal character.
-
I have 24GB of RAM in my 64 bit Windows 7 system running on RAID 5 with an i7 CPU.
A while ago I updated from Premiere CS5 to CC and then from Premiere CC to CC 2014. I updated all my then current projects to the new version as well.
Most of the projects contained 1080i 25fps (1080x1440 anamorphic) MPEG clips originally imported (captured from HDV tape) from a Sony HDV camera using Premiere CS5 or CC.
Memory consumption during re-indexing.
When updating projects I experienced frequent crashes going from CS5 to CC and later going from CC to CC 2014. Updating projects caused all clips in the project to be re-indexed. The crashes were due to the re-indexing process causing excessive RAM consumption and I had to re-open each project several times before the re-index would eventually complete successfully. This is despite using the setting to limit the RAM consumed by Premiere to much less than the 24GB RAM in my system.
I checked that clips played; there were no errors generated; no clips showed as Offline.
Some Clips now Offline:Importer CC 2014
Now, after some months editing one project I found some of the MPEG clips have been flagged as "Offline: Importer" and will not relink. The error reported is "An error occurred decompressing video or audio".
The same clips play perfectly well in, for example, Windows Media Player.
I still have the earlier Premiere CC and the project file and the clips that CC 2014 importer rejects are still OK in the Premiere CC version of the project.
It seems that the importer in CC 2014 has a bug that causes it to reject MPEG clips with which earlier versions of Premiere had no problem.
It's not the sort of problem expected with a premium product.
After this experience, I will not be updating premiere mid-project ever again.
How can I get these clips into CC 2014? I can't go back to the version of the project in Premiere CC without losing hours of work/edits in Premiere CC 2014.
Any help appreciated. Thanks.To answer my own question: I could find no answer to this myself and, with there being no replies in this forum, I have resorted to re-capturing the affected HDV tapes from scratch.
Luckily, I still had my HDV camera and the source tapes and had not already used any of the clips that became Offline in Premiere Pro CC 2014.
It seems clear that the MPEG importer in Premiere Pro CC 2014 rejects clips that Premiere Pro CC once accepted. It's a pretty horrible bug that ought to be fixed. Whether Adobe have a workaround or at least know about this issue and are working on it is unknown.
It also seems clear that the clip re-indexing process that occurs when upgrading a project (from CS5 to CC and also from CC to CC 2014) has a bug which causes memory consumption to grow continuously while it runs. I have 24GB RAM in my system and regardless of the amount RAM I allocated to Premiere Pro, it would eventually crash. Fortunately on restarting Premiere Pro and re-loading the project, re-indexing would resume where it left off, and, depending on the size of the project (number of clips to be indexed), after many repeated crashes and restarts re-indexing would eventually complete and the project would be OK after that.
It also seems clear that Adobe support isn't the greatest at recognising and responding when there are technical issues, publishing "known issues" (I could find no Adobe reference to either of these issues) or publishing workarounds. I logged the re-index issue as a bug and had zero response. Surely I am not the only one who has experienced these particular issues?
This is very poor support for what is supposed to be a premium product.
Lesson learned: I won't be upgrading Premiere again mid project after these experiences. -
Problem in project system report ZPS_PROJSUMMARY
i am working with a report ZPS_PROJSUMMARY which extracts all project summary report.now problem is it is extracting las financila years (2006 ) closed WBS element also with this years WBS elements. this problem happening in production only. this is not coming in pre production.in pre production it is deleting all the previous years WBS using this subroutine perform process_delete_child using it_report-pspnr which is based on condition if l_status_fyear lt s_fyear-low.
i am giving the full code below:-
report zps_projsummary line-size 623
line-count 65
no standard page heading
message-id zfiwip.
Report Name: ZPS_PROJSUMMARY
Author: Rey Salvador (for NDC)
Date: 14.09.2001
Purpose: Project Summary Report (with Commitments)
Modifications Log
Mod Id Author Date References Purpose
M001 R.Salvador 19.10.01 THOR 2845 Add YTD Rev.Recognised
M002 R.Salvador 19.11.01 THOR 2978 Fix YTD Rev.Rec. Level 1
M003 R.Salvador 19.11.01 THOR 3050 Fix YTD Rev.Rec. Level 1
M004 R.Salvador 08.03.02 THOR 3222 Fix Include Closed WBS
M005 R.Salvador 17.05.02 THOR 3342 Fix issue with Profile
M006 C.Kontkanen 22.05.02 LOB Add ProjManager sel
M007 R.Salvador 19.06.02 LOB Incl. WIP/COGS Adjustments
M008 R.Salvador 26.07.02 THOR xxxx Add ProjOfficer
M009 R.Salvador 06.08.02 THOR 3508 Revenue Recognition Changes
M010 R.Salvador 29.11.02 THOR 3704 New Billing Reports
M011 R.Salvador 17.12.02 THOR 3646 Fix problem with statuses
M012 R.Salvador 20.01.03 THOR 3930 Add CP/SP/WO number
M013 R.Salvador 07.03.03 THOR 3953 Incorrect Status
M014 R.Salvador 15.04.03 THOR 4056 Fix Level 1 Calculation
M015 R.Salvador 01.05.03 THOR 4070 Fix Level 1 Calculation
M016 R.Salvador 17.06.03 THOR 4125 Fix Level 2 Calculation
M017 R.Salvador 03.09.03 THOR 4220 Change RevRec Calculation
M018 R.Salvador 25.09.03 THOR 4237 Fix WBS Selection
M019 R.Salvador 11.11.03 THOR 4297 Add SP number
M020 R.Salvador 16.01.04 THOR 4342 Fix Revenue Recognition
M021 R.Salvador 28.01.04 THOR 4344 Fix Revenue Recognition
M022 R.Salvador 11.02.04 THOR 4340 Fix Selection Criteria
Ta Tran 10.06.04 DI4K900626 Copied from NDC
M023 Maccha 29.08.05 DI2K921397 Honing the selection
Srinivas process for Director and
Manager criteria.
M024 M.Srinivas 20.09.05 DI2K921599 Rectifying the order level
- Partner profile
selections. Ref.
docket:203680869
M025 M.Srinivas 01.05.06 DI2K922837 Order level - Status
profile selections
rectification. PD:203960491
M026 Gaurav Dixit18.09.06 DI2K923361 Not to select the deleted
partners from IHPA table.
M027 SaiKiran Reddy07.06.07 DI2K923793 To Exclude Deleted partner
from IHPA table.
include zps_projsummcomd.
types: begin of ty_wbs_report2, "Reporting Table
Pdir(20), "Prog Dir
posid like prps-posid, "WBS Element
post1 like prps-post1, "Short Text
fkstl like prps-fkstl, "resp const centre
prart like prps-prart, "Proj Type
ZZORDERLEVEL(2), "order level
ZZACTTYP(6), "Activity type
sstatus like bsvx-sttxt, "system status
ustatus like bsvx-sttxt, "user status
ZZIMCINITIATIVE(24), "IMC initiative
ZZIMCPROGRAM(02), "IMC Program
ZZWORKCATEGORY(02), "Work Cat
ZZWPMANLOB(01), "LOB
ZZSOURCE(02), "Source
ZZPRIN(02), "Principal
ZZIMPLEMENTREG(01), "IMP Reg
ZZCONTRACTID(10), "Contract
ZZWPNUM(08), "WP No
ZZsPNUM(08), "SP No
ZZORDERNUM(04), "Order No
lead(20), "Prog Lead
Pmgr(20), "Prog Mgr
Poff(20), "Prog Officer
acthours type megxxx, "megXXX: 3decimal"Actual Hours
acthours type wkgxxx, "wkgXXX: 2decimal"Actual Hours
planhours type wkgxxx, "Planned Hours
PLANLABOUR type wkgxxx, "PLAN LABOUR
ACTLABOUR type wkgxxx, "ACTUAL LABOUR
planmatcosts type wkgxxx, "plan material costs
actmatcosts type wkgxxx, "actual material costs
plancosts type wkgxxx, "Planned COsts
actcosts type wkgxxx, "Actual Costs
prcommitment type wkgxxx, "PR Commitment
pocommitment type wkgxxx, "PO Commitment
totcommitment type wkgxxx, "Total Commitment
zzwip like prps-zzwip, "rev rec process
planrev type wkgxxx, "Planned Revenues
actrev type wkgxxx, "Actual Revenues
pcnt_comp(8) type p decimals 2, "% complete
acttotrevrec type wkgxxx, "Act.Rev.Rec m009
actytdrevrec type wkgxxx, "Act.Rev Rec m009
revrec type wkgxxx, "revenue Recognise
revrecytd type wkgxxx, "RevRec YTD M001
rev_collected like vbrp-netwr, "Collected Rev
end of ty_wbs_report2.
types: begin of ty_wbs_report, "Reporting Table
Pdir(20), "Prog Dir
posid like prps-posid, "WBS Element
post1 like prps-post1, "Short Text
fkstl like prps-fkstl, "resp const centre
prart like prps-prart, "Proj Type
ZZORDERLEVEL(2),
ZZACTTYP(6), "Activity type
sstatus like bsvx-sttxt, "system status
ustatus like bsvx-sttxt, "user status
ZZIMCINITIATIVE(24), "IMC initiative
ZZIMCPROGRAM(02), "IMC Program
ZZWORKCATEGORY(02), "Work Cat
ZZWPMANLOB(01), "LOB
ZZSOURCE(02), "Source
ZZPRIN(02), "Principal
ZZIMPLEMENTREG(01), "IMP Reg
ZZCONTRACTID(10), "Contract
ZZWPNUM(08), "WP No
ZZSPNUM(08), "SP No
ZZORDERNUM(04), "Order No
lead(20), "Prog Lead
Pmgr(20), "Prog Mgr
poff(20), "Prog Officer
acthours type wkgxxx, "Actual Hours
planhours type wkgxxx, "Planned Hours
PLANLABOUR type wkgxxx, "PLAN LABOUR
ACTLABOUR type wkgxxx, "ACTUAL LABOUR
planmatcosts type wkgxxx, "plan material costs
actmatcosts type wkgxxx, "actual material costs
plancosts type wkgxxx, "Planned COsts
actcosts type wkgxxx, "Actual Costs
prcommitment type wkgxxx, "PR Commitment
pocommitment type wkgxxx, "PO Commitment
totcommitment type wkgxxx, "Total Commitment
zzwip like prps-zzwip, "rev rec process
planrev type wkgxxx, "Planned Revenues
actrev type wkgxxx, "Actual Revenues
pcnt_comp(8) type p decimals 2, "% complete
acttotrevrec type wkgxxx, "Act.Rev.Rec m009
actytdrevrec type wkgxxx, "Act.Rev Rec m009
revrec type wkgxxx, "revenue Recognise
revrecytd type wkgxxx, "RevRec YTD M001
pspnr like prps-pspnr, "WBS Internal Key
postu like prps-postu, "Short Text
fakkz like prps-fakkz,
psphi like prps-psphi, "proj def
zzcust like prps-zzcustNUM, "Customer
zzcustnum like prps-zzcustnum, "Customer
kostl like prps-kostl, "Cost Centres
prsumm(1) type c, "Project Summary
actcostscfy type wkgxxx, "Current FY Costs
actrevcfy type wkgxxx, "Current FY Rev
rev_billed like vbrp-netwr, "Billed Revenue
gst_billed like vbrp-mwsbp, "Billed GST
rev_collected like vbrp-netwr, "Collected Rev
gst_collected like vbrp-mwsbp, "Collected GST
totbudget type wkgxxx, "Total Budget
verna like prps-verna, "PM m006
astna like prps-astna, "PO m006
totcogs type wkgxxx, "Total COGS m009
ytdcogs type wkgxxx, "YTD COGS m009
end of ty_wbs_report.
types: begin of ty_totals, "Structure for Sub-totals
actmatcosts type wkgxxx, "Actual material Costs
actcosts type wkgxxx, "Actual Costs Total
actrev type wkgxxx, "Actual Revenues Total
planmatcosts type wkgxxx, "plan material Costs
plancosts type wkgxxx, "Planned Costs
planrev type wkgxxx, "Planned Revenues
acthours type wkgxxx, "Actual Hours
planhours type wkgxxx, "Planned Hours
ACTLABOUR type wkgxxx, "ACTUAL LABOUR
PLANLABOUR type wkgxxx, "Planned LABOUR
revrec type wkgxxx, "Revenue Recognised
revrecytd type wkgxxx, "RevRec YTD M001
acttotrevrec type wkgxxx, "RevRec Actual M009
profit type wkgxxx, "Planned Profit/Loss
actcostscfy type wkgxxx, "Actual Costs Current FY
actrevcfy type wkgxxx, "Actual Revenues Current FY
rev_billed type wkgxxx, "Billed Revenue
gst_billed type wkgxxx, "Billed GST
rev_collected type wkgxxx, "Collected Rev
gst_collected type wkgxxx, "Collected GST
prcommitment type wkgxxx, "PR Commitment
pocommitment type wkgxxx, "PO Commitment
totcommitment type wkgxxx, "Total Commitment
totbudget type wkgxxx, "Total Budget
actytdrevrec TYPE wkgxxx,
end of ty_totals.
type-pools: gsetc.
tables: cepct.
data: it_wbs_report TYPE ty_wbs_report OCCURS 0 WITH HEADER LINE,
it_wbs_report2 TYPE ty_wbs_report2 OCCURS 0 WITH HEADER LINE,
wr_wbs_report type ty_wbs_report,
it_prctr type standard table of setlist,
it_stat(72) occurs 0 with header line,
et_stat(72) occurs 0 with header line,
begin of it_tj49 occurs 0,
stats like tj49-stats,
incex like tj49-incex,
verkz like tj49-verkz,
end of it_tj49,
begin of it_csla occurs 150,
vksta like csla-vksta,
end of it_csla,
w_stat_flg,
w_join(3),
w_not(3),
w_stat_val(7) value ''' ''',
W_LEAD(40),
W_PDIR(40),
W_PMGR(40),
w_poff(40),
w_tab like sy-tabix,
n like sy-index,
w_reporting_level(2) type c,
w_gtotal_text(500) type c,
w_other_level(1) type c,
w_budat like bkpf-budat, "m002
w_level like prps-stufe,
w_record_count(8) type n,
w_pspid_ind(1) type c, "m003
begin of ziheader,
w_strlen type i,
hdr_pos type p,
hold_name(30),
conf_txt(54) value
'* CONFIDENTIAL - PROPERTY OF BACCHUS *',
end of ziheader,
p_budat like bkpf-budat,
w_sel_posid like prps-posid,
Internal tables to hold set hierarchy, values, pointers and sorts
set_hierarchy like sethier occurs 0 with header line,
set_values like setvalues occurs 0 with header line,
set_id like rgsbs-setnr,
set_id2 like rgsbs-setnr,
w_setnr(30) type c,
w_set_values like rgsb4 occurs 0 with header line,
lt_objlst type standard table of onr00,
lr_objlst type onr00,
w_first type c.
Start of M011
data: it_wbs1 like it_wbs occurs 0.
data: it_wbs_tmpo like it_wbs occurs 0 with header line. "M024
data: begin of loc_wbs occurs 0.
include structure zco_wip_wbslst. "test '''
data: pdir(20),
zzacttyp(6),
ZZIMCINITIATIVE(24),
ZZIMCPROGRAM(02),
ZZWORKCATEGORY(02),
ZZWPMANLOB(01),
ZZSOURCE(02),
ZZPRIN(02),
ZZIMPLEMENTREG(01),
ZZCONTRACTID(10),
ZZWPNUM(08),
ZZSPNUM(08),
ZZORDERNUM(04),
PERNR(08),
PERNR2(08),
end of loc_wbs.
data: begin of it_report occurs 0,
posid like prps-posid,
pspnr like prps-pspnr,
end of it_report.
End of M011
data: begin of it_deleted occurs 0,
posid like prps-posid,
pspnr like prps-pspnr,
end of it_deleted.
data: begin of l_deleted occurs 0,
posid like prps-posid,
pspnr like prps-pspnr,
end of l_deleted.
data: w_year like bkpf-gjahr.
data: begin of t_date occurs 0,
w_budat like bkpf-budat,
poper like t_poper-poper,
end of t_date.
data: t_ihpa like ihpa occurs 0 with header line,
t_ihpa1 like ihpa occurs 0 with header line,
t_ihpa2 like ihpa occurs 0 with header line,
t_ihpa3 like ihpa occurs 0 with header line,
t_ihpa4 like ihpa occurs 0 with header line,
l_status(3),
w_PLANHOURS like it_wbs-PLANHOURS,
w_PLANREV like it_wbs-PLANREV,
w_PLANCOSTS like it_wbs-PLANCOSTS,
it_tmp_wbs3 type zco_proj_summary_v2 occurs 0 with header line,
W_it_wbs5 like it_wbs .
ranges: r_prctr for prps-prctr.
ranges: r_stufe for prps-stufe.
ranges: r_posid for prps-posid.
constants: c_crtd like tj49-stats value 'I0001'.
CONSTANTS: C_LEAD(2) VALUE '4A',
C_PDIR(2) VALUE '4B',
C_PMGR(2) VALUE 'A1',
C_Poff(2) VALUE 'A2',
c_pdn like ihpa-OBTYP value 'PDN',
c_prn like ihpa-OBTYP value 'PRN'. "M023
tables : pa0002.
---------------------Organisational Units------------------------*
selection-screen begin of block orgunit with frame title text-t06.
*WP/CP Managing LOB
select-options: S_ZWP for PRPS-ZZWPMANLOB MATCHCODE OBJECT ZZWPMANLOB.
*Implementing Region
select-options: S_ZIMP for PRPS-ZZIMPLEMENTREG MATCHCODE OBJECT
ZZIMPLEMENTREG.
*Cost center group
PARAMETERS: P_CTGRP LIKE RKSB1-KSGRU no-display.
*Responsible Cost Center
select-options: s_fkstl for prps-fkstl.
select-options: s_src for proj-zzsource MATCHCODE OBJECT ZzSOURCE.
select-options: s_prin for proj-zzprin MATCHCODE OBJECT ZzPRINCIPAL .
select-options: s_wcat for proj-zzworkcategory MATCHCODE OBJECT
ZZWORKCATEGORY.
select-options: s_wpcpt for proj-ZZTYPE MATCHCODE OBJECT ZzTYPE.
selection-screen end of block orgunit.
selection-screen begin of block periods with frame title text-t05.
selection-screen begin of line.
selection-screen comment 1(20) text-c04 for field p_kokrs.
selection-screen position pos_low.
parameters: p_kokrs type kokrs obligatory default 'TELC'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text-c01 for field s_fyear.
selection-screen position pos_low.
select-options: s_fyear for bkpf-gjahr obligatory no intervals
no-extension.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text-c02 for field s_poper.
selection-screen position pos_low.
select-options: s_poper for T009B-poper obligatory no intervals
no-extension.
selection-screen end of line.
selection-screen begin of line.
selection-screen position pos_low.
selection-screen end of line.
data: p_incwip(1) type c value ' '.
selection-screen begin of line.
selection-screen comment 1(30) text-c25 for field p_calrev.
selection-screen position pos_low.
parameters: p_calrev radiobutton group 0001 default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(30) text-c26 for field p_actrev.
selection-screen position pos_low.
parameters: p_actrev radiobutton group 0001.
selection-screen end of line.
End of M007 Mods
selection-screen end of block periods.
selection-screen begin of block psjsel with frame title text-t01.
*Program Leadhouse
select-options: s_plead for pa0002-pernr matchcode object ZPA0002.
*Project Director
select-options: s_pdir for pa0002-pernr matchcode object ZPA0002.
*Project Manager
select-options: s_pmgr for pa0002-pernr matchcode object ZPA0002.
*Project Profile
select-options: s_PROFL FOR PROJ-PROFL default 'EXTERN' obligatory.
*Project Definition
select-options: s_pspid for proj-pspid.
*WBS Element
select-options: s_posid for prps-posid.
selection-screen end of block psjsel.
selection-screen begin of block othersel with frame title text-t07.
parameters: p_lvl1 radiobutton group rplv,
p_lvl2 radiobutton group rplv,
p_wip radiobutton group rplv.
selection-screen begin of line.
selection-screen comment 1(20) text-c16 for field p_oth.
selection-screen position pos_low.
parameters: p_oth radiobutton group rplv.
selection-screen comment 40(20) text-c17 for field p_level.
parameters: p_level like prps-stufe.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(22) text-c22 for field p_incwbs.
selection-screen position 42.
parameters: p_incwbs as checkbox.
selection-screen end of line.
Start of M006 Mods
selection-screen begin of line.
selection-screen comment 1(41) text-c23 for field p_clwbs.
selection-screen position 42.
parameters: p_clwbs as checkbox default 'X'.
selection-screen end of line.
End of M006 Mods
parameters:
p_status like tj49-selid.
select-options:
s_prart for prps-prart.
selection-screen end of block othersel.
selection-screen begin of block outfile with frame title text-t11.
selection-screen begin of line.
selection-screen comment 1(20) text-c11 for field p_file.
selection-screen position pos_low.
parameters: p_file as checkbox.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text-c13 for field p_runid.
selection-screen position pos_low.
parameters: p_runid like zcnwip_log-zrunid.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text-c12 for field p_filenm.
selection-screen position pos_low.
parameters: p_filenm(40) type c default '/batch/int/send/ndcreports/'
lower case.
selection-screen end of line.
selection-screen end of block outfile.
initialization.
perform ini_fiscal_year_current.
Default year/period in the selection screen
s_fyear-sign = 'I'.
s_fyear-option = 'EQ'.
APPEND s_fyear.
s_poper-sign = 'I'.
s_poper-option = 'EQ'.
APPEND s_poper.
perform ini_file_path.
at selection-screen on block outfile.
if not p_file is initial.
if p_filenm is initial.
message e017.
endif.
if p_runid is initial.
message e017.
endif.
endif.
at selection-screen on p_status.
clear it_stat.
refresh it_stat.
if p_status is initial.
w_stat_flg = 'N'.
else.
w_stat_flg = 'Y'.
endif.
at selection-screen.
include ZCNWIPCOMF_V2.
if not p_actrev is initial.
move: w_curr_year to w_curr_fperiod+0(4),
w_curr_period to w_curr_fperiod+4(2),
s_fyear-low to w_sel_fperiod+0(4),
s_poper-low to w_sel_fperiod+4(2).
if w_sel_fperiod le '200212'. "temp
message e025.
endif.
if w_sel_fperiod ge w_curr_fperiod.
message e026.
endif.
endif.
Check if Other level check, specify level from 3-4
if not p_oth is initial and
p_level is initial.
message e021.
endif.
Validate File Information
if not p_file is initial.
if p_runid is initial or
p_filenm is initial.
message e014.
endif.
select count(*) from zcnwip_log
where zrunid eq p_runid
and zrep eq 'PROJCE'. " to be changed
if sy-subrc eq 0.
message w022 with p_runid.
endif.
endif.
if not p_ctgrp is initial and not s_FKSTL is initial.
message e087 with 'Cost Center Group' 'Responsible Cost Center'.
endif.
if not p_ctgrp is initial.
clear w_setnr.
move: '0101' to w_setnr+0(4),
P_KOKRS to w_setnr+4(4),
p_ctgrp to w_setnr+8.
call function 'G_SET_GET_ALL_VALUES'
EXPORTING
setnr = w_setnr
TABLES
set_values = w_set_values
EXCEPTIONS
set_not_found = 1
others = 2.
if sy-subrc eq 0.
loop at w_set_values.
if w_set_values-from = w_set_values-to.
S_FKSTL-low = w_set_values-from.
S_FKSTL-option = 'EQ'.
else.
S_FKSTL-low = w_set_values-from.
S_FKSTL-high = w_set_values-to.
S_FKSTL-option = 'BT'.
endif.
S_FKSTL-sign = 'I'.
append S_FKSTL.
endloop.
else.
message e201 with p_ctgrp.
endif.
endif.
start-of-selection.
data: w_poper like s_poper-low,
w_fyear like s_fyear-low.
w_poper = s_poper-low.
loop at s_poper.
case s_poper-option.
when 'EQ'.
move s_poper-low to t_poper.
append t_poper.
clear t_poper.
when 'BT'.
move s_poper-low to t_poper.
append t_poper.
clear t_poper.
while w_poper < s_poper-high.
w_poper = w_poper + 1.
move w_poper to t_poper.
append t_poper.
clear t_poper.
endwhile.
endcase.
endloop.
w_fyear = s_fyear-low.
loop at s_fyear.
case s_fyear-option.
when 'EQ'.
move s_fyear-low to t_fyear.
append t_fyear.
clear t_fyear.
when 'BT'.
move s_fyear-low to t_fyear.
append t_fyear.
clear t_fyear.
while w_fyear < s_fyear-high.
w_fyear = w_fyear + 1.
move w_fyear to t_fyear-fyear.
append t_fyear.
clear t_fyear.
endwhile.
endcase.
endloop.
sort t_fyear by fyear .
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = sy-datum
I_PERIV = 'V6'
IMPORTING
E_BUPER =
E_GJAHR = w_fyear.
w_fyear = s_fyear-low.
s_fyear-low = w_fyear.
Reset Indicator
if p_calrev is initial.
move 'X' to p_incwip.
else.
clear p_incwip.
endif.
loop at t_poper.
*get last day in each period of range
t_date-poper = t_poper-poper.
*------ Start of M002 modifications
*------ Determine last day of the posting period
call function 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = s_fyear-low
i_periv = tka01-lmona
i_poper = t_poper-poper
IMPORTING
e_date = t_date-w_budat.
append t_date.
clear t_date.
endloop.
*get last day of last period in previous fiscal years chosen
*016 = last period
delete t_fyear where fyear = w_fyear. "remove current fyear
loop at t_fyear.
call function 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = t_fyear-fyear
i_periv = 'V6'
i_poper = '016'
IMPORTING
e_date = t_date-w_budat.
t_date-poper = '016'.
append t_date.
clear t_date.
endloop.
*Get the Proj Def from WBS selct option and refresh wbs select option.
data: begin of l_psphi occurs 0,
POSID like prps-POSID,
pspid like prps-psphi,
end of l_psphi.
data: begin of l_pspid occurs 0,
pspid like proj-pspid,
end of l_pspid.
data: begin of i_proj occurs 0, "M023
pspnr like proj-pspnr, "M023
end of i_proj. "M023
data: begin of i_prps occurs 0, "M023
objnr like prps-objnr, "M023
end of i_prps. "M023
data: begin of i_psphi1 occurs 0, "M023
psphi like prps-psphi, "M023
end of i_psphi1. "M023
data: len_posid type i.
if not s_posid[] is initial.
select posid psphi into table l_psphi
from prps
where posid in s_posid.
if sy-subrc ne 0.
message i100.
exit.
endif.
if not l_psphi[] is initial.
sort l_psphi.
select pspid into table l_pspid
from proj
for all entries in l_psphi
where pspnr = l_psphi-pspid and
profl in s_profl.
if sy-subrc = 0.
delete adjacent duplicates from l_pspid.
loop at l_pspid.
s_pspid-sign = 'I'.
s_pspid-option = 'EQ'.
s_pspid-low = l_pspid-pspid.
append s_pspid.
clear s_pspid.
endloop.
else.
message i100.
exit.
endif.
endif.
clear s_posid.
refresh s_posid.
loop at l_psphi.
s_posid-sign = 'I'.
s_posid-option = 'CP'.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = l_psphi-posid
IMPORTING
OUTPUT = l_psphi-posid.
while l_psphi-posid ca '.'.
replace '.' with space into l_psphi-posid.
endwhile.
condense l_psphi-posid no-gaps.
concatenate l_psphi-posid '*' into s_posid-low.
append s_posid.
endloop.
endif.
*------ End of M002 modifications
----- Exclude the P. WBS elements, these are only used for
*----- intermediate postings and are not relevant for WIP, COGS,...
perform ini_posid_range.
perform ini_pspid_range.
if not s_pspid[] is initial.
*----- If projects are selected, then make sure we have the internal
*----- key to PROJ (ie, field PSPNR)
perform get_partners.
perform sos_prepare_proj_range.
if r_psphi[] is initial.
message i100.
exit.
endif.
endif.
*----- WBS ranges with "CP" (Contains Pattern) entries need
*----- to be condensed, because the conversion exit for field POSID
----- causes an entry entered as "P." to be stored as "P *". Hence
*----- selection is flawed.
perform sos_condense_range_wbs.
*----- Activity Type Group is used to determine what Activity Types
*----- to take into account for the computation of planned and actual
*----- hours. The Activity Type Group must be exploded into its
*----- individual Activity Types, so we can build a range of Activity
*----- types.
perform sos_build_act_type_range.
*----- Selection of WBS as per selection criteria, but only Billing WBS
*----- Elements or Level 2 WBS elements
Get Level re-determined
if not p_oth is initial.
case p_level.
when 1.
move c_on to p_lvl1.
clear p_oth.
when 2.
move c_on to p_lvl2.
clear p_oth.
endcase.
endif.
if not p_lvl1 is initial.
w_reporting_level = 'L1'.
w_level = 1.
endif.
if not p_lvl2 is initial.
w_reporting_level = 'L2'.
w_level = 2.
endif.
if not p_wip is initial.
w_reporting_level = 'BE'.
w_level = 0.
endif.
refresh r_stufe.
if not p_lvl1 is initial.
clear: r_stufe.
move: '1' to r_stufe-low,
'2' to r_stufe-high,
'BT' to r_stufe-option,
'I' to r_stufe-sign.
append r_stufe.
elseif not p_oth is initial.
clear: r_stufe.
move: p_level to r_stufe-low,
'EQ' to r_stufe-option,
'I' to r_stufe-sign.
append r_stufe.
elseif not p_wip is initial. "INS DI5K902370
clear: r_stufe. "INS DI5K902370
move: '1' to r_stufe-low, "INS DI5K902370
'99' to r_stufe-HIGH, "INS DI5K902370
'BT' to r_stufe-option, "INS DI5K902370
'I' to r_stufe-sign. "INS DI5K902370
move: '2' to r_stufe-low,
'99' to r_stufe-HIGH,
'BT' to r_stufe-option,
'I' to r_stufe-sign.
append r_stufe. "INS DI5K902370
else.
clear: r_stufe.
move: '2' to r_stufe-low,
'EQ' to r_stufe-option,
'I' to r_stufe-sign.
append r_stufe.
endif.
perform select_wbs_new tables r_psphi.
commit work.
Process any WBS elements missed during initial selection
if not s_posid[] is initial.
perform check_billing_elements.
sort it_wbs by psphi
pspnr.
endif.
delete adjacent duplicates from it_wbs.
append lines of it_wbs to it_wbs1.
sort it_wbs1 by psphi
pspnr.
Transfer to temporary table before calling function
refresh loc_wbs.
loop at it_wbs1 into wr_wbs.
w_tabix = sy-tabix.
if wr_wbs-psphi ne w_ref_psphi.
if not loc_wbs[] is initial.
*----- CAREFUL: THIS FUNCTION MODULE ASSUMES THAT THE WBS ELEMENTS
*----- PASSED INTO TABLE I_WBS ALL BELONG TO THE SAME PROJECT
*----- DEFINITION. FUNCTION MODULE WILL NOT GIVE PROPER RESULTS
*----- IF CALLED FOR A TABLE I_WBS WITH WBS ELEMENTS BELONGING
*----- TO VARIOUS PROJECT DEFINITIONS. BE WARNED!!!
call function 'Z_CN_DETERMINE_REPORTS'
EXPORTING
i_fyear = s_fyear-low
i_prsumm_level = w_level
i_closed = 'X'
TABLES
i_wbs = loc_wbs
i_deleted = l_deleted.
if not p_lvl2 is initial.
loop at loc_wbs where stufe gt 2 and lvl2_posid is initial.
do.
select single up into prhi-up
from prhi
where posnr = loc_wbs-pspnr.
select single * from prps
where pspnr = prhi-up.
if prps-stufe = 2.
loc_wbs-lvl2_pspnr = prps-pspnr.
loc_wbs-lvl2_posid = prps-posid.
exit.
else.
loc_wbs-pspnr = prhi-up.
endif.
enddo.
modify loc_wbs.
endloop.
endif.
perform sos_append_wbs.
refresh l_deleted.
endif.
w_ref_psphi = wr_wbs-psphi.
refresh loc_wbs.
endif.
clear loc_wbs.
move-corresponding wr_wbs to loc_wbs.
append loc_wbs.
endloop.
if not loc_wbs[] is initial.
*----- CAREFUL: THIS FUNCTION MODULE ASSUMES THAT THE WBS ELEMENTS
*----- PASSED INTO TABLE I_WBS ALL BELONG TO THE SAME PROJECT
*----- DEFINITION. FUNCTION MODULE WILL NOT GIVE PROPER RESULTS
*----- IF CALLED FOR A TABLE I_WBS WITH WBS ELEMENTS BELONGING
*----- TO VARIOUS PROJECT DEFINITIONS. BE WARNED!!!
call function 'Z_CN_DETERMINE_REPORTS'
EXPORTING
i_fyear = s_fyear-low
i_prsumm_level = w_level
i_closed = 'X'
TABLES
i_wbs = loc_wbs
i_deleted = l_deleted.
if not p_lvl2 is initial.
loop at loc_wbs where stufe gt 2 and lvl2_posid is initial.
do.
select single up into prhi-up
from prhi
where posnr = loc_wbs-pspnr.
select single * from prps
where pspnr = prhi-up.
if prps-stufe = 2.
loc_wbs-lvl2_pspnr = prps-pspnr.
loc_wbs-lvl2_posid = prps-posid.
exit.
else.
loc_wbs-pspnr = prhi-up.
endif.
enddo.
modify loc_wbs.
endloop.
endif.
perform sos_append_wbs.
refresh loc_wbs.
refresh l_deleted.
endif.
perform process_report_table.
End of M011
Check Status Profile
if not p_status is initial.
perform process_check_status_profile.
sort it_wbs by psphi
pspnr.
endif.
Start of M006 mods
if p_clwbs is initial.
Ignore projects/WBS closed based on the year
perform process_closed_projects.
endif.
End of M006 mods
describe table it_wbs lines w_lines.
if w_lines eq 0.
message i100.
exit.
endif.
sort it_wbs by psphi
pspnr.
loop at it_wbs
into wr_wbs.
w_tabix = sy-tabix.
*----- We will extract costs and determine to which reports a WBS
*----- by Project Hierarchy, ie, we will look at all the WBS Elements
*----- in a given hierarchy in one hit. This simplifies the
*----- process of determining the highest billing element or the
*----- Level 2 WBS element for a selected WBS
*----- It also had the advantage of allowing parallel processing
*----- using CALL FUNCTION STARTING NEW TASK if required in
*----- the future
if wr_wbs-psphi ne w_ref_psphi.
if not it_tmp_wbs[] is initial.
loop at t_date.
it_tmp_wbs2[] = it_tmp_wbs[].
call function 'Z_PS_WIP_GET_COSTS_COMMITMENT'
EXPORTING
i_fyear = s_fyear-low
i_poper = t_date-poper
i_billing = 'X'
i_prsumm_level = w_level
i_other_level = w_other_level
i_budat = t_date-w_budat
i_commitment = 'X'
i_include_wipadj = p_incwip "M007
TABLES
i_rsparams = it_rsparams
i_wbs = it_tmp_wbs2.
loop at it_tmp_wbs2 into it_tmp_wbs3.
collect it_tmp_wbs3.
endloop.
w_tab = sy-tabix.
n = 1.
while n <= w_tab .
read table it_tmp_wbs2 index n.
it_tmp_wbs3 = it_tmp_wbs2.
modify table it_tmp_wbs3
index n
transporting
PLANLABOUR PLANHOURS PLANREV PLANCOSTS stufe.
n = n + 1.
endwhile.
endloop.
it_tmp_wbs[] = it_tmp_wbs2[].
perform sos_process_tmp_table.
endif.
w_ref_psphi = wr_wbs-psphi.
refresh it_tmp_wbs.
endif.
wr_wbs-tabix = w_tabix.
append wr_wbs to it_tmp_wbs.
if w_tabix eq w_lines.
*----- Don't forget to process the last hierarchy!!
if not it_tmp_wbs[] is initial.
loop at t_date.
it_tmp_wbs2[] = it_tmp_wbs[].
call function 'Z_PS_WIP_GET_COSTS_COMMITMENT'
EXPORTING
i_fyear = s_fyear-low
i_poper = t_date-poper
i_billing = 'X'
i_prsumm_level = w_level
i_other_level = w_other_level
i_budat = t_date-w_budat
i_commitment = 'X'
i_include_wipadj = p_incwip "M007
TABLES
i_rsparams = it_rsparams
i_wbs = it_tmp_wbs2.
exceptions
not_found = 1.
loop at it_tmp_wbs2 into it_tmp_wbs3.
collect it_tmp_wbs3.
endloop.
w_tab = sy-tabix.
n = 1.
while n <= w_tab .
read table it_tmp_wbs2 index n.
it_tmp_wbs3 = it_tmp_wbs2.
modify it_tmp_wbs3 index n transporting stufe
PLANLABOUR PLANHOURS PLANREV PLANCOSTS .
n = n + 1.
endwhile.
endloop.
it_tmp_wbs[] = it_tmp_wbs2[].
perform sos_process_tmp_table.
endif.
endif.
endloop.
end-of-selection.
Delete WBS with no financial information
loop at it_wbs_report into wr_wbs_report.
if wr_wbs_report-actcosts eq 0 and
wr_wbs_report-plancosts eq 0 and
wr_wbs_report-planrev eq 0 and
wr_wbs_report-acthours eq 0 and
wr_wbs_report-actrev eq 0 and
wr_wbs_report-revrec eq 0 and
wr_wbs_report-revrecytd eq 0 and
wr_wbs_report-acttotrevrec eq 0 and
wr_wbs_report-actytdrevrec eq 0 and
wr_wbs_report-pocommitment eq 0 and
wr_wbs_report-prcommitment eq 0 and
p_incwbs is initial.
delete it_wbs_report index sy-tabix.
endif.
endloop.
loop at it_wbs_report.
select single
objnr
psphi
zzacttyp
ZZIMCINITIATIVE
ZZIMCPROGRAM
ZZWPMANLOB
ZZIMPLEMENTREG
ZZCONTRACTID
ZZWPNUM
ZZSPNUM
ZZORDERNUM
ZZORDERLEVEL
ZZWIP
from prps
into corresponding fields of w_it_wbs5
where posid eq it_wbs_report-posid.
CLEAR: W_LEAD, W_PDIR, W_PMGR, w_poff.
select single zztype ZZWORKCATEGORY ZZPRIN ZZSOURCE from proj into
(w_it_wbs5-zztype, w_it_wbs5-ZZWORKCATEGORY, w_it_wbs5-ZZPRIN,
w_it_wbs5-ZZSOURCE) where pspnr = w_it_wbs5-psphi.
CLEAR w_it_wbs5-lead.
select single parnr from ihpa into w_it_wbs5-lead
where objnr = w_it_wbs5-objnr and
parvw = C_LEAD and
KZLOESCH NE 'X'. " M026
PERFORM READ_PA0002 USING w_it_wbs5-lead CHANGING W_LEAD.
CLEAR w_it_wbs5-pdir.
select single parnr from ihpa into w_it_wbs5-pdir
where objnr = w_it_wbs5-objnr and
parvw = C_PDIR and
KZLOESCH NE 'X'. " M026
PERFORM READ_PA0002 USING w_it_wbs5-PDIR CHANGING W_PDIR.
CLEAR w_it_wbs5-pmgr.
select single parnr from ihpa into w_it_wbs5-pmgr
where objnr = w_it_wbs5-objnr and
parvw = C_PMGR and
KZLhi,
1.Capacity check takes place at plant level itself..
2.Pooled capacity:- This is created separately in [u wil find in PP] and this capacity can be used by different work centers.
regards
pushpa -
Problems opening project in CS5
Hi all,
I've been working on a CS5 project for 6 months. 2 weeks ago I tried to open the project and Premiere hanged when loading media. I have load the project closing the the opened sequences while loading the media files, but when I try to open any sequence it hangs again. I'm unable to do anything when I open the project. I have tried the following tasks:
1.- Create a new project, import the entire original project on it. It imports the original one, but with same results: when I try to open a sequence Premiere hangs on.
2.- Create a new project, import some sequences of original project on it: doesn't work, the box where sequences should be is empty
3.- Open any of the autosaved project: same problem, every saved project has same behavior
I don't know how to solve this problem. I have months of work in that project and the only thing left for me is to cry
Can anybody hel me?
Thanks a lot.SO, my friend is running both FCS 7 and FCP X on the same harddrive.
snowleopard with the latest upadates.
hmmm
yes, the funny thing is, I have FCS 6 and FCP X on one Disk running Snowleopard.
NO problems. Uprade to Lion... No Problems.
And also I could not find information on the web of somebody else having this problem.
Maybe you are looking for
-
I cant download apps. It keeps sayin 'unable to load. Try again later' I use my iphone to download. How do i get it to work?
-
Field/Table to change the header tick in sales order billing plan
Hi SD Guru's I am using a GUI screen to create standard sales order (VA01). Since my order dates at header and line item level can differ, i want the field name or table name of the header tick which is taken as default from my billing plan in my sal
-
IDOC-XI-EDI : Sender Party in IDOC with LS Partner Type
Hi Does anyone know of a way to have IDOCs sent from SAP to XI to arrive with a sender party. <b>Note</b> The Partner Type of the original IDOC is LS. [I know how to do this with e.g. KU Partner Type.] Thx, Duncan
-
My IMac is frozen with the screen white ,apple logo appears and a spinning wheel under it. A long empty rectangle empty appears under the wheel and is empty.
-
Macbook Pro storage full, but scanning applications only picking up 192GB
Hi everyone, I have recently received a message on my Macbook saying that the 'Start-up Disk' is full, so I used Omnidisk Sweeper to check the files. Now Omnidisk only picks up 192GB, whereas the 'Get Info' button on the Macintosh HD states that ther