What is the scope of implicit loop variables?

Hi,
I'm facing some strange error from the ABSL editor (syntax checker).
In ABSL the loop variables are implicit and don't have to be declared in the head section of the script.
My question now is simple: How is the scope/visibility of such loop variables specified ?
There's a complete code snippet below.
In line no.9, there's the first time use of implicit loop variable 'task_inst'.
Because of type inference, it will be typed as MasterDataWanneBe/Tasks (which is my own BO type).
In line no.20, I want to use the same variable name in a different loop, outside the parenthesis/scope of the first first use.
Now the ABSL syntax checker complains about incompatible types (see code snippet)
Thus the type inference should result in the, (lets say 'local') type Project/Task, which is the one I was querying for.
To me it looks like, that loop variables implicitly get a global scope (hopefully bound to this ABSL file only).
I would like to see the scope/visibility of loop variables restricted to the parenthesis.
In other words only inside the loop.
Hint
I heard (from little sparrows), that local variable scoping is not possible because of underlying
generated ABAP code. If so, than it would be helpful to print warnings, in case of types are compatible
but used in different scopes. Think about the unintended side effects.
import ABSL;
import AP.ProjectManagement.Global;
var query_tasks;
var query_tasks_param;
var query_tasks_result;
foreach (empl_inst in this.Employees) {
     foreach (task_inst in empl_inst.Tasks) {
         //   ^^^^^^^^^  first time use
          task_inst.Delete();
// ===========================================================================
query_tasks = Project.Task.QueryByResponsibleEmployee;
query_tasks_param = query_tasks.CreateSelectionParams();
query_tasks_result = query_tasks.Execute(query_tasks_param);
foreach (task_inst in query_tasks_result) {
      // ^^^^^^^^^ Error: 4
      // The foreach loop variable is already inferred to an incompatible type:
      // Node(MasterDataWanneBe/Tasks). Expected Node(Project/Task)

Yes, variable declarations in ByD Scripting Language indeed have (snippet) global visibility. In the FP 3.0 release the variables can be declared anywhere in the snippet (not only in the beginning, as with FP 2.6), however still not within code blocks, i.e. within curly braces ({}). Therefore variable name shadowing is still not supported and because of the global visibility of variables they cannot be reused for a different type, later in the same snippet. This is because of the statically typed nature of ByD Script, despite the type inference convenience.
Kind regards,
Andreas Mueller

Similar Messages

  • What's the maximum size a varchar2  variable can hold for and NDS Stmnt?

    What's the maximum size a varchar2 variable can hold for and NDS Statement? I read that NDS is good for doing EXECUTE IMMEDIATE on statements that aren't too big. The 10g PL/SQL manual recommends using DBMS_SQL for statements that are too large, but it never gave a limit for what too large was. Does anyone know offhand?

    The limit is the same as the length of varchar2 variable within PL/SQL - that is varchar2(32767).It's not documented, but intermediate concatenation result can hold up to (64k-1) :
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    declare
      part1 varchar2(32767) := rpad('begin null;', 32767);
      part2 varchar2(32767) := lpad('end;',        32767);
    begin
      dbms_output.put_line(length(part1 || ' ' || /*' ' ||*/ part2));
      execute immediate part1 || ' ' || part2;
    end;
    65535
    PL/SQL procedure successfully completed.

  • What is ESOA? What is the Scope/Role for Functional Consultants in eSOA.

    Hi Experts,
    1)     Does eSOA is a tool, application or module?
    2)     What is the relation between eSOA and ECC6.0?
    3)     What is the Scope/Role for Functional Consultants in eSOA?
    4)     What I have to learn in eSOA?
    5)     How it is useful for Functional Consultant?
    6)     How it is useful for Customers?
    7)     How much time it will take to learn eSOA?
    8)     Where can get the Material?
    9)     What all technologies I have to learn before I learn  to eSOA?
    I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
    I donu2019t know anything eSOA.
    Please give me the answers.
    Regards,
    Ram

    Hi Ram,
    See the answers below
    > 1)     Does eSOA is a tool, application or module?
    ESOA is not any tool,application or module. Its a methodology/Architecture
    > 2)     What is the relation between eSOA and ECC6.0?
    ECC 6.0 provides some Enterprises Services through enhancement packages.
    > 3)     What is the Scope/Role for Functional Consultants in eSOA?
    FUnctional consultant should know which ENterprise Serrvices are available and which should be developed to carry out a business process.
    > 4)     What I have to learn in eSOA?
    .         Being a technical guy, there are things to be learnt like ESR, implementing designed serivces through ABAP or Java and consuming it. But being a functional guy, only awareness of what enterprise services are available and what they do and their input/output params and how they can fit into a business process is sufficient.
    > 5)     How it is useful for Functional Consultant?
    see above
    > 6)     How it is useful for Customers?
    Customers can move towards Service Oriented Architecture, get flexibility in changing a business process easily, maintaince cost is less
    > 7)     How much time it will take to learn eSOA?
    depends on your skills
    > 8)     Where can get the Material?
    lot of material in SDN
    > 9)     What all technologies I have to learn before I learn  to eSOA?
    ABAP or JAVA,ESR ( being a technical consultant) , Web Services
    > I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
    you should aware of basics of service oriented architecture
    If you further want to clear doubts, do write up.
    Regards,
    Piyush

  • What is the best way to loop a sound where the loop is a subsection

    I have a sound file, and I am supposed to loop a middle section of the sound, i don't see any way in soundengine to do this. What is the easiest way to loop an MP3 background sound where the beginning is to played once. if I load two sounds and then play both of them they will overlap, yes? I know the time of the loop point, but wonder if there is a way to make it a really perfect loop, with no pauses, gaps or clicks.

    I'm not at my Mac right now so I can't give specifics but SoundEngine allows you to specify attack and decay components to a looping background track. In your case you would specify the beginning section as the attack component and the middle (looping) section as the primary component.
    Craig

  • What is the difference between Constant Window, Variable Window,Main Window

    hello all
    what is the difference between 1) Constant Window
                                                2) Variable Window
                                                3) Main Window   in SAP SCRIPT

    Hi,
    Window Types
    When defining a form window, you must select a window type for the window.
    You can choose between three types:
    Constant Windows (CONST)
    Variable Windows (VAR)
    Main Windows (MAIN)
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR.
    Therefore, if you create a new window, always use type VAR.
    Variable Windows (VAR) 
    The contents of variable windows is processed again for each page, on which the window appears.
    The system outputs only as much text as fits into the window. Text exceeding the window size is truncated;
    the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike.
    The only difference is that constant windows have the same size throughout the form.
    Main Windows (MAIN) 
    Each form must have one window of type MAIN. Such a window is called the main window of the form.
    For SAPscript forms, the main window has a central meaning:
    It controls the page break.
    It contains the text body that may cover several pages.
    It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to
    output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form.
    The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page.
    This page must not call itself as subsequent page (recursive call), since this would produce an endless loop.
    In such a case, SAPscript terminates the output after three subsequent pages.
    For printing header lines or totals, the different output areas of the main window are of special importance.
    go through this links:
    In Scripts Variable window and constant wind difference?
    Main Window
    Re: Main Window in SAP Script
    What is the difference between Constant window and variable window?
    Regards
    Adil

  • What are the Advantages & Disadvantages of Global Variable at Package Level

    Dear Expprts
    Please tell me,
    What is mean by Global Variable?
    What are the Advantages and Disadvantages of Global Variable at Package Level against Private Variable?

    HI
    GLOBAL VARIABLE UR USE ANY BLOCK IN PLSQL
    BUT LOCAL VARIABLE USED ONLY THERE THEY DECLARE.
    REGARDS
    MOHAMMADI

  • What are the differences between attributes and variables?

    I am trying to develop a firmer understanding of the difference between attributes and variables. I understand attributes are lexically scoped to a class and variables are lexically scoped to the enclosing block. The lifetime of an attribute is linked to a class' instance. What is the lifetime of a variable? What is the lifetime of variables declared in a script file's top-level?

    It depend on whether the script is running in standalone mode or been called by others (library mode).
    If running as standalone, the variable of the script in the top level exists until the the script exit. If run as library mode, the variable in the top level of the script will never get to execute. Only the function and class available for call.
    Try calling another script with top level variable (place print statement to verify), you realize in library mode, it will never been called. That's why the main method as in Java is never needed because of this reason.

  • What is the best way to loop through TextFlow to find InlineGraphicElements?

    I have created a TextFlow and the images load fine, but I would like to loop through and update all the 'source' properties to change the images.  What is the best way to locate all the InlineGraphicElements in my TextFlow?
    Thanks!

    leaf = textflow.getFirstLeaf();
    while( (leaf = leaf.getNextLeaf()) != null)
    if(leaf is InlineGraphicElement)

  • What are the Scope Fields for in PageContext??

    There are 4 fields in javax.servlet.jsp.PageContext, what is there functionality and purpose?

    The page context is a facade pattern for all the namespaces associated with a JSP page - page, request, application, session. It unifies access to these objects (so you don't have to query all 4 to find what you're looking for). The attribute scope fields are used to indicate which namespace a particular attribute is associated with (and implicity, what the lifespan of that attribute is).

  • What is the BO 6.5 bouser variable equivalent in BO XI R2?

    We use <bouser> variable in BO 6.5 to implement row-level security.
    What is its equivalent in XI R2?
    Thank you.

    It's BOUser.
    But you might try DBUser as well - it' configurable for an Enterprise User in the Central Management Console, as "Secondary Credentials" for a Universe.
    Sincerely,
    Ted Ueda

  • What is the blue thing in shared variable?

    I'm going thorough a code which has huge set of shared variables and in some nodes I find a blue colored mark/thing just bottom left to the globe as shown below.  What does this indicates?
    Thanks,
    Ajay
    Solved!
    Go to Solution.

    I found the answers from my team member.  The blue mark actually indicates a dot and a slash ".\" which means Target Relative Shared Variable.  If the Shared Variable is Absolute, then this indication will not be shown.  To know more about the difference between Absolute and Target-Relative shared variable, check it out here.  A Shared variable node can be swtiched between Absolute and Relative using
    Context menu (right click the node)->Reference mode.
    Thanks,
    Ajay.

  • What's the easiest way to loop a video clip ?

    I just need a short .mov file to loop in the background behind a green screen shot.
    I don't need any green screen help, I just need to loop this short background file and can't figure out how to do it other than copying and pasting 20x which seems stupid. There must be a simple way ?
    Thanks for any help.

    Nothing at all happened to me.  You could do this: f9 until you're happy on a blank timeline. File export>qt movie>self contained.  Import that file, put it into your green screen timeline as the bottom layer.  you're still going to have to render it.
    In video production, as in other creative work there's a maxim:  Fast, good, cheap-- pick any two.

  • What is the scope of Live Customer Support in the Software and IT Industry?

    The Software and IT Industry is growing at a pace of 9.0% per year, with employment at Software consultancy and service firms projected to grow making it the second best industry to start and grow a business. With this pace of growth in the ruthless world of online business, only companies which succeed in creating their own niche will survive and make it big.
    Surviving this kind of competition demands a change in business strategy to create a loyal customer base, i.e. a solid investment in repeat visitors. One tool that can bring about this change in business strategy is the use of Live Chat.
    A Live Chat Operator’s role is a Software and IT Company website can be from navigation help and customer service to expert consultancy and making direct sales. Behind all of these roles though, is the constant element of the human touch on a website. Chat with a Live Operator can create an experience for web visitors which will make them come back. This creation of repeat web visitors will create a loyal customer base. This industry particularly relies on customer loyalty, since in the computers and electronics category repeat visitors are nearly 16 times more likely to make a purchase than new visitors with conversion rates of 23.12 percent and 1.49 percent respectively.
    Apart from creating repeat visitors on Software Company’s website, Live Chat Operators can do the following:
    1.     Win loyalty by providing top level service on your online store
    2.     Provide real-time answers about models, year and price of the electronics or computers that visitors are looking for.
    3.     Show items; push pages and take visitors directly to the model/price range they are looking into.
    4.     Use three dimensional images to show products.
    5.     Generate leads.
    6.     Provide consultancy on items keeping in view customer needs and price range
    7.     Update visitors on Promotional Offers,
    8.     8. Improve Multitasking in Customer Service and Sales Staff.
    Live Chat is a medium which takes online customer service to an unparalleled level; the days of static web information and the email black hole are long gone.
    Source:
    http://www.liveadmins.com

    Hi Dkdinesh,
    Excelent links provide by M.R.AshwinPrabhu!
    In 2014, Microsoft will release BizTalk Server 2013 R2 (release date will be soon) and also will keep investing and improving Microsoft Azure BizTalk Services-
    Microsoft goal in terms of Release Cadence of BizTalk Server is to have one major release every alternate year (the last one was BizTalk Server 2013, so you may expect a new major release in 2015) and one minor release every alternate year (that will be
    designated R2, so the next on is BizTalk Server 2013 R2). The major release will have new features and themes and minor releases will have bug fixes, platform alignment and customer asks.
    Sandro Pereira
    DevScope | MVP & MCTS BizTalk Server 2010
    http://sandroaspbiztalkblog.wordpress.com/ |
    @sandro_asp
    Oporto BizTalk Innovation Day | 14th March 2013 – Oporto, Portugal
    Please mark as answered if this answers your question.

  • What are the new instruments and loops included with 7.2?

    Subject says it all.
    Thanks

    •New instruments: Radio Sounds, Nature Sounds, Comedy Noises, Applause and Laugher.
    •New loops: 520 loops in iLife Sound Effects folder.
    I may be wrong! I haven't installed 7.2 yet.

  • System.properties (what is the scope in memory)

    Does each JVM have it's own System properties? Hence calls from one JVM System.getProperty() or System.setProperty() should be within each individual JVM? Also I need to know this so that I can gurantee that using the System properties for private information won't be accessed by anyone else on the system... Any input?

    System properties are unique for each VM, they are therefore visible to all code running in the VM.
    This seems like a good thing to use for storing things like passwords because of the global visibility however using the System properties for storing such things has to be considered as being insecure.
    System properties should be regarded as a place to read data from that is relevant for either the Java runtime environment or for setting component specific properties, XML Parsers make use of this for example. Using System properties as an in memory database is neither secure nor sensible. Careless selection of keys for the properties you wish to store can have unexpected results if you accidentally overwrite a property that is used for other purposes.
    I would use a separate Properties instance that has nothing to do with the System properties and I would also recommend the encryption of sensitive data like passwords.

