FM CRM_PRIDOC_READ_OW works in source system but not when executed from BW

Hello All,
I have extended an extractor in the source system by adding additional fields.
One of the FM I've used is CRM_PRIDOC_READ_OW. When I run an extraction test in the source system eveything works and data does populates into the new fields.But when I run the infopackage from the BW side, I get an error message which saids the transaction has been terminated. I've been able to trace and pinpoint the possible cause of the error. When I do not call this FM, the infopackage finishes but I do not get data for the new fields and when I do call this FM, I get the error.
Has anyone experiance this issue before?
Your assistance will be much appreciated. Here is a portion of the code I wrote:
  loop at I_TABLE into l_s_ZASCRM_OPPT_I.
    lv_guid = l_s_ZASCRM_OPPT_I-GUID.
    lv_item_guid = l_s_ZASCRM_OPPT_I-ITEM_GUID.
    call function 'CRM_PRIDOC_READ_OW'
      exporting
      iv_header_guid = lv_guid
      importing
      ES_PRIDOC = ls_pridoc.
    loop at ls_pridoc-PRIC_COND into ls_pric_cond.
      if ls_pric_cond-kposn = lv_item_guid.
        case ls_pric_cond-STUNR.
          when '40'.
            l_s_ZASCRM_OPPT_I-zz_gpm_ttl_i = ls_pric_cond-kwert.
          when '55'.
            l_s_ZASCRM_OPPT_I-zz_gpd_ttl_i = ls_pric_cond-kwert.
          when '60'.
            l_s_ZASCRM_OPPT_I-zzfy_sp_i = ls_pric_cond-kwert.
          when '70'.
            l_s_ZASCRM_OPPT_I-zzfy_gpm_i = ls_pric_cond-kwert.
          when '80'.
            l_s_ZASCRM_OPPT_I-zzfy_gpd_i = ls_pric_cond-kwert.
        endcase.
      endif.
    endloop.
    append l_s_ZASCRM_OPPT_I to l_s_ZASCRM_OPPT_Itab.
    clear l_s_ZASCRM_OPPT_I.
  endloop
Thanks,
Jeff

Hello Geo!
Thank you for your question. I think we mapped all the systems you show. Always the same error. Concerning your systems my transport log would say:
Source system R3DEV does not exist
We mapped this.
Any ideas? Is there maybe something in customizing to do what could be forgetten? The system is newly connected and there have never been a transport compounded to this source system before.
Best regards,
Peter

