Dynamic reference

Hi Experts,
I need to make my select statement completely DYNAMIC i.e. including names of fields and variables into which they are going to be stored and also the processing logic - in following way:
TABLES: PA0001.
DATA: BEGIN OF WA,
     PERNR TYPE PERSNO,
     END OF WA.
DATA: lv_f1(5) TYPE c.
PARAMETERS: p_pernr TYPE persno.
lv_f1 = 'PERNR'.
SELECT single (lv_f1) FROM pa0001 INTO WA-(LV_F1) WHERE pernr = p_pernr.
  IF sy-subrc = 0.
    WRITE:/ WA-(lv_f1).
  ENDIF.
But the above code is whoing errors...... can you please suggest me how to correct the errors.....
Regards
Vasu

Earlier response deleted.
You cannot use dynamic tokens with INTO , SAP documentation says:
For the specification of target, there is no dynamic variant that corresponds to the other additions. Instead, you can work with dynamically created data objects (see the example for CREATE DATA).
Check this code snippet:
TYPES: BEGIN OF ty,
pernr TYPE persno,
END OF ty.
PARAMETERS: p_pernr TYPE persno.
DATA: dref TYPE REF TO data,
      lv_f1 TYPE fieldname.
FIELD-SYMBOLS: <wa> TYPE ANY,
               <val> TYPE ANY .
CREATE DATA dref TYPE ty.
ASSIGN dref->* TO <wa>.
lv_f1 = 'PERNR'.
SELECT SINGLE (lv_f1) FROM pa0001
INTO <wa>  "-->Change this
WHERE pernr = p_pernr.
IF sy-subrc = 0.
  ASSIGN COMPONENT lv_f1 OF STRUCTURE <wa> TO <val>.
  IF sy-subrc = 0.
    WRITE / <val>.
  ENDIF.
ENDIF.
Edited by: Suhas Saha on Jun 16, 2010 2:48 PM