Maybe you are looking for

  • New OS from ATT a step back?

    Can anybody tell me what the new OS from ATT was suppose to fix? So far 90% apps don't run which I guess might be normal with a new OS. But BB world is slow to  load now on wifi and almost impossible when I'm on 3g. Did download rhw theme app which h

  • Screen in the ipad 2 is not working but not warranty because of scratches in the back?

    I recently bought an Ipad 2 with apple care, suddenly few days ago the screen stopped working. I reset, restored everything with no success. After speaking with the customer support over the phone several times (almost 100$ in phone bill!!!) they tol

  • How to use JNDI with JSPDYNPAGE?

    Hi Experts, Im having trouble looking up my deployed java proxy that is on WAS. When I try to lookup it through my JSPDYNPAGE portal component, it throws this error: #1.5 #00E0ED0BA5EF00710000002600000F92000453A6B0EEF782#1217875304970#System.err#sap.

  • Return to relevant row after a data refresh

    After updating a record and applying a Spry data refresh, the first row is highlighted instead of the row that was modified. Going through all of the documentation, I found the following possible solution were it not for the fact that I cannot find a

  • Bios complaing about bad partition

    the disk is partitioned in gpt with gdisks. and a bios boot partition is made in sector 34-2047 for grub-bios. and i am not using uefi. the bios complains for the bad partition, but after i press enter, the laptop boots correctly as intended. i dd'ed