Scope order: local vs argument

Hi,
According to http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec09af4 -7fdf.html, LOCAL variables take precedence to ARGUMENTS variables.  However, when I access an unscoped variable in a CFC function that is available in both LOCAL and ARGUMENTS, I get back the ARGUMENTS scope.  Why is that?  I am using CF 9,0,0,251028.
<cfcomponent>
    <cffunction name="testFunction" access="public" returntype="string">
        <cfargument name="x" default="argument">
        <cfset LOCAL.x = "local">
        <cfreturn x />
    </cffunction>
</cfcomponent>
<cfset obj = createObject( "component", "component.Test" )>
<cfoutput>#obj.testFunction("argument")#</cfoutput>
The output I get back is "argument" instead of "local".
The other thing that I find weird is that if I replace
<cfset LOCAL.x = "local">
with
<cfset var x = "var">
I get the error message "X is already defined in argument scope".

Hmm, I have never heard of the "local" scope. Are you sure the doc is not referring to <cfset var x = "local" /> as being a local variable? Try changing your example to the following:
    <cffunction name="testFunction" access="public" returntype="string">
        <cfargument name="x" default="argument" />
        <cfset var x = "local" />
        <cfreturn x />
    </cffunction>

Similar Messages

  • Uncheck Invoice receipt indicator in Purchase Order Local

    We want to uncheck invoice receipt indicator in Purchase Order Local ( field BBP_PDSET-IR_IND) when a Shopping Cart is complete and PO Local is created automatically by system.
    We are using BADI BBP_DOC_CHANGE_BADI with Method BBP_PO_CHANGE but no changes are made. BADI is not accessed when PO Local is created automatically but only when we modify PO Local with transaction BBP_POC.
    What we can do?
    Regards.

    Hi David,
    the BBP_DOC_CHANGE_BADI is actually accessed during automatic creation. You can see this by putting an external breakpoint in the badi for user WF-BATCH.
    The IR_IND is based on the vendor data, if you clear the invoice receipt indicator there it will not be set in the po. The vendor data is checked later on, so that's why you don't see any change. As it will clear the ir indicator in the badi, but then sets it again later on.
    Regards,
    Robin

  • Create a SUS purchase order locally in SRM

    Hi guys
    we run a SRM 5.0 with SUS installed.
    I tried to create a PO locally as Purchaser with transaction type "SUPO SUS Purchase Order".
    It now says that "transaction type SUPO must not be used for object type BUS2201".
    Does my error belong to
    (1) I cannot create a SUPO order in EBP as a purchaser, but I would have to create this in MM?
    (2) I made a mistake in customizing?
    if (1): Is there any trick to locally create a PO to show the custome how it looks like?
    if (2): What was my mistake?
    Tanks for an answer
    Mario
    PS: I will for sure award points for help...

    Hi
    we have a separate SRM Server running. Plan ist to transfer MM POs via PI to SUS.
    As we have a mapping problem that requires some more work to be done I tried to manually create a PO in EBP just to be able to show the look and feel of SUS to the customer. 
    You don´t think this would work? Do you know any function that would make it able to simulate a PO?
    regards
    Mario

  • My SAP SRM Application Monitors Purchase order / local errors

    I am seeing local errors in the monitor under Purchase order. The message is incorrect status in pricing, but when i click on the message i get no further information. How can I track there errors

    Hi,
    Check your outbound queue in SMQ2 if the error is there for more details. pricing error is related with the IPC so check if your IPC destinations are working in SM59.
    Please have also a look into following threads :
    Incorrect status in pricing - SRM server 5.5
    External Requirements to SRM
    Hope this helps
    Laurent.

  • Scope of local modules

    Many articles concerning PL/SQL best practices promote the use of local modules for code clarity. I am wondering how this affects testability due to limited scope (we use utplsql.)
    For example, if I write
    PROCEDURE A
    IS
    PROCEDURE B...
    PROCEDURE C...
    BEGIN
    // procedure A body
    END A;
    is there any way that I can expose or fully qualify B or C for testing, without moving them outside of A ?? As far as I can tell, the answer is no, but I'm wondering if someone out there knows a trick that I have overlooked.
    Thanks for the help,
    Mark

    Hello
    Well, I'm probably going to get slated for saying this but [opinion]I think the idea that local modules somehow improve code clarity is highly misguided. There are cases (very few I have come across) where they can be of use but in the long term I think they can easily lead to very poorly structured code and make it very easy for subsequent developers to take nasty little short cuts. I accept that virtually all program constructs can be abused, but I have found that local modules bring out some of the worst coding "practices" I have ever seen, and I am yet to see any benefit other than for anonymous pl/sql blocks, and very simple helper routines such as string formatters or expression generators.
    Like all tools, they should be used when necessary, when they fit the problem at hand, and not applied as an over-all "best practice". I tend to be very sceptical of any one size fit's all approaches to development so maybe I'm slightly prejudiced.
    The issue you have raised, to me at least, is one reason why you would not use local procs. If they are complex enough to require testing that requires them to be called in isolation, I think they should probably be separate.
    [opinion]
    HTH
    David

  • Cannot find scope's local variable

    I am doing the soa tutorial. In the step of 5.11.5 Task 5: Reference the RequriesApprovalRule Dictionary in the BPEL Designer, I cannot find the variable of IorderApproved when I add "assign output facts" in the business rule activity.
    A local variable named "lOrderApproved" was defined in the scope Scope_CheckApprovalLimit. According to the tutorial, I create the business rule and refered it in BPEL.
    However, in the step of Assign Input Facts, I cannot see the lOrderApproved under the Scope_CheckApprovalLimit.

    There are lot of sequence of steps in this tutorial. If you miss something you cannot proceed further. I would redo from first step.
    post here in the BPEL forum
    BPEL

  • Locale sensitive arguments in error messages

    hi,
    A powerful feature of JHeadstart is the ability to define local sensitive error messages, even those that are using arguments (e.g. {0},....). However the arguments are often technical DB identifiers (entity names / attribute names) that make no sense to the end-user.
    How to translate the arguments in error messages as well?
    kind regards,
    Martijn

    Sandra,
    Could you please provide more details. I am just a novice in the JHeadstart arena.
    In the struts-config file I only find a reference to the JhsMessageResourcesFactory class which creates an instance of the JhsMessageResources class. This class overloads a method for getting a message with replacement parameters.
    Which pattern do I use to intercept this program flow. Make my own class extending JhsMessageResources or PropertyMessageResources? To make an instance of my class I also need to write my own factory class? And then, will an instance of my class be used in the processing of messages. To make it all manageable it would be nice to get a reference in my getMessage() method that points to the proper ListResourceBundle subclass object for the substitution of the arguments.
    It looks like an adventure to me, but if you don't try anything it brings you nowhere;-)
    Martijn

  • Purchase Order Local / Import Smartform link tables with Taxes

    Hi,
    I am facing a problem while printing PO
    1) I am entering taxes like Excise,VAT,CST,Cess etc
    I want that taxes to be printed in PO
    2) If multiple line items with diffrent tax conditions are there how can I print that in PO
    3) How to treat diffrent amount of discount and freight in multiple line items.
    Can any body tell me which table should used and from which table i will retrive Taxes e.g Excise / Education Cess / SHC
    VAT and CST / service Tax...
    Tell me some standard P.O and code .....
    plz tell me link between tables .....
    Thanx in advance

    All your questions are answered by BestPractice Smartform.
    download them, and you will have a complete solution.

  • Linker argument order

    Hi,
    there's a quirk in the Sun Studio 12 RC version you distributed at LinuxTag 2007
    in Berlin, Germany (&#1040;&#1083;&#1077;&#1082;&#1089;&#1072;&#1085;&#1076;&#1088; &#1043;&#1086;&#1088;&#1096;&#1077;&#1085;&#1077;&#1074; told me to report any more bugs I find
    to this forum).
    --- begin pastetg@odem:~ $ $SP/bin/cc -# -Wl,-dynamic-linker,/usr/libexec/ld.so hello.c                                       
    ### Note: NLSPATH = /home/.data/tg/suncc/sunstudio12/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/home/.data/tg/suncc/sunstudio12/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    ###     command line files and options (expanded):
    ### -Wl,-dynamic-linker,/usr/libexec/ld.so hello.c
    /home/.data/tg/suncc/sunstudio12/prod/bin/acomp -xldscope=global -i hello.c -y-fbe -y/home/.data/tg/suncc/sunstudio12/prod/bin/fbe -y-xarch=generic -y-o -yhello.o -y-verbose -y-xthreadvar=no%dynamic -y-comdat -xdbggen=no%stabs+dwarf2+usedonly -xdbggen=incl -y-s -m32 -fparam_ir -Qy -D__SUNPRO_C=0x590 -D__unix -D__unix__ -D__i386 -D__i386__ -D__linux__ -D__linux -Dlinux -D__gnu__linux__ -D__BUILTIN_VA_ARG_INCR -D__C99FEATURES__ -Xa -D__PRAGMA_REDEFINE_EXTNAME -Dunix -Di386 -D__RESTRICT -xc99=%all,no%lib -D__FLT_EVAL_METHOD__=-1 -c99OS -I/home/.data/tg/suncc/sunstudio12/prod/include/cc "-g/home/.data/tg/suncc/sunstudio12/prod/bin/cc -Wl,-dynamic-linker,/usr/libexec/ld.so -c " -fsimple=0 -D__SUN_PREFETCH -destination_ir=yabe
    /home/.data/tg/suncc/sunstudio12/prod/bin/fbe -s -o hello.o -warn=%none -Qy /tmp/yabeevaqyh
    rm /tmp/yabeevaqyh
    ### Note: LD_LIBRARY_PATH = /data/tg/Misc/.home/suncc/sunstudio12/prod/lib/sys:/data/tg/Misc/.home/suncc/sunstudio12/prod/lib
    ### Note: LD_RUN_PATH = <null>
    /usr/bin/ld -dynamic-linker /usr/libexec/ld.so -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 --enable-new-dtags /home/.data/tg/suncc/sunstudio12/prod/lib/crti.o /home/.data/tg/suncc/sunstudio12/prod/lib/crt1.o /home/.data/tg/suncc/sunstudio12/prod/lib/values-xa.o hello.o -Y "/home/.data/tg/suncc/sunstudio12/prod/lib:/lib:/usr/lib" -Qy -lc /home/.data/tg/suncc/sunstudio12/prod/lib/libc_supp.a /home/.data/tg/suncc/sunstudio12/prod/lib/crtn.o--- end paste
    As you can see, the argument "-dynamic-linker /lib/ld-linux.so.2" overrides the one I
    give it on the command line, instead of vice versa (i.e. the other way round).
    Also, where is that -Y argument generated from?
    Ideally, I would use something like &#8220;-Wl,-dynamic-linker,/usr/libexec/ld.so -Wl,-Y,/usr/lib&#8221;
    to create binaries (for BSD, not for Linux &#8211; it works, I just have to create a wrapper around
    ld as described in http://marc.info/?m=118099390924175 and in mails to Alexander).
    So it'd be nice if the options given on the command line via -Wl (etc.) are appended to
    all automatically generated flags, instead of prepended. I'm not quite sure about the
    order of the arguments w.r.t the files &#8211; maybe the -Y and -Qy arguments should be moved
    before the crti.o, and between them and crti.o place the user-given arguments.
    Also, is there a kind of &#8220;spec file&#8221; like gcc or a command line option or whatever to tell
    it to use different crt*.o files? At the moment, I'm using &#8220;ld -r&#8221; to combine our five into the
    three the Sun compiler expects.
    But still (despite bug 6565674) a great job you have done, thanks!

    As you can see, the argument "-dynamic-linker /lib/ld-linux.so.2" overrides the one Igive it on the command line, instead of vice versa (i.e. the other way round).
    Its just a bug in -Wl. All other -Wx options add to the end of the component options line.
    where is that -Y argument generated from?It is the default path for linking our own compiler libraries. Its just hardcoded in the driver.
    is there a kind of &#8220;spec file&#8221; like gcc or a command line option or whatever to tellit to use different crt*.o files?
    Sorry, nothing similar to the spec. And I do not expect it to be changed any soon.
    regards,
    __Fedor.
    PS just have filed 6565771bug for -Wl problem

  • Argument Order Reversed Importing Package into OWB

    I'm having a problem importing Packages into OWB. It recognizes the Functions contained in the Package, however the order of the arguments for each Function are reversed after I complete the import into OWB. This causes execution of the mapping to fail... Additionally, after importing into OWB, OWB doesn't seem to recognize any optional parameters or default values in the signature of the Function. I must be doing something wrong... Can anyone help...
    Thanks
    Alan

    Hi
    Standard approach to be followed for any object modification
    1. If you have created your package from OWB and deployed it into your DB, always do it that way i.e. Design center -->DB . Do not make any modifications on DB level and import in back to your Design center. OWB manages Ids for all objects on the repository and this will confuse it. That is why you see two versions of the same package . Any modifications should be done on Design center level and then do a replace on the package from control center
    2. If an object (package or procedure) is created on DB directly and is imported into design center, follow the same norm everytime you make any changes to that object. The status of that object will appear as "New" or "Not deployed" on control center but that is fine because OWB has no ID on its repository to maintain this information.
    3. If you need to rename any object already deployed from OWB, always drop it first, then rename it and then deploy it. That way OWB will maintain the name and ID on its end and not get confused.
    4. For your case, you can drop the older version of the package from OWB, delete the one imported from Database into OWB, make the changes on OWB level (adding parameter etc) and then redeploy the same package as replace from control center.
    Hope these tips help
    birdy

  • Order of arguments while calling a Java method from C

    Hi
    are there any rules to order the transferred arguments ?
    I wanted to transfer a native window event from C to Java and if the called
    java method is declared like this: (int, long, int) (IJI)V
    public static void nativeMouseButtonDownCallback(int wParam, long lParam, int which)
    the value of 'which' is not correct (always the same independent from what I set it to in the C function)
    If I declare the java method like this: (int, int, long) (IIJ)V
    public static void nativeMouseButtonDownCallback(int which, int wParam, long lParam)
    everything is fine.
    Any information appreciated !
    Bye Mark

    Thanks for your reply !
    Initially I also thought that the set of the value could be wrong and so
    I used a printf statement in C to monitor the transferred value.
    And still: the value I put in was different from what I got in java.
    After this I put in simple numbers like 1,2,3 and in java I still got
    the same wrong value.(guess max signed int 21474836..)
    I really replaced the dll and class files and restarted the IDE.
    The problem got solved by changing the order of the long an int.
    Bye Mark

  • India localization receipt error, import standard purchase order interface

    Hi
    I created PO using PO interface and then imported PO in Incomplete status. Now after applying taxes(India localization) i send it for approval and then tried creating receipt. at this point i got an error message which is about trigger JAI_RCV_RT_BRIUD_T1 and some routine and all.
    After doing little diagnostic here and there, i found that If i create Manual PO and apply Taxes i.e. Open Purhcase Order(Localized) select line level click on "Taxes" and apply a Tax on it and precedence, just after "Rate" there is a field of Curr which is defaulted with INR.
    In case of Import PO, at order localized form when I apply Tax, the field Curr is Null.
    Now when I somehow put currency INR in imported PO(by making that field editable and taking INR from LOV) everything goes smooth.
    So my doubt is, why INR is not coming by default at Tax screen at PO localized form when i create PO using interface.

    Hi
    Do you have a copy of your insert statement?
    regards

  • Query on Service Order Reports

    Hi,
    Need to take report based on Months for the
    Open Service Orders Quantity
    Actual Cost Value of Open Service Orders (Local Currency)
    Actual Billable Cost Value of Open Service Orders (Local Currency)
    Month to Date Revenue
    Month to Date Margin
    Quantity of Invoices Processed Daily
    Average Days to Invoice of Daily Invoiced Service Orders.
    The above reports must be with the Output containing the below fields:
    Order ID
    Invoice ID
    Node
    Order Creation Time
    Resolved Date
    Invoiced At
    Request Type
    Deb/Cred
    Quoted
    Actual Cost
    Total Cost Received
    Total Price
    Margin
    Days to Invoice
    Let me know if there is any std reports available or the appropriate Table names to fetch the same.
    Ravi.

    Hi,
    Am able to fetch few of the fields from AUFK Table and T. Code IW73. But still wants to know any other provides these fields to take as report.
    Ravi.

  • Without delete PDP table entry, I want to Order PO in R/3. How can I do it?

    Hi SRM Gurus,
    I am using SRM 5.5 with Extended Classic Scenario and Plan Driven Procurement(PDP).
    My question is: I was unable to create PO with reference PR/RFQ/Manually  in R/3.System is giving an error message 'you can order locally(SRM)'. Which material group and Purchasing groups are maintained in PDP table. If I delete this entry I can Order PO in R/3.
    Now I don't want to delete PDP table entry and I want to Order PO in R/3. How can I do it?.
    Please focuses light on this issue. Highly appreciate.
    Regards,
    John.

    Hi
    I think you can do in both sides
    let me know your scenario too well.
    I am in classic scenario
    i can create a PR - if i have valid unique source of supply , PO will be created in ECC
    If i have more than one source of supply , my PR will get EPRTRANS TABLE ENTRY with EPROFILE updated in EBAN table and my ECC pr wil be transfered to SRM and create  a sc and this cart will be in cockpit.
    I believe your PR has EPROFILE , thats why you could not create a PO in ECC side.
    confirm me.
    How to you assign a source of supply for PRs ? I wanted to know. so i can expalin easilyand any jobs you create to create a Auto POS in ECC after assign a source of supplt to your Purchase request.
    br
    muthu

  • Application monitor PO local errors "Buffer table not up to date"

    Hi Experts,
    Any idea about the cause of below error, no PO's effected, but in RZ20 i could see below message
    General details
    Column                 Contents
    Node name (MTE)        ESP\Business to Business Procurement(100)\...\Purchase Order\Local errors
    System                 ESP
    Context                Business to Business Procurement(100)
    Object name            Purchase Order
    Short name             Local errors
    Type                   Status attribute
    Class                  BBP_PO_LOCAL
    Highest alert          Red
    Number of alerts       1
    Definition status      ENABLED
    Customizing status     DBSET
    Auto-reaction method   -
    Definition status      -
    Runtime status         -
    Data collection method -
    Definition status      -
    Runtime status         -
    Analysis method        BBP_ANALYZE_PO_LOCAL
    Definition status      AL_TD_DEF_CHECKED
    Status attribute details
    Column                Contents
    Node name (MTE)       ESP\Business to Business Procurement(100)\...\Purchase Order\Local errors
    System                ESP
    Context               Business to Business Procurement(100)
    Object name           Purchase Order
    Short name            Local errors
    Date                  15.09.2009
    Time                  15:12:04
    Last reported message Buffer table not up to date
    Not able to find for which document this error has arised and why
    Thx
    Jai

    Below is the SM21 Log
    Details Page 2 Line 20 System Log: Local Analysis of lbesrmp                  1
    Time     Type Nr  Clt User   TCode Grp N Text
    15:12:04 DIA  001 100 SARFOW       AB  0 Run-time error "UNCAUGHT_EXCEPTION" occurred
    Run-time error "UNCAUGHT_EXCEPTION" occurred
    Details
    Recording at local and central time........................ 15.09.2009 15:12:04
    Task...... Process                     User...... Terminal Session TCode Program Cl Problem cl          Packag
    07716      Dialog work process No. 001 SARFOW     10.0.1.7       1               T  Transaction Problem SABP
    Further details for this message type
    Module nam Line Error text
    abexcp     2099 raiseExcp
    Documentation for system log message AB 0 :
    The specified runtime error has occurred in the system.
    Parameter
    abcdefghijklmnopqrstuvwxyz .. UNCAUGHT_EXCEPTION
    Technical details
    File Offset RecFm System log type     Grp N variable message data
      290  80280 l     Error (Module, Row) AB  0 raiseExcp                                           abexcp  2099

Maybe you are looking for

  • After iOS 8 upgrade keyboard shortcuts gone, just reboot

    FYI, apparently this also happened with the ios7 upgrade. Per the related ios7 thread, after a manual reboot of the phone, the shortcuts reappeared. The reboot solved my problem as my keyboard shortcut settings reappeared after reboot.

  • HP Officejet Pro 8500 A909g connected, but won't print

    Windows XP Pro, new OJ 8500, connected by wired network. firmware updated from web printing function is unreliable - works then not Do test print (or any other print job) from Windows, you can see the print job briefly flash in the print queue, and t

  • Consistent naming with USB/PCI devices

    I have an onboard audio device -- a Radeon HD 6500D -- which appears in aplay -l as two different audio cards -- the HDMI audio, and an analog audio.  In addition, I have an external USB audio card I use for podcasts.  So the three audio devices are:

  • While doing MIGO for a material we getting error as?

    Hi, While doing a MIGO for a material we are getting a error as ''special stock o of a vendor doesnot exists" Thanks KK

  • Stack/Delete within a Collection?

    Using Lightroom 1.2 on WinXP. When importing I leave photos in place and import only the metadata. 1) Is it possible to stack within a collection? I see the expand/collapse stack drop list items when right-clicking within a folder but not within a co