Similar Messages

  • Wifi works at home but not when away from home

    My Wifi works at home but not when away from home, what is wrong?  I thought with a phone plan I didn't need to have a wifi connection.

    You either need WiFi or Cellular (or both). If you have neither, you can't connect to the internet.
    Most people use WiFi at home and Cellular while away from home, or connect to public WiFi networks where there are some.

  • Fixed headers while scrolling works fine in bids but not when deployed to reportserver

    Hi, I am using SQL Server 2008 R2 & deploying a report to reportserver with fixed headers while scrolling, this works fine in bids but not when deployed to reportserver. We are IE 9.
    Thanks in advance...............
    Ione

    Hi ione721,
    Since you have identified the 2 xml files are identical, according to my knowledge, there maybe a compatibility issue with IE 9 and SSRS 2008 R2, so I suggest that you could run the report in compatibility mode. Please make sure you have turned on Compatibility
    View in Internet Explorer 9 by following steps:
    When Internet Explorer recognizes that a webpage is not compatible, you will see the Compatibility View button on the Address bar. Try clicking it.
    When Compatibility View is turned on, the button changes from an outline to a solid color when you view the page.
    The following screenshots are for your reference:
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • Vi works in LabVIEW, but not when executed by TestStand.

    Hi everybody.  I'm using LabVIEW 8 with the Sound and Vibration
    Toolkit, and TestStand2.  I am planning on using TestStand to
    execute a series of performance tests on an audio processing
    board.  When run independently, the vi (which I have attached
    here) runs correctly, and returns a value for the parameter being
    tested.  In this case it is SNR.
    However, when executed by TestStand, the vi seems to run correctly, but
    returns a value of "NaN".  This causes TestStand to fail the test.
    Does anybody know what is going on here?  I've checked FAQs and
    help files, etc...  Why would the vi work on its own but not in
    TestStand?
    Thanks.
    Brett Gildersleeve
    Attachments:
    SingleChannelSNR.vi ‏173 KB
    Test Sequence.seq ‏15 KB

    Hi Ray,  Thanks for the reply.
    Basically, when I run the VI on its own, I see the SNR value appearing
    both in the SNR indicator and in the Test Data Out cluster under
    Numeric Measurement.  The rest of the indicators are empty
    (string, report text, status, code, source).  My waveform graph
    shows an FFT of the signal.
    However, when running the exact same VI through TestStand, I get NaN as
    the output.  The FFT of the signal is NOT displayed in the
    waveform graph...  strange.  No errors are received.
    In order to make it easier to debug, I replaced all of the analysis functions
    with functions included in LabVIEW 8.  Now everybody should be
    able to run it.  I do a simple THD test this time around.  With the VI running
    on its own, I get a value of 1.8 as the THD and the Numeric Measurement of Test Data
    Out.  However, whenever running the test with TestStand, I get a
    value of NaN.
    Same problem.
    Any suggestions?
    By the way, what exactly do you mean by "wiring
    up the Error cluster and feed in to the Error Out."?  I'd
    like to try it out, but I'm not sure exactly what you mean.  I
    already have the Error out cluster wired up, I think.
    Message Edited by TheSleeve on 05-22-2006 12:12 PM
    Attachments:
    SingleChannelTHD.vi ‏159 KB
    Test Sequence2.seq ‏15 KB

  • Podcast - works on iTunes page but not when subscribed

    Hi, I produced my podcast, submitted the feed through iTunes store and was validated. However, it happens so that people can listen to the podcast on iTunes page but not when they subscribe to it and try to download. error points to URL issues apparently. Help.

    It works perfectly well for me. On subscribing I saw all three episodes and downloaded and played Episode 2 without any problems. The only explanations I can suggest are that either some of your subscribers are having some sort of technical issue at their end: or that your server is intermittently sulking and failing to respond to requests. Try playing the episode from this link a few times on spaced-out occasions and see whether you ever get a failure:
    http://thecricketcouch.com/CouchTalk/CouchTalk-AntSims-SanaKazmi-062611.mp3

  • Load swf works in Publish Preview but not when published

    Hi Folks,
    I having a problem where im trying to load two 1mb SWF movies into my Flash piece. It works fine in Publish Preview but not when I finally publish. I get this error in IE:
    SecurityError: Error #2000: No active security context.
    I have googled around and there is some talk online of a hack where by you get a timeout to overcome this. However im not so technical do I dont really know how to do this to my code in AS3. My code at the moment is below.
    Any help would be much appreciated and rewarded with Karma
    movieClip_12.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_9);
    var fl_Loader_9:Loader;
    //This variable keeps track of whether you want to load or unload the SWF
    var fl_ToLoad_9:Boolean = true;
    function fl_ClickToLoadUnloadSWF_9(event:MouseEvent):void
    if(fl_ToLoad_9)
      fl_Loader_9 = new Loader();
      fl_Loader_9.load(new URLRequest("search.swf"));
      addChild(fl_Loader_9);
    else
      fl_Loader_9.unload();
      removeChild(fl_Loader_9);
      fl_Loader_9 = null;
    // Toggle whether you want to load or unload the SWF
    fl_ToLoad_9 = !fl_ToLoad_9;
    movieClip_14.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_10);
    var fl_Loader_10:Loader;
    //This variable keeps track of whether you want to load or unload the SWF
    var fl_ToLoad_10:Boolean = true;
    function fl_ClickToLoadUnloadSWF_10(event:MouseEvent):void
    if(fl_ToLoad_10)
      fl_Loader_10 = new Loader();
    fl_Loader_10.load(new URLRequest("refunds.swf"));
      addChild(fl_Loader_10);
    else
      fl_Loader_10.unload();
      removeChild(fl_Loader_10);
      fl_Loader_10 = null;
    // Toggle whether you want to load or unload the SWF
    fl_ToLoad_10 = !fl_ToLoad_10;

    I think this is either a problem with my site preLoader or my external .swf Loader. I was checking out the bandwith profiler and saw something weird and I wondered if anyone could explain...I've added a picture. I have a blank frame on only my actions layer to export classes to and it seems that frame 2 is "bleeding" into frame 1. Could this be my problem? Why would this happen? Thanks

  • Risk terminator - Works in one system but not in the other

    Hi
    I have two SAP systems which is connected to one GRC system. Risk Terminator works well for the one system but does not work at all for the other.
    I have done the necessary configuration, set-up the RFC connector, tested the connectors, tested the connections from the GRC system. All seems fine but when I create a role in PFCG risk terminator does not seem to be trigged at all in my one system.
    Please advise
    Regards
    Mo

    I would check the adapter for the other system and that the external program is maintained correctly along with all the settings in /VIRSA/ZRTCNFG

  • Works in RSA3 but not when pulling from BI

    Hi,
      I created a generic dataSource(Function Module) for Bill Of Material. When testing in RSA3 it is working fine. But when pulling data from BI with particular material in the Data Selection, it is saying "No data available". If I am pulling the same with no data selection then it is giving an error message "Job terminated in source system --> Request set to red".
    When checked in SM37 I see the following error messages.
    No active nametab exists for /SAPAPO/MATKEY             DA 300
    Job cancelled after system exception ERROR_MESSAGE
    Can any body help me on this
    Thanks for your help
    Subra

    Every thing is fine in all these transactions SM58, BD87, & WE05. There is no problem with the connections at all. I replicated many times and the error is always the same.
    The error message below is the reason.
    No active nametab exists for /SAPAPO/MATKEY
    This messsage is not coming when testing in RSA3. Only when pulling the data from BI, this error is happening.
    We are not using SAPAPO but still this message is coming up.
    thanks
    Subra

  • Report works in Crystal Reports, but not when scheduled in Crystal Server

    Hi,
    I have a pretty simple report designed in Crystal Reports 2008. Basically it shows a list of call notes (memo field) from customer activities in our CRM system. The report works fine in Crystal reports, but when run or scheduled in Crystal Server 2008 the output is always blank. Furthermore, the page format etc. is "lost" in crystal server, so that the output is PDF of a quadratic blank sheet (not my standard A4 format)... Exporting to other formats - excel, Word etc. all gives the same result.
    I have tried to strip out various formulas, formatting etc from the report, but nothing helps. Which leads me to thinking that the real problem is that the report contains a memo field? Anyone else had this problem?
    wkr
    Claus
    Edited by: Claus Poulsen on Nov 9, 2010 3:34 PM

    Hi Claus,
    I've had issues between what Crystal does and what the Report Server does.  To resolve this, we found out Crystal Reports 2008 latest service pack has some things that will fix Server 2008 and they aren't in the latest Server update. 
    We updated Crystal Reports 2008 on our machines.  Installed the latest update for Crystal Server and then installed Crystal 2008 on the Report Server and installed the Crystal Reports 2008 update.  A lot of our compatibility issues went away after that. 
    Good luck,
    Brian

  • Why does Build Application vi work in development environment but not in executable; error 1025

    Hello,
    I have an application ("A") that I am trying to build using another application ("BuildA").
    I can create an application for A manually from its project using the Build Specification, and it works fine (A.exe).
    Also, when I run BuildA.vi in the development environment it calls the "Build.vi" correctly and again builds application A.exe just fine.
    Then, when I make BuildA an application (manually) and run BuildA.exe, I would expect it to also create A.exe just like BuildA.vi did in the development environment.
    However, it fails with the error:
    Code: 1025
    Open VI Reference in NI_App_Builder_API.lvlib:Build (path).vi->BuildA.vi<APPEND>
    VI Path: <b>C:\TEMP\AppBuild\BuildA\vi.lib\AppBuilder\BuildTarget.vi</b>
    I noticed this thread , which looks like a similar problem, but no conclusion was reached.
    Why does BuildA.vi work fine in the LabVIEW environment, but the application BuildA.exe does not work?  All paths are hard-coded, so it shouldn't be a path issue.
    Thanks,
    -john
    Solved!
    Go to Solution.
    Attachments:
    AppBuild.zip ‏175 KB

    Interesting code.  I'm curious how you came to decide 324ms in your while loop, and 58 in the other, and then 5136ms at the end.  In any case I suspect this has to do with this line of text in the help of the Build.vi.
    If you plan to run a build specification on the LabVIEW Run-Time Engine, do not include the Build VI in any of the VIs for the build specification.
    I don't fully know what this means but it might be why it isn't working.
    The Build.vi opens all Context (application instances) and then looks for the one named "NI.LV.MxLvProvider".  This I assume is a application instance NI uses to build applications.  It then uses this and opens some other VIs in this instance for the building.  The error you are getting is "Application Reference is invalid" meaning it couldn't find the NI.LV.MxLvProvider instance it needs to build.  Again I believe this maybe because you are in a run-time environment and that instance doesn't exist there.
    At the end of the day I'm guessing since Application Builder is not free, NI probably doesn't include it in the Run-Time engine, which is free.  So you can't build the way you want.  You could have and EXE running in the run-time open an instance in the development, then run your VI from there if you must make this an EXE.  It maybe easier to just edit the BuildA.vi to have a "Run When Opened" so that you double click the VI and it runs which behaves like an EXE sorta.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • UIImpersonator tests work in FlashBuilder, but not when run from Ant

    I'm in the process of converting a Flex 3 project to use FlexUnit4 tests.
    Everything compiles in Flashbuilder 4.5 and runs nicely. I've converted all the tests
    to use flexunit 4, which highlighted a few issues, but nothing too major, and all the
    tests now pass when run in Flashbuilder.
    So... now, I'm trying to convert the CI build to use the 4.5 SDK and flexunit4. So far,
    so good. Everything runs and I get a nicely formatted JUnit report. Unfortunately, though,
    any test that uses the UIImpersonator fails with an async method timeout, suggesting that
    the CreationComplete event hasn't fired.
    Here's a typical example of one of my UI test cases:
              [Test(async, ui)]
              public function testAvailableProductsSetupAdminForSell() : void {
                   var view:OrderBasketView = new OrderBasketView();
                   var user:CfxUser = new CfxUser();
                   user.admin = true;
                   ModelLocator.instance.userDetails = user;
                   view.buyOrSell = OrderType.SELL;
                   helper.createComponentAndAddListener(view, this, availableProductSetupAdminForSellCreationComplete);
              private function availableProductSetupAdminForSellCreationComplete(event:Event, view:OrderBasketView) : void {
                   Assert.assertTrue(view.availableProductTypes.contains(ProductType.PRODUCT_1));
                   Assert.assertTrue(view.availableProductTypes.contains(ProductType.PRODUCT_2));
                   Assert.assertTrue(view.availableProductTypes.contains(ProductType.PRODUCT_3));
    and helper.createComponentAndAddListener looks like this:
            public function createComponentAndAddListener(view:UIComponent, testCase:Object, creationComplete:Function) : void {
                   _view = view;
                   _view.addEventListener(FlexEvent.CREATION_COMPLETE, Async.asyncHandler(testCase, creationComplete, 4000, _view));
                   UIImpersonator.addChild(_view);
    If I use FlexGlobals.topLevelApplication.parent.addChild(_view) in place of UIImpersonator.addChild(_view), all the tests pass.
    I was wondering if it's a function of the fact that my helper class has no metadata that indicates it's a ui test, but that wouldn't explain why it works in FlashBuilder and not when run with ant.
    I also wondered if it was a function of running with headless server set to true, but when I changed it to false the same thing happened.
    My environment is:
    ubuntu 11.04
    ant 1.7.1
    Sun jdk 1.6.0_26
    Flex SDK 4.5.1.21328
    FlexUnit 4.1.0-8-4.1.0.16076
    I'm using the auto-generated TestRunner.mxml
    Any thoughts, anyone? Now that I can get it to work by adding the UI components to the topLevelApplication, at least I can make progress, but I'd like to get to the bottom of the problem, because that shouldn't be necessary.
    Thanks in advance,
    -Chrisl

    Changing to the topLevelApplication did not work. What's funny is that it then failed on a completely unrelated test by hanging and never returning... I'm thinking there must be something else that is going on here, but it's not clear what... :-/ Here is an example of my setup/teardown and a test that work great in the UI but not in CI...
    [Before(async, ui)]
    public function setUp():void
        _fromToList = new FromToList();
        _fromToList.setStyle('skinClass', FromToListSkin);
        Async.proceedOnEvent(this, _fromToList, FlexEvent.CREATION_COMPLETE, 1000);
        FlexGlobals.topLevelApplication.parent.addChild(_fromToList);
        // UIImpersonator.addChild(_fromToList);
    [After(ui)]
    public function tearDown():void
        FlexGlobals.topLevelApplication.parent.removeChild(_fromToList);
        // UIImpersonator.removeChild(_fromToList);
        _fromToList = null;
    [Test(async)]
    public function should_remove_selected_item_in_to_list_to_from_list():void
        _fromToList.fromArrayList = _dpArray;
        _fromToList.toArrayList = _toDpArray;
        var sequence:SequenceRunner = new SequenceRunner(this);
        sequence.addStep(new SequenceSetter(_fromToList.toList, { selectedItem: _toDpArray[1]}));
        sequence.addStep(new SequenceWaiter(_fromToList.toList, FlexEvent.VALUE_COMMIT, 100));
        sequence.addStep(new SequenceCaller(_fromToList, _fromToList.remove));
        sequence.addStep(new SequenceWaiter(_fromToList, FromToListChangeEvent.FROM_TO_LIST_CHANGE_EVENT, 100));
        sequence.addAssertHandler(handleListHasChangedThenRemoveEvent, {});
        sequence.run();
    private function handleListHasChangedThenRemoveEvent(event:FromToListChangeEvent, passThruData:Object):void
        assertThat(_fromToList.toArrayList.length, equalTo(_toDpArray.length - 1));
        assertThat(_fromToList.fromArrayList.length, equalTo(_dpArray.length - _toDpArray.length + 1));
        assertTrue(_fromToList.fromArrayList.contains(_toDpArray[1]));
    So you can see that I'm using Sequences to manage waiting for stuff to get updated in the background, and basically testing when I select an item in a list and act on it that it updates the model like I expect. Again, works GREAT in the UI Runner.
    I'm open to suggestions...

  • CommandAction works through OnDeviceDebug, but not when installed from jar

    Hi everybody,
    I'm trying to run a HelloMIDlet example and if I run it on emulator it works fine, also when I run it on mobile through OnDeviceDebug from eclipse it works fine, but when I install a jar file and run the application it ends with Application Error message and it exits. I found out that the problem might be in the CommandAction method, because when I use this:
    public void commandAction(Command c, Displayable s) {
              notifyDestroyed();
    }then the application works also when installed from jar, but when I use this:
    public void commandAction(Command c, Displayable s) {
       String label = new String("Exit");   //just for test
       if (label.equals("Exit"))
         notifyDestroyed();
    }then it ends with Application Error right after I run the program (and it works when I use OnDeviceDebug). I'm using jdk1.5.0_06 and WTK from Sony Erricsson (my target device is W800i, which supports CLDC1.1 and MIDP2.0)
    My manifest file is
    Manifest-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MIDlet-Name: HelloMIDlet
    Created-By: Sun Microsystems Inc.
    MIDlet-Vendor: Sun Microsystems, Inc.
    MIDlet-1: HelloMIDlet, , HelloMIDlet
    MIDlet-Version: 1.0
    MicroEdition-Profile: MIDP-2.0
    MIDlet-Description: Hello Worldand I don't use the jad file when installing the application (seems to be unecessary when you have a manifest file inside the jar). And I'm unable to debug it because when debugging then it works normally. Also I tried to recompile the BluetoothDemo and the same error(and works through OnDeviceDebug). And when I installed the jar file, which is originally distributed with BluetoothDemo then it worked. When I compared original jar file and my jar file then the only difference was in the size the class files (class files compiled by me were bigger then the class files in original jar file (which work)).
    Any ideas guys and girls?

    I tried that approach but it doesn't work either. I think maybe my directory structure is wrong.
    C:\IRS\IRS.jar
    C:\IRS\irs.hs
    referenced: jar:file://C:/IRS/IRS.jar!/irs.hs
    Am I doing this right?

  • Html snippet works w/in iweb but NOT when site is live & online @$#!

    help!? I have had a flash based slide show working on my iweb site for some time I used iweb enhancer to make it work w/ iweb 06 - now in 08 the "enhancer" doesnt work. The html snippet should & seems to...I am able to get the pages to behave very well while IN iweb the slide shows load while the program is active & when I publish the site to a folder the site works great - UNTIL I upload it and try to view it online THEN it doesnt work properly.
    I have a google map snippet that works fine live OR when browsing from the hard drive/folder WHY wont the snippets work when they are uploaded if they work ON my computer?????
    site is www.austin-studios.com click on seniors OR children...
    -thanks in advance

    Phil,
    Everything is working fine on my end too. (OSX 10.5.2) Tried your site on Safari 3.1 / Netscape Navigator 9.0.0.3 / Firefox 2.0.0.9 and Camino Version 2007022813 (1.0.4)... each one ran your snippets with out fail
    Would emptying cache on your computer help?
    Good Luck,
    John

  • Procedure runs in SQL Plus, but not when called from my Oracle Form

    Hi. I have this code to send an email alert as the user updates a record on my base table from my Oracle Form. I use dbms_scheduler so that it's submitted as a background job and so the email processing does not delay my Oracle Form from saving quickly. If I submit this code in SQL Plus it executes and I receive the email as expected.
    begin
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (62547, ''01-SEP-11'', ''02-SEP-11''); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;However if I submit this code from a Post-Update trigger in my form the code runs without error, but my email is never received (the same parameter values would be passed to this trigger):
    begin
    -- Submit the email notification in the background so as to not slow down the screen while saving.   
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (:dropper_vacations.dropper_id, :dropper_vacations.begin_dt, :dropper_vacations.end_dt); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;     Any ideas why this might be happening?

    Wow, so I changed the two procedures so that I'm only passing in one number parameter and one char parameter...
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) ISIf I execute it like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, 99999);or like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, '99999');But if I execute it like this (I get no errors) the email is not sent:
    TTMS.job_vacationconflict_notify(62547, 'ababa');So this problem really has nothing to do with date formats. It seems to have to do with whether parameter two has characters in it!!! What the heck.
    Any ideas on this?
    Here is the procedure I'm calling:
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    begin
      dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationemailurl_new ('||p_dropper_id||','||p_other||'); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;
    /And the above procedure is calling this procedure which should be sending the email alert:
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) IS
          myguid varchar2(15):=null;
          pcm_contact varchar2(3):=null;
          guid_contact varchar2(15):=null;
          conflict_cnt number(8):=0;
          -- Various declarations
          PSENDER VARCHAR2(200);            --  From
          PRECIPIENT VARCHAR2(200);         --  To
          P_CC_RECIPIENT VARCHAR2(200);     --  CC
          P_BCC_RECIPIENT VARCHAR2(200);    --  BCC
          PSUBJECT VARCHAR2(200);           --  Subject
          PMESSAGE VARCHAR2(6000);          --  Message Body
          PPARAMETER NUMBER;                --  Parameter Value
          guid_valid varchar2(15);          --  Used to grab the validation value of
          -- Grab name details of e-mail targets
          cursor targets is
          select guid, initcap(first_name) first_name, initcap(first_name)||' '||initcap(last_name) fullname
          from pwc_employee
          where upper(guid) = upper(guid_contact);
    BEGIN
            select count(*)
            into conflict_cnt
            from dropper_bundle_assign
            where
                dropper_sched = in_dropper_id and
                trunc(sched) <> '31-DEC-29' AND        
                trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                trunc(sched) > trunc(sysdate);
            select distinct pcm
            into pcm_contact
            from dropper_bundle_assign
            where
                  dropper_sched = in_dropper_id and
                  trunc(sched) <> '31-DEC-29' AND        
                  trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                  trunc(sched) > trunc(sysdate);
            select guid
            into guid_contact
            from pwc_employee
            where initials = pcm_contact;
        -- Ensure required parameters have been passed
        if guid_contact is not null
           and in_dropper_id is not null then
               Begin
                    select guid
                    into guid_valid
                    from pwc_employee
                    where upper(guid) = upper(guid_contact);
               Exception
                    when no_data_found then
                    raise_application_error(-20000,'Invalid Recipient.  Please check the employee table.  Please try again.');
               End;
               -- In the event there are multiple targets then we will loop thru and send individual emails
               for thisone in targets loop
                    PSENDER := lower(user)||'@us.ibm.com';
                    PRECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_CC_RECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_BCC_RECIPIENT := 'ssbuechl'||'@us.ibm.com';
                    PPARAMETER := TO_NUMBER(lower(in_dropper_id));
                    PSUBJECT := 'TEST: Dropper Vacation '||in_other||' Conflict Notification for dropper '||in_dropper_id||' - Action Required';
                    PMESSAGE := thisone.first_name||'-<br><br>There is an induction conflict due to a new or updated dropper vacation.<br><br>Click here to the dropper''s vacation conflicts: <u><a href="http://9.35.32.205:7777/forms/frmservlet?config=TTMSMENU&form=dropper_vacations&otherparams=p_dropper='||PPARAMETER||'">Dropper Id: '||PPARAMETER||'</a></u> (note: use your Oracle credentials when prompted for log-on information).<br><br>Thanks.';
                    SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );  -- Procedure to physically send the e-mail notification
               end loop;
        else
              raise_application_error(-20001,'Recipient and Parameter Value are required. Please try again.');
        end if;
    exception
        when no_data_found then
             raise_application_error(-20002,'Note: Email will not be sent because no PCM was identified as the manager or the PCM does not have a record in the Employee table.  See ITS for assistance.');
         when too_many_rows then
             raise_application_error(-20003,'Note: Email will not be sent because multiple PCMs manage this dropper. Please notify each PCM manually.');
    END dropperVacationEmailURL_new;
    /Edited by: sharpe on Aug 17, 2011 4:38 PM
    Edited by: sharpe on Aug 17, 2011 5:03 PM

  • Unix shell: Environment variable works for file system but not for ASM path

    We would like to switch from file system to ASM for data files of Oracle tablespaces. For the path of the data files, we have so far used environment variables, e.g.,
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    This works just fine (from shell scripts, PL/SQL packages, etc.) if ORACLE_DB_DATA denotes a file system path, such as "/home/oracle", but doesn’t work if the environment variable denotes an ASM path like "\+DATA/rac/datafile". I assume that it has something to do with "+" being a special character in the shell. However, escaping "\+" didn’t work. I tried with both bash and ksh.
    Oracle managed files (e.g., set DB_CREATE_FILE_DEST to +DATA/rac/datafile) would be an option. However, this would require changing quite a few scripts and programs. Therefore, I am looking for a solution with the environment variable. Any suggestions?
    The example below is on a RAC Attack system (http://en.wikibooks.org/wiki/RAC_Attack_-OracleCluster_Database_at_Home). I get the same issues on Solaris/AIX/HP-UX on 11.2.0.3 also.
    Thanks,
    Martin
    ==== WORKS JUST FINE WITH ORACLE_DB_DATA DENOTING FILE SYSTEM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA=/home/oracle
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 20:57:09 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> !ls -l ${ORACLE_DB_DATA}/bma.dbf
    -rw-r----- 1 oracle asmadmin 2105344 Aug 24 20:57 /home/oracle/bma.dbf
    SQL> drop tablespace bma including contents and datafiles;
    ==== DOESN’T WORK WITH ORACLE_DB_DATA DENOTING ASM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA="+DATA/rac/datafile"
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 21:08:47 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON
    ERROR at line 1:
    ORA-01119: error in creating database file '${ORACLE_DB_DATA}/bma.dbf'
    ORA-27040: file create error, unable to create file
    Linux Error: 2: No such file or directory
    SQL> -- works if I substitute manually
    SQL> CREATE TABLESPACE BMA DATAFILE '+DATA/rac/datafile/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> drop tablespace bma including contents and datafiles;

    My revised understanding is that it is not a shell issue with replacing +, but an Oracle problem. It appears that Oracle first checks whether the path starts with a "+" or not. If it does not (file system), it performs the normal environment variable resolution. If it does start with a "+" (ASM case), Oracle does not perform environment variable resolution. Escaping, such as "\+" instead of "+" doesn't work either.
    To be more specific regarding my use case: I need the substitution to work from SQL*Plus scripts started with @script, PL/SQL packages with execute immediate, and optionally entered interactively in SQL*Plus.
    Thanks,
    Martin

Maybe you are looking for