Comparing a time period and a date via trigger....

Hi ,
There are among others three tables....
Table material
   material_code number
   onomasia   varchar2(50)
   guarantee_end_date date
Table supplier_contract
     contract_code number
     start_date date
     end_date date
    supplier number(5)
Table supplier_contract_material
      contract_code number
      material_code numberThe table material , for each material contains the guarantee_end_date , whereas the other two contain info about the materials that should be replaced/fixed/ e.t.c by the supplier in the specific time period (start_date - end_date).
The thing that has to be done is there have not be any overlap of the dates.... In other words , when a material is bought then this is covered for replacement by the end of the date (guarantee_end_date in the first table). After this date there should be contract with the supplier for this material for a specific period (start_date - end_date , in the second table).
I want to secure the database that when the end_user tries to update this time_period(start_date - end_date) before or between the guarantee_end_date ("when i say between the guarantee_end_date " , i mean the condition guarantee_end_date between start_date and end_date is not acceptable) then an alert would be raised ....
So , I wrote the following trigger:
create or replace trigger trg_check_eggisi
before update on supplier_contract
for each row
declare
guarantee_end_date_var date;
begin
   begin
     select guarantee_end_date 
       into guarantee_end_date_var
       from material a, supplier_contract_material b
      where a.material_code=b.material_code
       and b.contract_code=:new.contract_code;
     exception
      when no_data_found
       then return;
    end;
   if guarantee_end_date_var>:new.guarantee_end_date_var
     then
     raise_application_error(-20021,'NOT_APPLICABLE');
   end if;   
end;The problem is that the error ORA-01422 is raised ... because more than 1 material may be contained in the specific contract....
Do you have any idea...????
many thanks ,
Simon

Hi  John,
As you want to  display the planned value of Depreciation for future years,
since this is not possible you can display the planned values only for that year and that too for subsequent periods,  you  will  see  the Yellow icon stating it is planned which is not yet posted in the posted value Tab,
Since if  you  want to display planned values for future year you have to  post Depreciation for subsequent period and close the fiscal year and again same procedure follows....
Regards,
Imran M Arab

