Scheduling process chain in 1st and last of the month

Hello ,
Can some one help in scheduling the process chain at the starting of the month and the end of the month ?
The chain has to start on 1 st and 28th of every month.
Help me with the informations please!
Points will be assigned!
Thanks in Advance
Ram!

Have your process chain to start "After event". Then create an ABAP program to call function module BP_EVENT_RAISE. There are numerous postings in this forum on how to do this.
Next create two monthly jobs (one scheduled on the 1st and the other on the 28th) using SM36, and the only step in the job is to call the program to trigger (raise) the event. By triggering the event, your process chain will execute.
Check these links:
Re: scheduling process chain 3 specific times a day

Similar Messages

  • Modifiying, Transporting and Scheduling Process Chain

    Hello ALL,
    i have to create a new process chain for a delta Load and put this process chain in a big existing Meta Chain, after i have to transport to Quality System.
    if i control the difference between Dev and Quality system to have an idea i see that the Infopackages in Dev have the execution tab: Load Data Immediately without job: BI_BTCH
    in Quality some Infopackages have execution tab: run successively in batch with job like this:
    BI_BTCH LX6CW08S1ICM04I4O06KOPL
    can you tell me please in detail how should i complete this activity:
    - wich type of control should i do before creating and modifiying process chain in DEV and Quality
    - how should i do to control in Quality the scheduling of a process chain
    - if i modify a process chain in DEV and after i will transport in Quality what will be the affect in Scheduling, the scheduling will be the same without problem or i have to schedule again
    - in generale how can i schedule a process chain, wich transaction and how in detail
    Thanks a lot for your help
    Bilal

    Hi Bilal,
    1) EVENT: When you want to have a process chain 'A' to be started after completion of a process chain 'B' or any process in process chain 'B' we can use this event.  These two chains can also be from different BI systems.  Like Chain 'A' could be from one production system and Chain 'B' could be from different production system.  As soon as the chain A finished an event will be triggered and this event will trigger the chain B.  The start time of chain B might differ because it depends on the completion of chain A. To schedule a process chain using an event, Go to Tcode: RSPC look for your chain. Switch to change mode. Right click on the start variant and select maintain variant. Click on "change selections. click on "after event," give the event name in the slot and select the periodic job.
    2) RUN JOB PERIODICALLY: When you want to have the chain run for more than once periodically we select this option.  Suppose, chain B has to run after completion of chain A periodically we have to use this option.  If you do not check this option, your chain B will run only once when the event is triggered after completion of Chain A.  From the next time onwards, it not run even the event is triggered.
    3) JOB: For every process when it runs a job will be created assainging it to a work process in the system.  Similarly, when the chain starts a job will be created containing the log of the run.  Also, in the scheduling options of a process chain, you can have your process chain started after completion of a particular job in the system (ex: an attribute change).  For this, Go to Tcode: RSPC look for your chain. Switch to change mode. Right click on the start variant and select maintain variant. Click on "change selections. click on "after job" give the job name in the slot and save the settings.
    4) SCHEDULING PROCESS CHAIN: Means to make settings to a process chain so that it will run on a periodic basis at a certain time.  If you want to start a chain immediately, you will choose the option immediately and trigger it.  It will run for only once.  But, if you want to have your chain run everyday at 7:00 am in the morning, you have to schedule it using the scheduling options as below:
    In Tcode: RSPC look for your chain. Switch to change mode. Right click on the start variant and select maintain variant. Click on "change selections." Click on Date/Time button. Give the start date and time in the Scheduled Start slots. (Ex: 09-04-2009, 7:00, to have the chain run at 7:00 everyday starting from tomorrow). Tick the check box Periodic job in the bottom and click on "periodic values" button and select the option as daily and save it. Then click on "Restrictions" button to specify the factory calander. The Tcode for calander is SCAL, where you can see all the factory calanders in the system and you can choose that suits your requirement. Save the changes and navigate back to process chain maintaince screen and click on "Schedule" button.
    Now your chain is automated for trigger

  • How to schedule Process chains in Bi Admin Cockpit

    Hello friens,
    I am working on installing Bi cockpit.
    After installing the info providers, i have to schedule the process chains for Bi admin Cockpit.
    I know the transaction is RSPC.
    But I dont know how to schedule process chains for Bi admin cockpit.
    How to schedule Init and Delta
    If you can send me step by step documents.
    Or any good sap note number.
    Or any good links i will really apreciate it.
    I want to schedule process chains
    Content Master Data
    Data Load Statistics # Delta
    Data Load Statistics # Init
    Query Runtime Statistics # Delta
    Query Runtime Statistics # Init
    System Master Data
    Please advise

    Hi,
    Please check out this document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    Hope it helps.
    Thanks
    Mona

  • How to check the scheduled process chain in SM37

    Hi Experts,
    Can anyone tell me how do I check whether my process chain has been scheduled or not.
    I checked in sm37 all the jobs that are under released status. Im getting about 10 jobs.
    I dont know which one is belogs to my process chain as they do not have the process chain names.
    Can anyone please let me know how do I confirm whether one of the released jobs below to my process chain.
    Thanks in advance.

    Hi,
    To find this out, in sm37, select the job and click on step button in toolbar. You would find the program name RSPROCESS.
    Click on this job and then go to menu bar and select goto-> variant.
    In the variant, you can see the process chain that has been used for this job.

  • UNCAUGHT_EXCEPTION with msg CX_RSR_X_MESSAG while scheduling Process chain

    Hi Gurus,
    We are facing a short dump while scheduling process chains, as follows:
    <BR><BR>
    Runtime Errors         UNCAUGHT_EXCEPTION
    Exception              CX_RSR_X_MESSAGE
    <BR><BR>
    Error analysis
        An exception occurred which is explained in detail below.
        The exception, which is assigned to class 'CX_RSR_X_MESSAGE', was not caught
         and
        therefore caused a runtime error.
        The reason for the exception is:
        No text available for this exception
    <BR>
    Information on where terminated
        Termination occurred in the ABAP program "SAPLRRMS" - in "RRMS_X_MESSAGE".
        The main program was "RSPC_MAINTAIN_SINGLE ".
        In the source code you have the termination point in line 82
        of the (Include) program "LRRMSU13".
    <BR>
    We tried to schedule it as a remote process chain from some other system it cancelled the job there with an ERROR_MESSAGE. We checked the RFC Connections at the source system side but it is working properly. We then tried to schedule the chain manually, we had this exception. Then we tried to have a look at previous logs of the process chain. It had this exception. We tried to reactivate the chain it was successful but when tried to schedule the chain same issue again. We tried to run the Meta chains under the same chain separately. They too gave us the same exception.
    Please help.
    Regards,
    Sourabh Deo

    S Simran wrote:
    Hi,
    >
    > Ours is a fresh installation..
    >
    > When i am loading for the first time till PSA it is successful..
    >
    > As HR data sources are 3.5 datasources, i am loading cube via infopackage..
    >
    > When i start the load to cube it is giving me dump with exception CX_RSR_X_MESSAG.
    >
    > i checked note  615389 which talks about "buffering of number range object BIM9999998".  the 0REQID is not buffered, but it does not throw any error msg in RSRV to correct the error..
    >
    > and one more note 1157796 which talks about patches with version BI 7.0.
    >
    > Now we are in BI 730 with heighest level 0005.
    >
    > Not sure how to solve this error
    >
    > Any ideas?
    What's your SP? Are you having any master data updates left unattended? Check the Master data objects, check the flows. Related SAP Notes : 914304 / Check 967202(SP10) and 998673(SP11), 1157796, 763203 and 615389
    Edited by: Arun Bala G on Feb 12, 2012 9:50 PM

  • How to know the process chain start time and end time

    Hi Experts,
                   How to know the process chain start time  and end time .
    Thanks in advance
    Regards
    Gutti
    Edited by: guttireddy on Feb 23, 2012 11:30 PM

    Hi Reddy,
    You may find the run time of a PC using below steps.
    1. Call SE38 > /SSA/BWT > Execute  > Enter your PC , choose the date and time > Execute. Here Run-time of a PC is displayed. (or)
    2. Call RSPC1 > Enter your PC > Execute > Goto Log view > Right click on the start Variant > Displaying Messages > Note down the start time in Chain Tab. Now Right click on the last Process type of the PC > Displaying Messages > Note down the End time in Chain Tab. The Difference b/w start time and end time gives the Run-time of your PC.
    Hope this helps.
    Regards
    Sai

  • Process Chain Failed at "AND" stage!!!!

    Hi Experts,
    Could any one guide me the steps to rectify the Process chain failure at AND stage???
    Steps:
    1.Start
    2.Data loads(9)
    3.AND(failed here)
    Error message:This AND process is not waiting for event RSPROCESS, parameter 3VW29DJ1PBX67PFJHD5IAEYI1     E

    We encountered a similar error.  Actually it wasn't an error, the process chain just stopped at the AND process and did not continue.  We are on BW 3.5.  I believe there is are OSS Notes for this.  See 1005481 or 1003941.
    If this is not the case, try to reschedule the process chain.  To remove from scheduling:
    1.  select Process Chain -- Remove from Scheduling.
    2.  Activate and Schedule process chain
    We did not install the notes (above) and rescheduling did not work for us.  We ended up changing and tranporting the process chain again and we were fine.
    Hope this helps.

  • How to schedule process chains to be run on certain dates contained in DSO

    Here is what I am trying to do.
    We have a set of objects that need to be loaded with data, however they have to be loaded only on certain dates.
    We are using process chains. What I would like to do, is to automate this load.
    Essentially, I am thinking that I need to create some kind of event/service on the BW side that will sit and listen by comparing the system date to a set of dates defined in one of the DSOs containing data on Academic Calendar.
    For example, the process chain should only start when the system date is = to the beginning of academic subsession date defined in one of the DSOs called Academic Period. Once the execution happens, then the event/service would sit and listen until the next time system date is = one of the dates in that DSO.
    I am looking into the detailed steps in how this automation could be accomplished.
    Thank you

    did this once a long time ago...other kind of requirement but the principle is the same.
    create a program_1 that updates table TVARV.
    you need a selection screen with a paramter 'run_pc_2' and an input field for 'X' or ' '.
    when you need to run chain2, you run this program and put X in the input field and run the program to update TVARV.
    after the run of the process chain you run the program again and put ' ' in the input field.
    create a second program_2 that reads this entry in table TVARV. If 'run_pc_2' = 'X' then you trigger event1. else you trigger event2.
    create two process chains.
    1/  PC1PC2PC4
    2/ PC1PC3PC4
    the first process chain is to be scheduled by event triggering after event1.
    the second one is to be scheduled by event triggering after event2.
    schedule program_2 to run daily.
    the program will now check the entry in table TVARV and will trigger the corresponding process chain.
    i hope it's clear what i mean to say.
    M.

  • Process Chain hangs on AND process

    Help Super gurus!
    I've tried several versions of a chain that loads multiple InfoPackages serially then multiple DTP in parallel using filtering from the PSA to a DSO. All load successfully. Then I have the DTPs all meet at an 'AND' process before processing should continue to a cube.
    The 'AND' process also shows green but it does not continue to the next process step. It just stops there, no more jobs running, no yellow, nothing. It thinks it's all done, everything after that is still blue.
    Why does it hang there and what can I do to get it to continue?
    Thanks,
    Al
    Points available.

    Hi,
    Not sure what is the root cause in your case.
    Try this. It may work. Normally this is done after a step turns red and no repeat is available.
    Method 1 (when it fails in a step/request)
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    How is it possible to restart a process chain at a failed step/request?
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
    Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
    Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
    Thanks,
    JituK

  • IPhoto 11 Book 1st and last page errors

    When previewing my completed book, the 1st and last page have white lines going through them.
    How can i fix this so I can buy it.
    Thanks

    Boot into  Safe Mode and preview the book.  If the first and last page photos are OK order the book from the Safe Mode.  It's a problem others are having and worked around it with the Safe Mode boot.
    Be sure to report it to Apple via http://www.apple.com/feedback/iphoto.html.
    OT

  • Process chains time outs and hangs with no error msg - in SP13

    Hi all,
    We are having all kind of weird problems after we patched our system with SP13. Our process chain time outs and hangs, but surprisingly we never get any error msg. And scarier part is, the problem seems to be intermittent. PC runs fine on some days and hangs on some.
    Further analysis into the dump – as below
    Termination occurred in the ABAP program "SAPLRSSM" -
    in "RSSM_SLEEP_DEBUG".
    The main program was "SAPMSSY1 ".
    In the source code the termination point is in (Include) program "LRSSMU39".
    This refers to an issue that appears to have been addressed by OSS Note
    934648(meant for SP8). This notes also indicates to populate RSADMIN table to
    exclude "RSSM_SLEEP_DEBUG". Not sure if this note is valid for SP13? However we went ahead and populated the RSADMIN table.
    So now we have no clue what’s going on and where to fix the issue.
    As per SAP suggestion we applied the following notes:
    0000653996  Analyzing lock situations
    0000893563  Correction: Deadlock on completion of a remote chain
    0000994007  Corrections: Deadlock with external status query
    0001005481  Correction: Process successful, but there is no instance
    0001047174  Correction: Incorrect scope when locking in process chains
    0001051957  Correction: TIME_OUT during dialog confirmation of processes
    0001083660  Report for error stack analysis
    Nothing seems to help us. And SAP suggested a few options, which we implemented to no rescue.
    I’m sure that many of the customers have applied SP13, and want some feedback from them, if this is happening in their systems too?
    If so, how did you fix this issue?
    Or this situation is unique to us?Please note that no settings were changed as of SP13 to that of what they were in SP12(unless it is a side effect of the patch itself). Everything worked fine with SP12 and is still working on the BIP system. All the problems are in BIQ patched to SP13.
    Any pointers or insight would be appreciated. We have a customer msg open with SAP, and going back and forth, but nothing seemed to work as of today.
    Thanks,
    Voodi

    Not sure which OSS helped us get past the issue, as SAP asked us to apply a ton of notes. But along which the notes, SAP has some suggestions for us, which we think did the magic. After the implementation of the suggestin we never faced the same issue again. The suggestion by SAP:
    move the process chain callback in a batch job by executing
    program RSSM_TRACE_SWITCH and selecting the flag "verifcation
    of asynchronous processes - execute in batch".
    Lemme know if this doesnt fix the issue, I can give all the notes that SAP asked us to apply.
    Message was edited by:
            voodi

  • Cannot close tabs in Firefox 4 - only able to access 1st and last tab...nothing in between

    As the title says... even if I hover over tabes between 1st and last tabes adn right click, 'close tab' still doesn't close

    nearly. when there are 2 tabs, when I move mouse over the second tab's closing X, OR the new tab opener + near it, it doesn't highlight so I cannot click on them although the area where I can click can be found a bit left for the X and a bit right for the +. If there are more tabs open, only the second tab's closing problem stays, the new-tab-opener's goes. /default theme/

  • Process chain failed at  AND process type ?

    hi all .
    Process chain failed at  AND process type ?
    and it is giving  message      Job cancelled after system exception ERROR_MESSAGE     .
    what is the reason & solution .
    regards ,
    srinivas ,

    Hi,
    That depends on the system behaviour... There is no issue in that... You can repeate the process.. If there is no repeat option available then you can on the detail view.. there is a chance that you will get a repeat option there.. If not then copy the chain.. remove the loaded process and add one starter chain an continue the chain in immediate mode...
    Regards
    Sajid khan

  • Error: ORA-01847: day of month must be between 1 and last day of month

    Hi,
    I am getting this ORA-01847: day of month must be between 1 and last day of month type of error but I have checked my data all are correct.
    I am inserting the data in the merge query. It is giving the above error.
    but when i insert the data like that
    insert into dt(start_date) select TO_DATE (tariff_start_date, 'DD/MM/RRRR') from ext_zpp0a871;
    It does not give any error.
    Please find the below code
    DECLARE
    l_sv_error_msg VARCHAR2 (1000);
    BEGIN
    FOR i IN (SELECT condition_type, sales_org, division_channel, division,
    price_list, ean_upc, amount, unit_of_measure1,
    tariff_start_date, tariff_end_date
    FROM ext_zpp0a871--This is external table
    WHERE condition_type = 'ZPP0' AND ROWNUM < 200)
    LOOP
    BEGIN
    MERGE INTO sap_tariff st
    USING (SELECT i.price_list pl, i.ean_upc upc,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR') tsd,
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR') ted
    FROM DUAL) du
    ON (st.prod_ean_cuni = du.upc
    AND st.pricelist = du.pl
    AND st.tariff_start_date = du.tsd
    AND st.tariff_end_date = du.ted)
    WHEN MATCHED THEN
    UPDATE
    SET st.condition_type = i.condition_type,
    st.sales_org = i.sales_org,
    st.division_channel = i.division_channel,
    st.division = i.division,
    st.amount =
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    st.uom = i.unit_of_measure1
    WHEN NOT MATCHED THEN
    INSERT (condition_type, sales_org, division_channel, division,
    pricelist, prod_ean_cuni, amount, uom,
    tariff_start_date, tariff_end_date)
    VALUES (i.condition_type, i.sales_org, i.division_channel,
    i.division, i.price_list, i.ean_upc,
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    i.unit_of_measure1,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR'),
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR'));
    /*INSERT INTO sap_tariff
    (condition_type, sales_org, division_channel,
    division, pricelist, prod_ean_cuni,
    amount,
    uom,
    tariff_start_date,
    tariff_end_date
    VALUES (i.condition_type, i.sales_org, i.division_channel,
    i.division, i.price_list, i.ean_upc,
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    i.unit_of_measure1,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR'),
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR')
    EXCEPTION
    WHEN DUP_VAL_ON_INDEX
    THEN
    UPDATE sap_tariff
    SET condition_type = i.condition_type,
    sales_org = i.sales_org,
    division_channel = i.division_channel,
    division = i.division,
    amount =
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    uom = i.unit_of_measure1;
    WHEN OTHERS
    THEN
    l_sv_error_msg := SQLERRM (SQLCODE);
    INSERT INTO sap_tariff_log
    (date_of_load, condition_type, sales_org,
    division_channel, division, price_list,
    prod_ean_cuni, amount, uom,
    tariff_start_date, tariff_end_date,
    rejection_reason
    VALUES (SYSDATE, i.condition_type, i.sales_org,
    i.division_channel, i.division, i.price_list,
    i.ean_upc, i.amount, i.unit_of_measure1,
    i.tariff_start_date, i.tariff_end_date,
    l_sv_error_msg
    END;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_sv_error_msg := SQLERRM (SQLCODE);
    neo_pro_log ('Others Error', l_sv_error_msg);
    END;

    user13400510 wrote:
    but when i insert the data like that
    insert into dt(start_date) select TO_DATE (tariff_start_date, 'DD/MM/RRRR') from ext_zpp0a871;
    It does not give any error.Maybe the error is on tariff_end_date instead of tariff_start_date ?
    What are the datatypes of tariff_start_date and tariff_end_date ? If they are already dates, and you to_date them (and depending on what your nls_date_xxxxx params are) you can have such errors :SQL> sho parameter nls_date_format
    NAME_COL_PLUS_SHOW_PARAM                 TYPE        VALUE_COL_PLUS_SHOW_PARAM
    nls_date_format                          string      DD/MM/YYYY
    SQL> select to_date(sysdate,'Day dd Mon RRRR') from dual;
    select to_date(sysdate,'Day dd Mon RRRR') from dual
    ERROR at line 1:
    ORA-01846: not a valid day of the week
    SQL> select to_date(sysdate,'hh24:mi:ss dd/mm/rrrr') from dual;
    select to_date(sysdate,'hh24:mi:ss dd/mm/rrrr') from dual
    ERROR at line 1:
    ORA-01850: hour must be between 0 and 23

  • ORA-01847: day of month must be between 1 and last day of month error

    Hi All
    When i run the following code i'm getting the error:ORA-01847: day of month must be between 1 and last day of month error
    SELECT t2.owner_cat,
    t1.owner_id,
    stock_id,
    Sum(received_amount) received_amount,
    Sum(curr_amount) curr_amount,
    Sum(used_amount) used_amount,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM (SELECT owner_id_to owner_id,
    stock_id_to stock_id,
    Sum(full_amount) received_amount,
    0 curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_transfer
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id_to,
    stock_id_to
    UNION ALL
    SELECT owner_id,
    stock_id,
    0 received_amount,
    Sum(curr_amount) curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id
    UNION ALL
    SELECT t2.owner_id,
    t1.stock_id,
    0 received_amt,
    0 curr_amt,
    Sum(amount) used_amt,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM dw_wms_wo_mat_dc t1,
    (SELECT owner_id,
    stock_id
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id) t2
    WHERE t1.stock_id = t2.stock_id
    GROUP BY t2.owner_id,
    t1.stock_id,
    To_char(Add_months(date_work,6),'YYYY')) t1,
    dw_wms_setup_owner t2
    WHERE t1.owner_id = t2.owner_id
    GROUP BY t2.owner_cat,
    t1.owner_id,
    stock_id,
    To_char(Add_months(date_work,6),'YYYY')
    But when i just run the inner query:
    (SELECT owner_id_to owner_id,
    stock_id_to stock_id,
    Sum(full_amount) received_amount,
    0 curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_transfer
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id_to,
    stock_id_to
    UNION ALL
    SELECT owner_id,
    stock_id,
    0 received_amount,
    Sum(curr_amount) curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id
    UNION ALL
    SELECT t2.owner_id,
    t1.stock_id,
    0 received_amt,
    0 curr_amt,
    Sum(amount) used_amt,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM dw_wms_wo_mat_dc t1,
    (SELECT owner_id,
    stock_id
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id) t2
    WHERE t1.stock_id = t2.stock_id
    GROUP BY t2.owner_id,
    t1.stock_id,
    To_char(Add_months(date_work,6),'YYYY'))
    I'm not getting that error, any help please?

    Hi,
    Like Anuraq already explained, you need to keep in mind that when you apply a to_char, you've turned your DATE datatype into a STRING and by doing that you've lost the ability to use the add_months function again in your outer query.
    Using a simplified example, extracted from your example:
    MHO%xe> select to_char(add_months(date_work, 6), 'yyyy') date_work
      2  from ( select to_char(0) date_work
      3         from dual
      4         union all
      5         select to_char(0) date_work
      6         from dual
      7         union all
      8         select to_char(add_months(sysdate, 6), 'yyyy') date_work
      9         from dual
    10       );
    select to_char(add_months(date_work, 6), 'yyyy') date_work
    FOUT in regel 1:
    .ORA-01847: day of month must be between 1 and last day of monthHowever, you should either do something like:
    MHO%xe> select nvl(to_char(add_months(date_work, 12), 'yyyy'), '0') date_work
      2  from ( select to_date(null) date_work
      3         from dual
      4         union all
      5         select to_date(null) date_work
      6         from dual
      7         union all
      8         select sysdate date_work
      9         from dual
    10       );
    DATE
    0
    0
    2010or (less clear, more confusing):
    MHO%xe> select nvl(to_char(add_months(date_work, 6), 'yyyy'), '0') date_work
      2  from ( select to_date(null) date_work
      3         from dual
      4         union all
      5         select to_date(null) date_work
      6         from dual
      7         union all
      8         select add_months(sysdate, 6) date_work
      9         from dual
    10       );
    DATE
    0
    0
    2010It's not clear to me why you're using add_months twice (inner + outer query) in your original example.
    As you can see you can get the same results using it only once in your outer query.

Maybe you are looking for

  • How can I transfer the root account on my computer to a regular account?

    Not sure if this in the correct category, but anyway... Back in October 2010, I installed a Java update or something on my regular account, and it broke the account for some reason. I had no other account to use except for the root user that I enable

  • Hard drive issues..help

    Hi, I replaced my original drive back in november 2009 with a western digital scorpio black..the thing just died on me. Wasn't making any noises as i've experienced in the past so I tried doing disk utility via snow leopard's install disk. The disk (

  • How to list files from .jar file in applet?

    I have created applet and export all files to .jar file. I use File.list() method in applet to list files from one directory and that works ok but if I try to do that from web browser it sends exception AccessDenied meaning that File.list() isn't all

  • External hyperlink to specific place in a PDF file?

    Is it possible to have an external hyperlink on a webpage to a specific place in a PDF file? If so, how is it done? I would be creating the PDF file in InDesign. Thanks

  • Embedded CRXI in Websphere running on iSeries - Error

    Hi, I have been using the new CR4E that I downloaded and installed on Websphere toolkit in windows. My reports have been working in my developement WAS server 6.1 & can export to PDF. But after deploying to my production WAS 6.1 server, I could not a