Similar Messages

  • Service Registry XSD dynamic reference not working

    Hi ,
    I have published an employee canonical schema to service registry. I have referenced it in my BPEL in my wsdl file as follows
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://systinet.com/uddi/demo/employeeList" schemaLocation="employees.xsd" id="uddi:company:HR:EmployeeCanonical" />
              </schema>
    I have deployed the BPEL and is working fine. When I updated the service registry to point to the lastest version of canonical file , the BPEL is not reflecting to the new version. I have bounced both bpel server and reg. service but still no difference.
    please let me know how I can dynamically reference the xsd in service registry.
    appreciate your help.
    thanks
    Srini

    Hi
    I am having trouble making the BPEL and Systinet to work together. I have Systinet and BPEL installed separately on 2 different servers. I deployed my web services and registered them in UDDI. I created a new BPEL process and added a partner link to refer to one of the web service I have registered in UDDI. When I create the partner link, it is forcing me to give the wsdl and it also gives an error message " There are no partner link types defined in current wsdl. Do you want create that will by default create partner link type for you?". If I say "NO' then deployment fails. If I say "Yes", then it creates a new wsdl file on the local server etc and gives "<Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 75164a0815ea471a:-3be8c246:117cc377894:-537b. Please check the process instance for detail.</faultstring>". Any help is appreciated.

  • Dynamically reference :old.column_ name in trigger

    Hi all,
    I am writing an application for which i would like to include a limited audit trail.
    I have a form that is based on a table with approx 100 columns and wish to write the :old.column_name value on fields that have been updated, along with userid and date/time to an "audit" table.
    I think that I can do this by using the Before_update trigger and then the IF UPDATING ('column name') condition. However, for maintenance and readabiility, I wish to be able to dynamically reference the :old.column_name value, which I cannot get working.
    I know it can be done with a large IF statement, but due to the number of columns involved, this can lead to a maintenance nightmare. Also, if I can get this working, I want to include the procedure in a library for other applications, thus the need for dynamically referencing the table and column names.
    My proposed logic for the before_update trigger is:
    Declare Vcolumn_name Varchar2(50)
    Get column names for table (using select cursor)
    loop through cursor
    Vcolumn_name := column name
    IF UPDATING (Vcolumn_name) then
    insert userid, timestamp, :old.Vcolumn_name into audit table
    end IF
    next cursor row
    :old.Vcolumn_name is where I am having trouble.
    Is this possible?
    Thanks
    Peter

    The pre-update trigger won't store the value of the old.column . If you are querying the data and then updating then use the POST-QUERY trigger to store the current values in global variables. In the PRE-UPDATE trigger assign the global variables to the columns of the audit tables.
    For instance in the PRE-FORM trigger initialize the global variables :
    :GLOBAL.VAR1 := ' ';
    :GLOBAL.VAR2 := ' ';
    In the POST-QUERY trigger
    :GLOBAL.VAR1 := :BLOCK.COLUMN1;
    :GLOBAL.VAR2 := :BLOCK.COLUMN2;
    In the PRE-UPDATE trigger
    INSERT INTO AUDIT_TABLE (COL1, COL2)
    VALUES(:GLOBAL.VAR1, :GLOBAL.VAR2);
    Hope this helps.

  • How do i dynamically reference the contents of an item in a where clause

    I have a select statement that references an item i.e. 'where sysdate=:diary.day1' at the moment, however i want to use this select to loop through every day of the week, so on the fist record it will change depending on where you are in the loop either 'where sysdate=:diary.day1' or 'where sysdate=:diary.day2' etc. I tried using a variable for this but it just uses the characters ':diary.day1' and not the contents of this item.

    Not sure what you want but dynamic reference the content of an item may be done with NAME_IN builtin.
    WHERE sysdate = TO_DATE( NAME_IN(var), 'fmt')
    where var is a variable which contain item name, for example 'DAIRY.DAY1'
    P.S. SYSDATE function contain not only date but time portion too.
    So very little chances that this equation will be true

  • Dynamic Reference to Registered XSD

    I generate docs from SELECT like this,
    <span style="color:red;">(I do not store this type of doc in DB/XDB)</span>:
    <div style="color:blue;">
    SELECT '&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;' || chr(10) ||
    xmlelement
    (&quot;ReinsuranceXfer&quot;,
    xmlattributes
        ('http://blah.com/blah2/types/common' AS &quot;xmlns&quot;,
         'http://www.w3.org/2001/XMLSchema-instance' AS &quot;xmlns:xsi&quot;,
         'http://blah.com/blah2/types/common http://blah3/xmlschemas/Sales_v1.xsd'
         AS &quot;xsi:schemaLocation&quot;),
     xmlelement
        (&quot;SalesTransactions&quot;,
         xmlattributes('DirectTransactions' AS &quot;xsi:type&quot;).......
    </div>
    the schema &quot;Sales_v1.xsd&quot; is XDB-registered.
    In stead of hard-coding <strong>&quot;Sales_v1.xsd&quot;</strong> in PL/SQL or View definition
    I want to DYNAMICALLY reference the value, so when I switch to
    version 2, registering the new schema (deleting the old one)
    the value <strong>&quot;Sales_v2.xsd&quot;</strong>
    can be dynamically referenced.
    Is there a better/&quot;smarter&quot; way to achieve the dynamic reference
    than this ?
    <div style="color:blue;">
    SELECT substr(any_path, instr(any_path, '/', -1) + 1) xsd
        FROM resource_view
       WHERE any_path LIKE '%Sales%.xsd';
    </div>
    thanks
    10gr2

    You can't invoke methods on bits of String as if they were references to objects. (Java isn't like PHP in this regard.)
    You can, however, use arrays as db suggested.
    Let's say I have a hundred toggle buttons. I might give them names like "okButton" "exitButton" etc. Or I might make them elements of an array of buttons, buttonArr.
    And I have a method toggle(int) that accepts an integer as input and verifies that the argument is within the range 1 to 100, throwing an exception if it is not. This method is intended to select the toggle button that corresponds to the integer it receives as input as selected. So the method would be implemented as
    buttonArr.setSelected(true);

  • Dynamic reference to buttons

    Hi all,
    I'd like to make dynamic references to togglebuttons (I'm using netbeans). In pseudo code, I would like to be able to do something like:
    For(int i = 1, i<10, i++){
    buttonName = toggleButton;
    buttonName.concat(numToString(i));
    convert buttonName to handler 'handle'
    handle.setSelected(true);
    With classes, it seems to me that I could use Class.forName, but I have no idea how to make this work for an interface element, and I can't find it on the web.
    Any help is welcome, thanks!
    Edited by: jefke33 on Jun 20, 2009 1:12 PM
    Edited by: jefke33 on Jun 20, 2009 1:13 PM

    You can't invoke methods on bits of String as if they were references to objects. (Java isn't like PHP in this regard.)
    You can, however, use arrays as db suggested.
    Let's say I have a hundred toggle buttons. I might give them names like "okButton" "exitButton" etc. Or I might make them elements of an array of buttons, buttonArr.
    And I have a method toggle(int) that accepts an integer as input and verifies that the argument is within the range 1 to 100, throwing an exception if it is not. This method is intended to select the toggle button that corresponds to the integer it receives as input as selected. So the method would be implemented as
    buttonArr.setSelected(true);

  • How can I dynamically reference a sheet based upon the contents of a cell

    I'm using Numbers to store specifications for various products. Each sheet stores specifications in a standard manner (i.e. same table and cell names) and the sheet is named according to the name of the product.
    On another sheet I've got a dropdown list containing the names of the product tabs. I'd like to dynamically pull data for a particular product when it's sheet is selected in the dropdown list by using the dropdown cell in a reference like:
    =B1::STC::A4, where B1 is the dropdown list and STC::A4 is the product specification table and cell reference.
    When I use this, the B1 reference fails.
    Any suggestions would be greatly appreciated.
    Thanks.

    Amos,
    you will have to use the indirect function to convert the string you are creating into a valid reference.
    Note:  The Sheet names, Table names and cell references must all match exacty.
    If the sheets are named "B1", "C1" and "D1" and the popup menu is in the cell A1 and contains the strings:
    B1
    C1
    D1
    The table name is "STC"
    then you can create a valid reference like this:
    = indirect(A1&"::STC::A4")
    if the table name were also dynamic and were stored in cell A2 you could create the reference like this:
    = indirect(A1&"::"&A2&"::A4")

  • Dynamic references to trigger vars :new and :old

    Is there any way to dynamicly refer to the :old and :new bind
    variables available in triggers?
    I'm looking for a method to make a standard processing system
    that processes based on column-names. I want to avoid calling my
    handling system staticly for each field in the table.
    Ie. I want to refer to :old.data_column in a way where I can
    loop through all the fields of the table.
    Hints, tips and ideas would be greatly apprechiated.

    You can't have dynamic PL/SQL containing ":NEW" or ":OLD" in
    database triggers.
    But in some cases, if your table has primary key (PK)
    or unique key (UK), you can use AFTER STATEMENT triggers
    in following way
    (this is like well-known solution for mutating error problem):
    1. create database package with PL/SQL table
    (for storing PK values)
    2. clear PL/SQL table in BEFORE STATEMENT trigger
    3. populate PL/SQL table with PK value
    in BEFORE (or AFTER) ROW trigger
    4. read rows in AFTER STATEMENT trigger with dynamic PL/SQL,
    using PKs from PL/SQL table and using dynamically selected
    column names with statement
    SELECT column_name
    FROM user_tab_columns
    WHERE UPPER (table_name) = UPPER (p_table);"
    (you can read NEW values of columns and,
    with AUTONOMOUS_TRANSACTION, OLD values too)
    For example (scott.dept table):
    CREATE OR REPLACE TRIGGER bus_dept
    BEFORE UPDATE ON dept
    BEGIN
    plsql_table.clear;
    END;
    CREATE OR REPLACE TRIGGER bur_dept
    BEFORE UPDATE ON dept
    FOR EACH ROW
    BEGIN
    plsql_table.populate_with_id (:NEW.deptno);
    END;
    CREATE OR REPLACE TRIGGER aus_dept
    AFTER UPDATE ON dept
    DECLARE
    v_current_id dept.deptno%TYPE;
    BEGIN
    dynamic_new_old.set_table_name ('dept');
    dynamic_new_old.set_pk_name ('deptno');
    dynamic_new_old.create_column_names;
    WHILE plsql_table.id_exists LOOP
    v_current_id := plsql_table.current_id;
    DBMS_OUTPUT.PUT_LINE ('OLD VALUES:');
    dynamic_new_old.display_old_values (v_current_id);
    DBMS_OUTPUT.PUT_LINE ('NEW VALUES:');
    dynamic_new_old.display_new_values (v_current_id);
    DBMS_OUTPUT.PUT_LINE ('*****');
    END LOOP;
    END;
    CREATE OR REPLACE PACKAGE plsql_table IS
    PROCEDURE clear;
    PROCEDURE populate_with_id (p_id dept.deptno%TYPE);
    FUNCTION id_exists RETURN BOOLEAN;
    FUNCTION current_id RETURN dept.deptno%TYPE;
    END;
    CREATE OR REPLACE PACKAGE BODY plsql_table IS
    TYPE type_plsql_table IS TABLE OF dept.deptno%TYPE INDEX BY
    BINARY_INTEGER;
    m_plsql_table type_plsql_table;
    -- prefiks m_ is for module level variable (defined in package
    body)
    -- prefiks g_ is for global variable (defined in package
    specification)
    m_rec_number BINARY_INTEGER;
    PROCEDURE clear IS
    BEGIN
    m_rec_number := 0;
    END;
    PROCEDURE populate_with_id (p_id dept.deptno%TYPE) IS
    BEGIN
    m_rec_number := m_rec_number + 1;
    m_plsql_table (m_rec_number) := p_id;
    END;
    FUNCTION id_exists RETURN BOOLEAN IS
    BEGIN
    RETURN (m_rec_number > 0);
    END;
    FUNCTION current_id RETURN dept.deptno%TYPE IS
    v_id dept.deptno%TYPE;
    BEGIN
    v_id := m_plsql_table (m_rec_number);
    m_rec_number := m_rec_number - 1;
    RETURN v_id;
    END;
    END;
    CREATE OR REPLACE PACKAGE dynamic_new_old IS
    PROCEDURE set_table_name (p_table VARCHAR2);
    PROCEDURE set_pk_name (p_pk VARCHAR2);
    PROCEDURE create_column_names;
    PROCEDURE display_old_values (p_id dept.deptno%TYPE);
    PROCEDURE display_new_values (p_id dept.deptno%TYPE);
    END;
    CREATE OR REPLACE PACKAGE BODY dynamic_new_old IS
    m_table VARCHAR2 (30);
    m_pk VARCHAR2 (30);
    m_columns VARCHAR2 (1000);
    PROCEDURE set_table_name (p_table VARCHAR2) IS
    BEGIN
    m_table := p_table;
    END;
    PROCEDURE set_pk_name (p_pk VARCHAR2) IS
    BEGIN
    m_pk := p_pk;
    END;
    PROCEDURE create_column_names IS
    v_first_column BOOLEAN;
    BEGIN
    v_first_column := TRUE;
    FOR rec IN
    (SELECT column_name
    FROM user_tab_columns
    WHERE UPPER (table_name) = UPPER (m_table))
    LOOP
    IF v_first_column THEN
    v_first_column := FALSE;
    m_columns := 'v_record.' || rec.column_name;
    ELSE
    m_columns := m_columns ||
    '||' || '''--''' || '|| v_record.' || rec.column_name;
    END IF;
    END LOOP;
    END;
    PROCEDURE display_values (p_id dept.deptno%TYPE) IS
    v_cursor INTEGER;
    v_rows_processed INTEGER;
    v_statement VARCHAR2 (32000);
    BEGIN
    v_statement :=
    ' DECLARE ' ||
    ' v_record ' || m_table || '%ROWTYPE;' ||
    ' BEGIN' ||
    ' SELECT * INTO v_record' ||
    ' FROM ' || m_table ||
    ' WHERE ' || m_pk || ' = ' || p_id || ';' ||
    ' DBMS_OUTPUT.PUT_LINE (' || m_columns || ');' ||
    ' END;';
    v_cursor := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (v_cursor, v_statement, DBMS_SQL.V7);
    v_rows_processed := DBMS_SQL.EXECUTE (v_cursor);
    DBMS_SQL.CLOSE_CURSOR (v_cursor);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE (sqlerrm);
    IF DBMS_SQL.IS_OPEN (v_cursor) THEN
    DBMS_SQL.CLOSE_CURSOR (v_cursor);
    END IF;
    END;
    PROCEDURE display_old_values (p_id dept.deptno%TYPE) IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    display_values (p_id);
    END;
    PROCEDURE display_new_values (p_id dept.deptno%TYPE) IS
    BEGIN
    display_values (p_id);
    END;
    END;
    Note that this code is not generic, because uses
    "dept.deptno%TYPE". If all your PKs has the same declaration
    (for example NUMBER), then you can write generic solution.
    If you need only OLD values, you can write a simpler solution
    (without statement triggers and "plsql_table" package),
    using "dynamic_new_old" package and AUTONOMOUS_TRANSACTION
    in BEFORE (or AFTER) ROW trigger.
    Regards
    Zlatko Sirotic

  • Dynamic reference for movieclips

    I have read several examples both on the web and in the Adobe
    help files regarding dynamic referencing.
    I cannot get Actionscript to recognize a dynamically named
    clip such as in the attached for loop.
    Any suggestions as to why thumbCan[thumbMC+i] returns
    undefined and therfore doesn't allow anything to be loaded?

    trace("trace1= "+thumbCan["thumbMC"+i]);

  • In FR, how to create dynamical reference column

    In FR, can we do something like below:
    I have scenarios in the column header; while in column 1, scenario is selected from the current point of view, for example when I select Budget, I would like in column 2 to be the Actual; If I select Forecast in column 1, and I would like Budget in column 2, etc.
    Any suggestion/advise is welcome.
    Thanks

    Thanks for the reply.
    However, I was not able to find the conditional suppression based on the other column's member name (can only suppress based on its own column member name, data cell, or data cell values, etc).
    Also my requirements is a bit complicated. I also have year as my column header. I have year 2007 to 2009, and scenarios: actual, budget, F1, F2, F3.
    If I choose 2009 for example, Budget, I would like the 2nd column to be 2008 F3; If I choose 2008 F1, I would like the 2nd column to be 2008 Budget; if I choose 2008 F2, I would like the 2nd column to be 2008 F1, and so on.
    Any suggestions/advices ?

  • Field Symbols and Dynamic references

    Hello,
    I have Two internal tables Itab1 and Itab2 which are containing MATNR as field.
    Itab1-matnr contains the value as 123;456;789.
    I have two more Field-symbols Var1 and var2 which contains the values as <Var1> = itab1-matnr
                           <var2> = itab2-matnr.
    now i wanted to split contents of Itab1-matnr.
      split <var1> at ';' into <var2> <var1>.
    By this, my expected result is 123 into Itab2-matnr and 456;789 into itab1-matnr.
    How can i do this? now Var1 contains the value as itab1-matnr, but not the contents of itab1-matnr ( But not 123;456;789) .
    Pleasde help me in solving this.

    Hello Rajesekhar,
    U can try this...
    I have used fields instead of internal table.
    data: itab1 like mara-matnr value '123;456;789',
          itab2 like mara-matnr.
    data: begin of itab3 occurs 0.
    data:  fld(50).
    data end of itab3.
    field-symbols: <fs1> type any,
                   <fs2> type any.
    assign itab1 to <fs1>.
    assign itab2 to <fs2>.
    search <fs1> for ';'.
    sy-fdpos = sy-fdpos + 1.
    <fs2> = <fs1>(sy-fdpos).
    <fs1> = <fs1>+4.

  • ERROR: "Dynamic Reference Initialization failed"

    Howdy!I am trying to build an outline on the "Client" side of the App Manager. Ever time I try to run a load rule to build portions of the ouitline, I get the error in the subject of this message. Is the "Client" portion of App Manager limited in functionality?Please advise.Thank you very much!JR

    Thanks for responding! I was only trying to use the Load Rules to build the dimensions, not load any data. They must be the same mechanism. They should not allow you to build load rules locally if they can't be executed.Thanks again!JR

  • Re: Dynamic reference to an attibut name

    Allen Vachon wrote:
    Hi,
    One solution should be to generate at run-time your textgraphics in
    a gridfield (TextGraphic.Parent = GridField with row and column
    affectation).
    Then you can address them by CompoundField.Children.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    >
    Hi Fort&eacute; developer,
    I'm trying to create a calendar screen. Each cell are "TextGraphic"
    widgets.
    There is 6 months, each has 6 weeks and of course, 7 days. I named
    them "M?W?D?" (M->Month; W->Week; D->Day). How can I do something
    like that (if possible) or another way?
    [Month 1] [Month 2] [Month 3]
    [Month 4] [Month 5] [Month 6]
    Problem: There is 252 objects to change, which is too much to handle.
    One possible solution is to have only one month displayed instead of
    6.
    -- [M1W1D1...M1W1D7] [M2W1D1...M2W1D7] ...
    -- [M1W6D1...M1W6D7] [M2W6D1...M2W6D7] ...
    for MonthNumber in 1 to 6
    for WeekNumber in 1 to 6
    for DayNumber in 1 to 7
    self.M<MonthNumber>W<WeekNumber>D<DayNumber>.State =
    FS_DISABLE;
    end for;
    end for;
    end for;
    Thanks all and good long weekend.
    Allen Vachon
    [email protected]
    Office: (819) 595-1794
    FAX: (819) 595-8783-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Allen Vachon wrote:
    Hi,
    One solution should be to generate at run-time your textgraphics in
    a gridfield (TextGraphic.Parent = GridField with row and column
    affectation).
    Then you can address them by CompoundField.Children.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    >
    Hi Fort&eacute; developer,
    I'm trying to create a calendar screen. Each cell are "TextGraphic"
    widgets.
    There is 6 months, each has 6 weeks and of course, 7 days. I named
    them "M?W?D?" (M->Month; W->Week; D->Day). How can I do something
    like that (if possible) or another way?
    [Month 1] [Month 2] [Month 3]
    [Month 4] [Month 5] [Month 6]
    Problem: There is 252 objects to change, which is too much to handle.
    One possible solution is to have only one month displayed instead of
    6.
    -- [M1W1D1...M1W1D7] [M2W1D1...M2W1D7] ...
    -- [M1W6D1...M1W6D7] [M2W6D1...M2W6D7] ...
    for MonthNumber in 1 to 6
    for WeekNumber in 1 to 6
    for DayNumber in 1 to 7
    self.M<MonthNumber>W<WeekNumber>D<DayNumber>.State =
    FS_DISABLE;
    end for;
    end for;
    end for;
    Thanks all and good long weekend.
    Allen Vachon
    [email protected]
    Office: (819) 595-1794
    FAX: (819) 595-8783-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Dynamically Reference Position within Absolute Path in XSL

    All---
    I have a file that I am parsing into many records. However, much of the information is duplicated and I do not want to considerate for my XSL. For this reason, I need to add logic to filter out those records that have the same account number as the previous record. It would seem that the best way to do this would be an "if" statement that compares the account number from the record in question to the account number in the previous record. This is what I have come up with:
    <xsl:for-each select="/imp1:container/imp1:Record">
    <xsl:if test='(position() = "1") or (imp1:Patient/imp1:AccountNumber != /imp1:container/imp1:Record[(position() - 1.0)]/imp1:Patient/imp1:AccountNumber)'>
    As you may have guessed, this does not work. Any thoughts?
    Thanks, Eric

    I tried my solution with Saxon 8.8 and Oracle XDK 10.2.0.2
    I created a source XML document of:
    <container xmlns="urn:foo">
      <Record>
        <Patient>
           <AccountNumber>101</AccountNumber>
           <Something>Y</Something>
        </Patient>
      </Record>
      <Record>
        <Patient>
           <AccountNumber>101</AccountNumber>
           <Something>Y</Something>
        </Patient>
      </Record>
      <Record>
        <Patient>
           <AccountNumber>102</AccountNumber>
           <Something>Y</Something>
        </Patient>
      </Record>
    </container>and an XSLT stylesheet of:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:imp1="urn:foo" version="1.0">
      <xsl:output method="text"/>
      <xsl:template match="/">
      <xsl:for-each select="/imp1:container/imp1:Record">
        <xsl:variable name="prevRec" select="preceding-sibling::imp1:Record"/>
        <xsl:variable name="curAcctNum" select="imp1:Patient/imp1:AccountNumber"/>
        <xsl:variable name="prevAcctNum" select="$prevRec/imp1:Patient/imp1:AccountNumber"/>
        <xsl:if test='not($prevRec) or $curAcctNum != $prevAcctNum'>
           <!-- etc. -->
           <xsl:value-of select="imp1:Patient/imp1:AccountNumber"/>
           <xsl:text>&#xa;</xsl:text>
        </xsl:if>
      </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>Which produces an output on the command line of:
    101
    102So it seems to be correctly ignoring the duplicate entries. Is something about my test source data not mimicking faithfully enough your situation?

  • Dynamic MovieClip reference

    Okay, how does one reference a MovieClip instance dynamically in AS 3.0?
    Example, I create a new instance of a "marker" MovieClip class that inherently has within it a series of embedded MovieClips labeled: "m1", "m2", "m3" etc ... and I want to be able to dynamically reference those embedded MCs.  I used to do this all the time in AS 2.0, and can't recall how to do it in AS 3.0.
    I know it is something like this:
    number = 1;
    marker = new StaticMarker();
    var thisMarker = this.marker.m[number];
    thisMarker.visible = true;

    Try:
    var thisMarker:MovieClip = this.marker["m"+number];

Maybe you are looking for

  • Saving to a database

    Is is possible to save information automatically from a program to a database or some other data storage structure where it can be easily read from when the program re-loads. I doesn't need to be anything online just a simple file stored locally whic

  • Syncing video and audio

    I have been syncing video and audio into a sequence and using those sequences in a new master sequence. Is that the right way to do it? Is there a way to have the video and audio in a useable clip? I could not find this information in the manual, but

  • ITunes not displaying iPod info

    I just bought a 32gb 4th gen iPod. I installed the latest version of iTunes on my PC. Under devices it lists my iPod but in the main window it doesn't show any information. I have completely removed and re-installed iTunes and restored the iPod to de

  • Sharepoint 2010 Webpart debugging - Writing to the console

    I am creating a SharePoint 2010 Webpart, and I'd like to write to the console for debugging purposes. Unfortunately the command Console.Writeline doesn't seem to work for me. How do I fix this??

  • Linksys 4200 and ddclient in ubuntu server 10.04

    I am trying to host my domain on my linuxserver at home. I am using ddclient for dynamic ip through zoneedit. I would use dyndns but it not free for dynamic ip.. if it is please tell me how. anyway this is the ddclient.conf daemon=300 pid=var/run/ddc