Similar Messages

  • Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD

    Greetings All,
    I've a requirement to create a custom tab in the VL01N/VL02N/VL03N header record displaying custom fields.
    I've successfully implemented BADI LE_SHP_TAB_CUST_HEAD, created a subscreen, appended my custom fields to the LIKP table via append structure, and can now view my fields in the transactions listed above.
    I'm having trouble updating the fields in the subscreen and save the values back to the LIKP table.  First question is a) do I do this via the PBO PAI modules in my subscreen, or should I be doing this in the BADI?
    Second question is, if I shuodl be doing this in the BADI, how do I do it.  A simple example is that I have created a field called ZZ_CUST_TIME in LIKP, added it to my sub-screen using data dictionary linking.
    How do I pass a value entered into this field via VL02N back to the transaction for update?
    Any suggestions would be greatfully appreciated.
    Regards,
    Steve

    Dear Abhishek,  can you explain the step..in this step screen is comming but custom fields value is not coming and also likp table is not updated
    Correct AnswerRe: Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD
    Abhisek Biswas Jan 21, 2009 7:28 AM (in response to Stephen Keam)
    Hi Stephen,
    You can do it by using PBO and PAI modules of the screen that you created. But you have to transfer the data from subscreen to the BADI method TRANSFER_DATA_FROM_SUBSCREEN and aslo from method TRANSFER_DATA_TO_SUBSCREEN to the subscreen. This will update the screen field data to LIKP.
    You can aceive this by two ways.
    1) You can use EXPORT in method TRANSFER_DATA_TO_SUBSCREEN and then IMPORT the value in the screen PBO. And You can EXPORT data from screen PAI and IMPORT data in method TRANSFER_DATA_FROM_SUBSCREEN.
    2) Anither way to do it is by using Function modules and Function Group instead of EXPORT/IMPORT.
    Create a Function group. In the global data define a structure/Work Area of type LIKP.
    DATA w_likp TYPE likp.
    Then create two Function modules, one to export data and another to import data.
    Let us assume that the export FM takes in IS_LIKP as input and the import FM outputs the value of LIKP into ES_LIKP.
    Then pass the value is_likp to the export FM in the BADI method TRANSFER_DATA_TO_SUBSCREEN and in the screen PAI pass the LIKP data to the export FM.
    In the export Function module write the following code:
    MOVE is_likp TO w_likp
    Then in the Import FM write the following code:
    MOVE w_likp TO es_likp.
    The import FM is called from method TRANSFER_DATA_FROM_SUBSCREEN and from screen PBO.
    This will solve your problem.
    Regards,
    Abhisek.
    Alert Moderator
    Like (0)
    Reply

  • Comparing load times w/ and w/o BIA

    We are looking at the pros/cons of BIA for implementation.  Does anyone have data to show a comparison between loads, loads with compression, vs BIA Index time?

    Haven't seen numbers comparing load times.  Loads to your cubes and compression continue whether you have BIA or not.  Rollup time would be eliminated as you would no longer have the need to have aggregates.  No aggregates should also reduce Change Run time, perhaps a lot, or only a little, depending on whether you have large aggregates with Nav Attrs in them. All of that is offset to some degree by the time to update the BIA.
    Make sure you understand all the licensing costs, not just SAP's, but the hardware vendors per blade licensing costs.  Talked to someone just the other day that was not expecting a per blade licensing, list price of the license per blade was $75,000

  • How to display the color of time period and the legend in Calendar view?

    Hi,
    Sorry to disturb you guys with a quite simple question.
    I want to do a calendar view to display the period of absence for the portal user. I've setup the iView but it displays neither the color of time period nor the legend.
    The problem is:
    1) If I test with <i>static legend</i> (that is, I input the time period directly in the form instead of using data service),
       a) I could only define <b>one</b> time period, because it's impossible to map the <i>out</i> port of calendar to <i>in</i> port of form on defining the event as 'goto'.
       b) I can't see the color displayd while deploying although there is just one time period! Neither the legend. I' ve given the label and color of the legend and assigned the action as default in design board. Why it doesn't work?
    2) If I test with <i>dynamic legend</i> following the chapter "<i>Display Date on a Calendar</i>" in the <i>Modeler's Guide</i> of VC;
        I assigned @RECORDNR to 'ID legend field', and used BAPI_ABSENCE_GETLIST as dynamic legend data service to edit the legend, and assigned the color for every ID. But neither color nor legend could kindly appear. What's the problem? Is there any error in the edit of entry list of the legend?
    Please help me! Thanks!!!

    Is there any advice?
    I'll greatly appreciate your help!

  • NSDate, NSTimeInterval, Calculating time passed and Core Data

    I'm creating a timesheet/stopwatch application of sorts for the iPhone.
    I am using an NSDate in CoreData and following this pattern:
    1) Start:
    Session* session = (Session*)\[NSEntityDescription insertNewObjectForEntityForName:@"Session" inManagedObjectContext:managedObjectContext_\];
    session.startTime = \[NSDate date\];
    2) Calculate time passed and update label:
    NSTimeInterval timeDiff = -1*\[session.startTime timeIntervalSinceNow\];
    cell.textLabel.text = \[NSString stringWithFormat:@"%f", timeDiff\];
    I also see that I could use:
    NSTimeInterval timeDiff = \[\[NSDate date\] timeIntervalSinceDate:session.startTime\];
    cell.textLabel.text = \[NSString stringWithFormat:@"%f", timeDiff\];
    I don't like this since it is needlessly creating a lot of dates - and there could be 100s of these timers running at the same time ... or, does timeIntervalSinceNow possibly also create a new date evertime under the covers and I'm pre-optimizing or something too early. Can anyone suggest a better way to do this? For instance, initially, I was simply using NSTimeInterval:
    NSTimeInterval startTime = \[NSDate timeIntervalSinceReferenceDate\];
    NSTimeInterval endTime = \[NSDate timeIntervalSinceReferenceDate\] - startTime;
    But I end up struggling with the best way to manage this as part of a CoreData entity. Should I uses a double? or a Date? I understand that a Date is implemented as an NSTimeInterval but I can't assign or subtract an NSTimeInterval directly to my entity.date
    session.startTime = \[NSDate timeIntervalSinceReferenceDate\];
    NSTimeInterval timeDiff = \[NSDate timeIntervalSinceReferenceDate\] - session.startTime;
    Obviously, this won't compile when startTime is a Date object but I think it illustrates what I'm after. Trying to 'lightly' calculate time passed by using the start time assigned to an Entity. Maybe the original way is just fine. I'm just looking for suggestions. I guess I could try running this inside a profiler. As a side note, is there a better way to print the stopwatch output to the screen? It seems like overkill to constantly update a Label's text property ... hundreds, maybe thousands of times especially when there may be 10 or so timers running on the same screen. Does anyone have any advice for stopwatch type 'update the time' label behavior?
    I'm doing this in an NSTimer potentially set to fire every .01s ... IE: this method will get hit quite a bit ...
    Thanks.
    Message was edited by: LutherBaker

    LutherBaker wrote:
    I don't like this since it is needlessly creating a lot of dates - and there could be 100s of these timers running at the same time ... Can anyone suggest a better way to do this?
    That doesn't sound good. Why would you have so many?
    I'm just looking for suggestions. I guess I could try running this inside a profiler. As a side note, is there a better way to print the stopwatch output to the screen? It seems like overkill to constantly update a Label's text property ... hundreds, maybe thousands of times especially when there may be 10 or so timers running on the same screen. Does anyone have any advice for stopwatch type 'update the time' label behavior?
    I'm doing this in an NSTimer potentially set to fire every .01s ... IE: this method will get hit quite a bit ...
    That doesn't seem like a side note. That seems like the main point.
    As "good" video is typically around 30 frames per second, it doesn't make any sense to update the user interface any more frequently than that. Also, you really only need one timer. Let that timer update all the values. You may not need any timers. You could do everything via key-value coding and let the OS handle all the work.

  • Extending a network with Time Capsule and AirPort Extreme (via Belkin powerline)

    Hello -
    I've seen many topics about extending wireless networks here, but none seems to resolve the issue I'm having. I currently have a setup where a DSL cable modem is connected to a Time Capsule and I need to extend this network to another room using an AirPort Extreme.
    I live in a very old apartment in Brazil and the walls seem to block the signal from one room to another, hence the need to extend it. Since wireless signal is very weak between rooms, I bought a Belkin powerline AV500 so I could connect both Time Capsule and AirPort using the electrical power at home (just installing a regular Ethernet cable between rooms is not an option).
    I started with the basics: configure the Time Capsule + DSL as a standalone network, and it works perfectly within it's range. Then I connected the Belking powerline, plugged a MacBook via Ethernet on the other end and still got very good results (actually better speed than expected). Used it for a while with streaming and other network intensive tasks to make sure it could sustain the connection.
    Finally, pluggned the AirPort Extreme on the Belking powerline and this is where the problems started. AirPort Utility 6.3.1 only gives me the option of extending a network wirelessly - it doesn't seem to give me the option of extending it via Etherenet (roaming), which is not good in my case. Luckly I had a copy of AirPort Utility 5.6 which seems to do the job (or I thought so), but it's still not working well.
    Although I managed to configure both with the same name, it doesn't seem reliable and some devices (the iPhone 5, for example) are unable to connect and end up with a self-asigned IP address. I'm almost sure I'm doing something wrong on the setup, as I've seen a similar setup working before, so if anyone out there has any clue of what can be done, it will be much appreciated.
    Attached the screenshots of both Time Capsule and AirPort Extreme configurations.
    Thanks a lot,
    -TM
    AirPort Exteme:
    Time Capsule:

    Hello JuliaApple. Welcome to the Apple Discussions!
    You have several ways to configure both base stations for what you are trying to do.
    The simplest would be to configure the Time Capsule (TC) to "join" (AirPort Utility > Manual Setup > Wireless tab > Wireless Mode = Join a wireless network) your existing 802.11n AirPort Extreme Base Station (AEBSn). In this type of configuration the TC would perform as any other wireless client and not perform as a router. It will; however, still allow for both backups and sharing USB devices attached to it.

  • Chart dataTipFunction and loading data via HTTPService

    Hi everyone,
    I have a problem and I hope someone is able to give me a hint.
    I am using a chart with data points. At the moment I am using a datatipFunction in order to give each point a "tooltip".
    Now I need the ability to load some data via httpservice and display this as tooltip instead of the original value while being over a point.
    It is needede because of a lot of data and a continuous minimal change of its values. I don't want to reload every possible data. Only examined datatips should be updated.
    mouse over datapoint --> tooltip: "please wait, while updating" --> httpservice finished --> tooltip: "new data xyz"
    The datatip function only returns a string, that is displayed as tooltip. If the datatip function calls a httpservice, how can I update that tooltip text?
    Any ideas?

    Hi everyone,
    I have a problem and I hope someone is able to give me a hint.
    I am using a chart with data points. At the moment I am using a datatipFunction in order to give each point a "tooltip".
    Now I need the ability to load some data via httpservice and display this as tooltip instead of the original value while being over a point.
    It is needede because of a lot of data and a continuous minimal change of its values. I don't want to reload every possible data. Only examined datatips should be updated.
    mouse over datapoint --> tooltip: "please wait, while updating" --> httpservice finished --> tooltip: "new data xyz"
    The datatip function only returns a string, that is displayed as tooltip. If the datatip function calls a httpservice, how can I update that tooltip text?
    Any ideas?

  • Time Streams and Shipping Dates

    Hello,
    Does anyone have any documentations regarding time streams? I am checking on how time streams and determination of shipping dates such as loading date, pricing date, GI date, etc. are related.
    I noticed that when we run ZZTTSTR program from SAP which clears time stream handles, before we create order documents, somehow some order documents determine wrong shipping dates.
    We setup a background job to run ZZTTSTR daily every night and during the day we upload order files which converts to about 500-1000 order IDOCs and posted to be order documents.
    Now, i removed the backround job of ZZTTSTR and the issue never happened again. I'm looking for more info about time streams so I can determine how this caused my issue.
    I hope someone can help.

    You will get it within the window you were originally promised by Apple. If you get it early, bonus.
    There is nothing else anyone here can say about it.
    Speculation and rumor are prohibited by the Apple Support Communities Terms of Use.

  • Calling a new browser window with WD Abap and passing data via POST

    Hi there,
    does anybody know whether passing data via POST method is possible when opening a new browser window from within a Web Dynpro Component? In my case I use method IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW for opening a new browser window. Now I want to pass a big amount of data which is only possible via POST method. How can I achieve that or is it not considered inside the Web Dynpro Framework?
    Kind regards,
    Albert

    Hi Priya,
    can you please explain a little bit more what you mean? I didn't get it..
    Kind regards,
    Albert

  • Update Contract Start and End dates via BAPI_SALESORDER_CREATEFROMDAT2

    Hi Experts.
    We are successfully using BAPI_SALESORDER_CREATEFROMDAT2 to create sales order.
    Only problem is that the contract start and end date do not get updated.
    We are passing that in ORDER_HEADER_in-CT_VALID_F and ORDER_HEADER_IN-CT_VALID_T.
    After debugging, I found that there is one more table SALES_CONTRACT_IN in SD_SALESDOCUMENT_CREATE. Updating the values in that table works.
    But the problem is this table is not available in BAPI_SALESORDER_CREATEFROMDAT2. How to update Contract start and end dates from this FM ?
    I could not find anything in the search of this forums. So I guess this is not an issue and I am doing something wrong. Can someone suggest to me please?
    Thanks in adv.
    Aishi

    Are you creating a contract or a sales order?

  • How to acquire and read data before trigger?

    Hi, all:  
             I want to acquire a impluse signal, and the data when the signal begins is very important to me. So, I want to using a digStart trigger to acquire it, but then i'll lose what i want, maybe i can acquire it continuously, and use the trigger to start read the buffer after a delay(in order to wait the signal end), i don't know if there is any ANSI C functions I can use to do it in this way. I am using PCI6220, DAQmx9.02 and ANSI C.   If anyone have some info on this please let me know. thinks.

    Hi Cris Brown:
                   From your application,I suggest that you can use DAQmxCfgDigEdgeRefTrig function; define  pretrigger samples fitting for your application.
    Try it. Best Regard!

  • Firefox keeps history for more than the designated time period and opens automatically

    So i have two problems
    1)my firefox history options is set to only remember last 7 days but it doesn't delete after 7 days and adds this month and previous month.If i delete only this month the entire history is deleted.
    2)lately whenever my laptop goes to monitor switoff or when my computer starts up a firefox window opens automatically with no themes enabled nor any addons enabled.the home page of the firefox window is the firefox google search page..I also did a virus scan with kaspersky 2010.
    yelp!

    The setting Tools > Options > Privacy > History: "Remember visited pages for at least" refers to the number of days kept in memory (default is 90 days).
    Firefox 3 and 3.5/6 versions store pages in places.sqlite on disk for 180 days by default.
    See https://developer.mozilla.org/En/Places_Expiration
    You can look at these prefs on the about:config page.
    http://kb.mozillazine.org/browser.history_expire_days (180) (also affects saved form data)
    http://kb.mozillazine.org/browser.history_expire_days_min (90) (set via Tools > Options > Privacy > History: "Remember my browsing history for at least")
    For your other problem:
    See http://kb.mozillazine.org/Preferences_not_saved and [[Preferences are not saved]]
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • Time machine and wiki data recovery

    I'm running into an issue where I need to recover wiki data from a Time Machine back-up..
    The backstory:
    The wiki server was running on a 2008 Mac Pro which had an unrecoverable disk failure.  Given the age of the machine, the power it drew, and the fact that I dont need the horsepower of a macPro to host the wiki, I picked up a new Mac Mini to host the server data. It is a very low usage system, so the Mini should have all the power I need..  Not to mention its cost is over $2,000 less..
    I've been able to recover all the files I need from the Time Machine backup disk, except for the Wiki..     The last time I needed to do something like this was 10.6, and everything was in flat files, so it was a simple copy operation..  Now however it looks like there is a postgres database to deal with..  Being that I only have access to the files on the TM backup, Im not sure how to recover the wiki.
    My thought was to simply to a TM restore, but because Im going from a MacPro to a MacMini, it barks that its a different hardware type and will not complete the restore..
    So the end question is, has anyone ever had to recover an Apple wiki, from a Time Machine backup disk, running 10.8, with the destination being a Mac Mini?  If yes, how did you overcome not running the postgres database?
    Thanks..

    Restore these items, then reboot:
    /Library/Server/PostgreSQL For Server Services
    /Library/Server/Wiki

  • I want to create a formula showing me the days in a certain time period and multiplying that by a price.

    I am creating a spreadsheet with renting prices for each month. and need help on the formula below.
    Basically, I want to add up a total base rate for the nights people are staying. Can you please help me out with this?

    Hi Caleb
    Well, to begin with, if John checked out on December 1, he didn't stay any nights in November.
    The formula is is bit involved due to the rate change. The version below handles this with a pair of IF statements that check to see if check in and check out occur in the same month.
    If not, the first calculates the charges for the number of nights stayed in the check in month, and the second calculates the charges for the number of days stayed in the check out month. (E2)
    If check in and check out occur in the same month, then the first calculates the charges for that month, and the second returns a null string ( "" ). (F2)
    The results of these calculations, and the fixed booking fee (included in the formula, not gathered from Table 1), are summed in the next cell. (G2)
    Formulas:
    All are in Table 2, and are filled down their respective columns after being entered in the indicated cell.
    E2: =IF(MOD(MONTH(D2)-MONTH(C2),12)=0,DATEDIF(C2,D2,"D")*VLOOKUP("unit "&B2,Table 1 :: $A:$N,MONTH(C2)+2,),DATEDIF(C2,EOMONTH(C2,0)+1,"D")*VLOOKUP("unit "&B2,Table 1 :: $A:$N,MONTH(C2)+2,))
    F2: =IF(MOD(MONTH(D2)-MONTH(C2),12)=0,"",DATEDIF(EOMONTH(C2,0)+1,D2,"D")*VLOOKUP("u nit "&B2,Table 1 :: $A:$N,MONTH(D2)+2,))
    G2: =SUM(E2,F2,60)
    Note:In the present form, the formulas will correctly handle checkin/checkout dates in the same month or in two consecutive months (eg. November/December, December/January, etc.) but are not capable of determining the correct date for the rate change where the stay extends across two month ends.
    The formulas could be combined by substituting the first and second (without their = signs) into the third, replacing "E2" and "F2" respectively. Writing them in that form originally makes for more chances to make an error, and makes the whole formula more difficult to read.
    Details on each of the functions used may be found in the iWork Formulas and Functions User Guide, which you may download via the Help menu in Numbers '09.
    Regards,
    Barry

  • Report on Real Time Cube and Master data

    Dear Experts,
    I am new to BI. I have created real time cube using some characteristics and top of that I built 3 reports with referring to Master data.
    And in the 3 reports, I have used different characteristics for all the report expect one ( common in all the reports).
    Now I have to create consolidated report using all the characteristics. I have build some sample reports but getting not assigned where there is no data.
    How can I achieve this?
    Thanks in advance,
    Saravanan R

    Hi suman,
    Thanks for your reply .
    I have attached the screen shot of the output. I have created the Infoset using info objects and real time cube, on top of that I have created query.
    this is the problem am facing can please suggest on this .

Maybe you are looking for

  • Adding DTS-MA soundtrack to an mpeg 4 video file

    Cross-posted from Audition forum which directed me here. As a personal project I am attempting to take some high definition videos (1080P) with low definition sound and bump the sound up to at least CD quality in Premiere via mpeg4 files.  For exampl

  • Audio disconnected

    I am trying to move a project to an external disc and the audio seems to have become disconnected from the project. Is there a way to re-connect it? The audio files are still on the hard drive but I get the warning that they are missing when I try to

  • Problem printing Dos-based program in Netware 4.11 environment.

    I hope someone has a clue what could be wrong with this workstation: One pc in our Netware 4.11 network has a network-printing problem. When this pc tries to send a document to the networkprinter ( HP 8150 ) , he receives an error-message. "The syste

  • Setting up a JDBC Driver.

    Hi, I'm trying to setup a database to interact with my Java code. I'm new to databases and I don't know where to start. I'm using Java 2 SDK 1.4.0 with JAI 1.1.2. Can anyone point me in the right direction? I have seen the tutorial on the sun website

  • Can I transfer a video disk

    Can I transfer a video disk from my IMAC to my IPAD 4? I own the video.