Variable Use in For-Each statement

Hello Gurus-
I am having an issue using a variable i've created in a for each statement. Here is the code i'm using
My objective is to create a variable based on the kind of invoice. If the invoice is a proof or reprint, one copy should be printed. If it's a final invoice, I need two copies.
<?xdoxslt:set_variable($_XDOCTX, 'x', 0)?>
for-each<?if: Print_Additional_Header_Text_ID238='PROOF'?><?xdoxslt:set_variable($_XDOCTX, 'x', 1)?><?end if?>
<?if: Print_Additional_Header_Text_ID238='REPRINT'?><?xdoxslt:set_variable($_XDOCTX, 'x', 1)?><?end if?>
<?if:not ( Print_Additional_Header_Text_ID238)?><?xdoxslt:set_variable($_XDOCTX, 'x',2)?><?end if?>
<?xdoxslt:get_variable($_XDOCTX,'x')?><?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)?>
for-each is the loop i'm using to repeat sections of the invoice.
When I run the preview with the last for-each print, i get an error that says "variable not defined:'x' "
But when i remove the last for each the correct variable, 1 or 2, will show in the invoice.
My question is: How can I use the variable 'x' in <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)?>
TIA
Darius
Edited by: 852460 on May 24, 2011 8:31 AM
Edited by: DEK17 on Jul 20, 2011 1:15 PM

Probably, this will help
http://winrichman.blogspot.com/search/label/multiple%20copy
Try
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,get_variable($_XDOCTX, 'x'),1)?>
or
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,xdoxslt:get_variable($_XDOCTX, 'x'),1)?>

Similar Messages

  • Problem For/Each statement (or the problem is the MouseListener...)

    Hi guys,
    I'm making a program in java for school.
    Now I have this:
              for(Stap2TrampolineModel trampoline : lijstTrampolines)
                   trampoline = new Stap2TrampolineModel(0,215,100,"Poing",lijstKinderen); //model
                   trampolineView = new Stap2TrampolineView(trampoline); //view
                   trampolineController = new Stap2TrampolineController(trampoline, trampolineView); //controller
                   trampolineView.setBounds(trampoline.getXInvoer(),trampoline.getYInvoer(),trampoline.getFormaat()+1,20);
                   add(trampolineView);
                   repaint();
    and in the mouselistener this:
    public void mouseClicked( MouseEvent e )
              System.out.println(lijstTrampolines.size());
              // Onderzoek of met de rechterknop is geklikt
    if( e.isMetaDown() )
         // x = e.getX(); (for later needs)
    //y = e.getY(); (for later needs)
    lijstTrampolines.add(trampoline);
    repaint();
    The program should display a "trampoline" when I click...but it doesnt. It is added to the list, because I can see that in the console because of the System.out.println
    But it doesn't show the display I want. When I delete the for each statement, it does show the "trampoline". So the mouselistener works (it gets added when I click) and the arraylist works (it shows that in the console), but the for each statement doesnt work...
    Anyone knows how to solve this problem?

    Where is this foreach loop located? In inialisation presumably. But that's over and done with when your mouseListener is called. I'd guess your list is empty when the loop is called, and it does nothing.
    Your mouse listener, when it adds a trampoline must also add a trampoline view object. And the repaints don't do you any good, use revalidate() after adding a trampoline view to recalculate the layout.

  • Set height size for each state enabling browser scrollbar if needed..

    I'm working on a flex project, completely new to it. I'm trying to resize my application based on the set height size for each state. I'd like the wrapper to resize in the browser so that the  browser's scroll bar appears if needed. hope this makes sense....
    My enitial opening page I've set the height to 1000. now when I click on a link to another state from this page, we'll call it 'home' which i have set to 2000
    The page opens in its 2000 height but no scroll bar appears to scroll down in the browser...
    If anyone's done this or knows how to, I'd really appreciate your input.

    I've done something similar with a few of my apps, you have to use a little javascript on the html page and the ExternalInterface class in your app. Basically, you need to resize the "browser's" height based on your flash file.  So here's quick example:
    In your html template page (which you can edit in your flashbuilder project panel ->html-template->indext.template.html)
    in your html add the jscript function:
    <script type="text/javascript">
             function setWindowHeight(heightVal){
                 document.getElementById('theWindow').style.height=heightVal; // make sure to give the body tag an id of 'theWindow' or whatever
    </script>
    In your flashbuilder app you need to call the javascript fx, you can use the ExternalInterface class for this:
      ExternalInterface.call('setWindowHeight',val+'px');
    you need to send the jscript fx the height of your container or whatever you want it resized to....

  • Using Images for each button

    I am trying to create a spry menu that has 5 buttons and each button will have 3 different images for each state (something like this http://jjcstudios.com/woof_wallet/ ) I was going to use the insert > navigation bar but I read that this method creates a lot of extra javascript and they recommended using Spry instead. Can anyone point me in a direction to create a clean method of doing java rollovers or modifying the spry menu so it will work as a rollover. thanks john

    John,
    To place the javascript in an external file, grab the code that is producedon the page
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_nbGroup(event, grpName) { //v6.0
      var i,img,nbArr,args=MM_nbGroup.arguments;
      if (event == "init" && args.length > 2) {
        if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
          img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
          if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
          nbArr[nbArr.length] = img;
          for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
            if (!img.MM_up) img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } else if (event == "over") {
        document.MM_nbOver = nbArr = new Array();
        for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
          nbArr[nbArr.length] = img;
      } else if (event == "out" ) {
        for (i=0; i < document.MM_nbOver.length; i++) {
          img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
      } else if (event == "down") {
        nbArr = document[grpName];
        if (nbArr)
          for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
        document[grpName] = nbArr = new Array();
        for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
          nbArr[nbArr.length] = img;
    and place it in a file called menu.js or similar.
    In your page place the following in between the <head></head> tags
    <script src="menu.js" type="text/javascript"></script>
    to link the Javascript.
    If you want to put menu.js in a different folder, make sure you adjust the link accordingly, like "js/menu.js"
    Ben

  • Open several PDFs in the same Reader window using tabs for each document

    How do I open several PDFs in the same Reader window using tabs for each document?  I'm using Reader 11.0.03 and Windows 7.  

    That would be a nice feature!  Suggest it at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform - hopefully it will make it into Reader XII.

  • GROUP BY - Is there a way to have some sort of for-each statement?

    Hi there,
    This discussion is a branch from https://forums.oracle.com/thread/2614679
    I data mart I created for a chain of theatres. The fact table contain information about ticket sales, and I have a some dimensions including DimClient and DimTime.
    Here is an example of each table:
    FactTicketPurchase
    TICKETPURCHASEID
    CLIENTID
    PRODUCTIONID
    THEATREID
    TIMEID
    TROWID
    SUMTOTALAMOUNT
    60006
    2527
    66
    21
    942
    40
    7
    60007
    2527
    72
    21
    988
    36
    6
    60008
    2527
    74
    21
    1001
    40
    6
    60009
    2527
    76
    21
    1015
    37
    6
    60010
    2527
    79
    21
    1037
    39
    6
    DDL for FactTicketPurchase
    CREATE TABLE FactTicketPurchase(
    TicketPurchaseID NUMBER(10) PRIMARY KEY,
    ClientID NUMBER(5) CONSTRAINT fk_client REFERENCES DimClient,
    -- ProductionID NUMBER(5) CONSTRAINT fk_prod REFERENCES DimProduction,
    -- TheatreID NUMBER(5) CONSTRAINT fk_theatre REFERENCES DimTheatre,
    TimeID NUMBER(6) CONSTRAINT fk_time REFERENCES DimTime,
    -- TRowID NUMBER(5) CONSTRAINT fk_trow REFERENCES DimTRow,
    SumTotalAmount NUMBER(22) NOT NULL);
    DimClient
    CLIENTID
    CLIENT#
    NAME
    TOWN
    COUNTY
    2503
    1
    LEE M1
    West Bridgford
    Nottingham
    2504
    2
    HELEN W2
    Hyson Green
    Nottingham
    2505
    3
    LEE M3
    Lenton Abbey
    Nottingham
    2506
    4
    LORA W4
    Beeston
    Nottingham
    2507
    5
    SCOTT M5
    Radford
    Nottingham
    2508
    6
    MINA W6
    Hyson Green
    Nottingham
        ..cff.
    DDL for DimClient
    CREATE TABLE DimClient(
    ClientID NUMBER(5) PRIMARY KEY,
    Name VARCHAR2(30) NOT NULL);
    DimTime
    TIMEID
    FULLDATE
    YEAR
    SEASON
    MONTH
    MONTHDAY
    WEEK
    WEEKDAY
    817
    02-MAR-10
    2010
    Spring
    3
    2
    9
    3
    818
    03-MAR-10
    2010
    Spring
    3
    3
    9
    4
    819
    04-MAR-10
    2010
    Spring
    3
    4
    9
    5
    820
    05-MAR-10
    2010
    Spring
    3
    5
    9
    6
    821
    06-MAR-10
    2010
    Spring
    3
    6
    9
    7
    822
    07-MAR-10
    2010
    Spring
    3
    7
    9
    1
    DDL for DimTime
    CREATE TABLE DimTime(
    TimeID NUMBER(6) PRIMARY KEY,
    Year NUMBER(4) NOT NULL,
    Season VARCHAR2(20));
    I have the following analysis request to perform on this data mart:
    Top 5 clients by value of ticket sale for each season
    For this requirement I came up with the following query:
    SELECT * FROM
    (SELECT FacTIC.ClientID, DimCLI.Name, SUM(SumtotalAmount) SumTotalAmount, DimTIM.Season
    FROM FactTicketPurchase FacTIC, DimClient DimCLI, DimTime DimTIM
    WHERE FacTIC.ClientID = DimCLI.ClientID
    AND FacTIC.TimeID = DimTIM.TimeID
    AND Season = 'Spring'  AND Year = 2010
    GROUP BY Season, FacTIC.ClientID, DimCLI.Name
    ORDER BY Season ASC, SumTotalAmount DESC)
    WHERE rownum <=5;
    As you can see, in line 06 of the above query, I am explicitly specifying the season for the query to return.
    However what I would like to do is just one query that could autocratically go through the seasons and years available in the time dimension in a fashion similar to a FOR-EACH statement. This way, if we get more years added to the time dimension, we wouldn't have to amend the query.
    Is this possible?
    Regards,
    P.

    I think I fixed it!
    The trick was to look into the r_num value. As soon as I added it to my query I started to see how r_num was being calculated and I realised that I had to add Season to my partition, right after Year.
    SELECT Year, Season, TotalAmount, Name
    FROM (
       SELECT   DimCLI.Name
       ,        DimTIM.Year
       ,        DIMTIM.Season
       ,        SUM(FacTIC.SumTotalAmount) TotalAmount
       ,        RANK() OVER (PARTITION BY Year, Season
                             ORDER BY SUM(FacTIC.SumTotalAmount) DESC
                            ) AS r_num
       FROM     FactTicketPurchase FacTIC
       ,        DimClient DimCLI
      ,         DimTime DimTIM
       WHERE    FacTIC.ClientID = DimCLI.ClientID
       AND      FacTIC.TimeID = DimTIM.TimeID
       GROUP BY DimTIM.Year
       ,        DimTIM.Season
       ,        DimCLI.Name
    WHERE r_num <= 5 -- Need to amend this line on my data sample to show 2 rows.
    ORDER BY Year, Season, TotalAmount DESC;
    Looking at my data sample, I got the following:
    YEAR
    SEASON
    TOTALAMOUNT
    CLIENTID
    2010
    Autumn
    29
    2504
    2010
    Autumn
    26
    2503
    2010
    Spring
    25
    2503
    2010
    Spring
    14
    2506
    2010
    Summer
    26
    2506
    2010
    Summer
    26
    2504
    2010
    Winter
    28
    2503
    2010
    Winter
    26
    2506
    2011
    Autumn
    23
    2506
    2011
    Autumn
    14
    2503
    2011
    Spring
    25
    2505
    2011
    Spring
    13
    2503
    2011
    Summer
    21
    2505
    2011
    Summer
    14
    2503
    2011
    Winter
    19
    2505
    Now, looking at my real data, (considering the top 5 rows, not the top 2), I got:
    YEAR
    SEASON
    TOTALAMOUNT
    NAME
    2010
    Autumn
    141
    BUSH M225
    2010
    Autumn
    140
    DIANA W66
    2010
    Autumn
    136
    HANA W232
    2010
    Autumn
    120
    DIANA W220
    2010
    Autumn
    120
    WILSON M459
    2010
    Spring
    137
    DAVID M469
    2010
    Spring
    125
    ALEX M125
    2010
    Spring
    124
    PETER M269
    2010
    Spring
    115
    ZHOU M463
    2010
    Spring
    114
    TANIA W304
    2010
    Summer
    138
    JANE W404
    2010
    Summer
    105
    MINA W8
    2010
    Summer
    97
    DAVID M275
    2010
    Summer
    96
    CLINTON M483
    2010
    Summer
    93
    ANNA W288
    2011
    Spring
    12
    LUISE W20
    2011
    Spring
    7
    ANNA W432
    2011
    Spring
    7
    LEE M409
    2011
    Spring
    7
    CHRIS W274
    2011
    Spring
    7
    HELEN W136
    2011
    Spring
    7
    LILY W114
    2011
    Spring
    7
    LUISE W348
    2011
    Spring
    7
    LIU M107
    2011
    Spring
    7
    VICTORY W194
    2011
    Spring
    7
    DIANA W240
    2011
    Spring
    7
    HELEN W120
    2011
    Spring
    7
    LILY W296
    2011
    Spring
    7
    MATTHEW M389
    2011
    Spring
    7
    PACO M343
    2011
    Spring
    7
    YANG M411
    2011
    Spring
    7
    ERIC M101
    2011
    Spring
    7
    ALEX M181
    2011
    Spring
    7
    SMITH M289
    2011
    Spring
    7
    DIANA W360
    2011
    Spring
    7
    MATTHEW M63
    2011
    Spring
    7
    SALLY W170
    2011
    Spring
    7
    JENNY W258
    2011
    Spring
    7

  • Is there any way to use a For Each Loop for each property of an User Defined Type?

    Is there any way to use a For Each Loop for each property of an User Defined Type? That would be very handy!
    Jorge Barbi Martins ([email protected])

    Alas, no, not in VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Associating a certain "useful life" for each "Asset Class" ?

    Hi All
    Could anyone tell me how to associate a certain "useful life" for each "Asset Class" ?
    Which's customizing navigation?
    Thanks
    Gandalf

    Hi Try this..
    If you go to IMG (Transaction SPRO) :-
    -> Financial Accounting
    -> Asset Accounting
    -> Master Data
    -> Screen Layout
    -> Define Screen Layout for Asset Depreciation Areas
    -> ScrnLayout XXXX
    -> Field group rules
    Here, you will find whether column 'Class' is activated -> it should be activated
    Hope it helps
    Zub

  • Using static variable in orchestration for each message

    Once a file is dropped to our Biztalk server I am capturing data from each message. However, I need to assign a batchID for this file that I will write to the database along with the data. How do I build my orchestration so that the code I'm using to generate
    the BatchID doesn't create a new ID for each message? I want each message to use the same ID.
    Thanks.
    Raymond

    Shankycheil,
    I think you've pointed out my primary issue. I'm fairly new to Biztalk and I just kind of let it do its thing when it comes to EDI processing. So, I guess my issue is due to the fact that I'm letting the EDI Disassembler debatch the file and pass messages
    into the orch one at a time. I have code in an expression shape that generates a BatchID, but of course if I'm debatching it creates a new BatchID for each message. How do I deal with the file as a whole inside the orchestration so that once I generate a BatchID
    it uses it for all of the messages in file? I've done what Prabhdeep suggested and promoted a field in the schema so that I can set the BatchID, but it needs to be the same for each message in a file.
    Thanks.
    Raymond

  • Is there a for-each statement in XSQL like the one in XSL?

    I'm trying to do the following:
    <?xml version="1.0" ?>
    - <!-- <?xml-stylesheet type="text/xsl" href="/dvd/xsl/admin/listuser.xsl"?>
    -->
    - <database>
    - <request>
    - <parameters>
    - <row>
    <checkboxuser>jonathan</checkboxuser>
    </row>
    - <row>
    <checkboxuser>james</checkboxuser>
    </row>
    - <row>
    <checkboxuser>steve</checkboxuser>
    </row>
    - <row>
    <checkboxuser>richard</checkboxuser>
    </row>
    </parameters>
    - <session>
    <access>0</access>
    <user>malik</user>
    <adminfirstname>Malik</adminfirstname>
    <adminlastname>Graves-Pryor</adminlastname>
    </session>
    - <cookies>
    <JServSessionIdroot>v647ogyd8n</JServSessionIdroot>
    </cookies>
    </request>
    - <allusers>
    - <userinfo>
    <first-name>Jonathan</first-name>
    <last-name>Terry</last-name>
    <email>[email protected]</email>
    <user-name>jonathan</user-name>
    <password>terry</password>
    <access-level>1</access-level>
    </userinfo>
    </allusers>
    </database>Now as you can see, I have 4 instances of <checkboxuser> in my XSQL page. These values are being passed in from checkboxes on the previous page. Is there an XSQL command that will say something like <xsql:for-each select="/database/request/parameters/checkboxuser"> ?
    So that it'd look something like this in the original code:
    <?xml version="1.0"?>
    <!--<?xml-stylesheet type="text/xsl" href="/dvd/xsl/admin/listuser.xsl"?>-->
    <database connection="dvddb" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-request-params/>
    <xsql:query id-attribute="" tag-case="lower" rowset-element="allusers" row-element="userinfo">
    SELECT FIRSTNAME AS "FIRST-NAME",
    LASTNAME AS "LAST-NAME",
    EMAIL AS "EMAIL",
    USERNAME AS "USER-NAME",
    PASSWORD AS "PASSWORD",
    ACCESSLEVEL AS "ACCESS-LEVEL"
    FROM LKUP_USER
    WHERE USERNAME = '<xsql:for-each select="/database/request/parameters/checkboxuser">'
    ORDER BY ACCESSLEVEL
    </xsql:query>
    </database>Or something like that... The XSL works fine, but not when I want to pull info from the DB.. :)
    Malik Graves-Pryor

    Ok I got a friend of mine to load everything up for me using 'javac' on he command line with -verbose and he got this back:
    C:\oracle\ora81>javac -verbose MultiValuedParam.java
    [parsed MultiValuedParam.java in 453 ms]
    [loaded C:\Oracle\ora81\lib\oraclexsql.jar(oracle/xml/xsql/XSQLActionHandlerImpl
    .class) in 62 ms]
    [loaded C:\jdk1.2.2\jre\lib\rt.jar(java/lang/Object.class) in 0 ms]
    [loaded C:\Oracle\ora81\lib\oraclexsql.jar(oracle/xml/xsql/XSQLActionHandler.cla
    ss) in 0 ms]
    [loaded C:\jdk1.2.2\jre\lib\rt.jar(java/sql/SQLException.class) in 15 ms]
    [loaded C:\jdk1.2.2\jre\lib\rt.jar(java/lang/Exception.class) in 0 ms]
    [loaded C:\jdk1.2.2\jre\lib\rt.jar(java/lang/Throwable.class) in 0 ms]
    [loaded C:\jdk1.2.2\jre\lib\rt.jar(java/io/Serializable.class) in 0 ms]
    MultiValuedParam.java:10: Package javax.servlet.http not found in import.
    import javax.servlet.http.*;
    ^
    MultiValuedParam.java:11: Package org.w3c.dom not found in import.
    import org.w3c.dom.*;
    ^
    [checking class MultiValuedParam]
    2 errors
    [done in 1266 ms]Any clues on what needs to be done to get those last two working? He has the oraclexsql.jar file listed in the system environment variable section of win2k.
    Thanks!
    Malik Graves-Pryor

  • Using a for-each for a CallObject

    Hello everyone,
    i am having trouble to get the following scenario to work:
    1. SQL Call is prepared and called
    2. Branch with a condition whether there is a payment related to an invoice
    3. For-Each record of the resultset a cancellation will be called by using a B1Objectcall with cancellation method
    The for-each is configurated like this:
    /vpf:Msg/vpf:Body/vpf:Payload[@Role='C']/jdbc:ResultSet/jdbc:Row
    The path is configurated like this:
    /vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom36&apos;]/jdbc:ResultSet[./@rowCount>&apos;0&apos;]
    My problem is the preparation of the xsl-transformation to access the DocEntry of each record. This is my xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force="">
      <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
      <xsl:param name="atom"/>
      <xsl:param name="sessionid"/>
      <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"/>
      <xsl:variable name="msg2" select="/vpf:Msg/vpf:Body/vpf:Payload[@Role='C']/jdbc:ResultSet/jdbc:Row"/>
      <xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"/>
      <xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"/>
      <xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"/>
      <xsl:variable name="vpSysId" select="/vpf:Msg/vpf:Header/vpf:Variables/vpf:var[./@id=&apos;SysId&apos;]/@value"/>
      <xsl:template match="/">
      <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
      <xsl:copy-of select="/vpf:Msg/@*"/>
      <xsl:copy-of select="/vpf:Msg/vpf:Header"/>
      <Body>
      <xsl:copy-of select="/vpf:Msg/vpf:Body/*"/>
      <Payload Role="X" id="{$atom}">
      <xsl:call-template name="transform"/>
      </Payload>
      </Body>
      </Msg>
      </xsl:template>
      <xsl:template name="transform">
      <Value xmlns="">
      <xsl:value-of select="$msg2/DocEntry"/>
      </Value>
      </xsl:template>
    </xsl:stylesheet>
    This is the inbound message on the path:
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity" MessageId="14123112452456040534C0A800138613" BeginTimeStamp="20141231124524" logmsg="0000" SubMessageId="" status="success" owntst="false" test="true">
      <Header>
      <IPO Id="INB_IQ_INTQ_ASYN_QS" tid="14123109281856033321C0A80013BACE" />
      <IPO Id="PRC_QS" tid="14123109281856033506C0A8001381B0" />
      <msglog step="Default message log" always="false" b1ifactive="true" />
      <Resumption>
      <starter ipo="/vP.0010000000.in_IQ/com.sap.b1i.vplatform.runtime/INB_IQ_INTQ_ASYN_QS/INB_IQ_INTQ_ASYN_QS.ipo/proc" />
      <restart id="processing" q="Q.PRC_QS.0010000000" s="S.sap.DRFISQueuertFIS" u="14123112231756033345C0A800139613.4" />
      </Resumption>
      <ProcStream>S.sap.DRFISQueuertFIS</ProcStream>
      <Sender Id="0010000000" ObjId="sap.DetailReportFIS" />
      <Successor Id="" Mode="" />
      <Identification Ident="Queue/Stream" IdPar="n.a." />
      <nsList>
      <ns id="b1mb" ns="http://tempuri.org/" />
      </nsList>
      <ReceiverList>
      <Receiver Id="0010000000" filter="" />
      </ReceiverList>
      <Retrieval type="Handover" />
      <Outbound type="Void" channel="VOID" />
      <vBIU Id="sap.DRFISQueue" ver="1.0.0" SId="sap.Files" filter="" phase="" />
      <Variables>
      <var id="userid" value="no_authentication" />
      <var id="username" value="no_authentication" />
      <var id="SysId" value="0010000117" />
      </Variables>
      <Properties />
      <SysTypeProperties type="B1if" offline="" snd="0010000000" rcv="receiverdummy" ssystype="B1i.20" rsystype="" />
      <LocalProperties type="B1if" biu="sap.DRFISQueue" snd="0010000000" rcv="receiverdummy" sid="sap.Files" offline="" />
      <VarProperties>
      <property call="callb1obj.bfd" atom="atom3" id="SysId" value="#0010000117" />
      <property call="callsql.bfd" atom="atom36" id="SysId" value="#0010000117" />
      </VarProperties>
      </Header>
      <Body>
      <Payload Role="T" Type="Queue" add="sap.DetailReportFIS" />
      <Payload Role="S">
      <Document xmlns="">
      <row>
      <BuchungsID>47662</BuchungsID>
      <Datum>15.12.2014</Datum>
      <VertragspartnerID>61</VertragspartnerID>
      <Firmenname>Software Integrator</Firmenname>
      <KreditorenID>K123456</KreditorenID>
      <Kreditor>Intrum Justitia AG</Kreditor>
      <ForderungsID>9015</ForderungsID>
      <Rechnungsnummer>121</Rechnungsnummer>
      <Buchungstyp>DEBTCLAIM_REVOKE</Buchungstyp>
      <Buchungstext>Forderungsruecknahme</Buchungstext>
      <Waehrung>CHF</Waehrung>
      <Nettobetrag>-7560.00</Nettobetrag>
      <MwStSatz>0</MwStSatz>
      <MwStBetrag>0</MwStBetrag>
      <Bruttobetrag>-7560.00</Bruttobetrag>
      <Verrechnungsposition>n</Verrechnungsposition>
      </row>
      </Document>
      </Payload>
      <Payload Role="X" id="atom35">
      <row xmlns="">
      <Value>SELECT T0.DocNum FROM ORCT T0 WHERE T0.Canceled ='N' AND T0.DocNum IN (SELECT T1.DocNum FROM ORCT T0 INNER JOIN RCT2 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OINV T2 ON T1.DocEntry = T2.DocNum WHERE T2.DocNum = '121')</Value>
      <Value2>Update OINV set U_sapSTORNF = '1' WHERE DocEntry = '121'</Value2>
      </row>
      </Payload>
      <Payload Role="C" id="atom36" system="0010000117" mode="single" method="Automatic detection by key word(Automatic detection by key word)" plr="4" dbtype="SQL" blockExecution="false" compatibilityMode="true" delimiter=";" sql="SELECT T0.DocNum FROM ORCT T0 WHERE T0.Canceled ='N' AND T0.DocNum IN (SELECT T1.DocNum FROM ORCT T0 INNER JOIN RCT2 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OINV T2 ON T1.DocEntry = T2.DocNum WHERE T2.DocNum = '121')" disable-output-escaping="false">
      <ResultSet xmlns="urn:com.sap.b1i.adapter:jdbcadapter" rowCount="1">
      <Row>
      <DocNum>163</DocNum>
      </Row>
      </ResultSet>
      </Payload>
      <Payload Role="C" id="atom48" status="ok" input="atom35" queue="Q.INB_IQ_INTQ_ASYN_QS.0010000000" stream="sap.DRFISQueue3" />
      <Payload Role="X" id="atom33">
      <row xmlns="">
      <Value>163</Value>
      </row>
      </Payload>
      </Body>
    </Msg>

    Hello everyone,
    THis is how my stuff looks now:
    i have tried the above named solutions but i think, that as soon as i am checking the inbound parameter of the for-each it says something like that:
    - <ResultSet xmlns="urn:com.sap.b1i.adapter:jdbcadapter" rowCount="1"> 
    - <Row> 
    <DocNum>163</DocNum>  
    </Row>
    </ResultSet>
    While in the path i have got a such inbound parameter:
    the code just shows the sql call and the X Role of atom33 where i am using the personal tag
    - <Payload Role="C" id="atom36" system="0010000117" mode="single" method="Automatic detection by key word(Automatic detection by key word)" plr="4" dbtype="SQL" blockExecution="false" compatibilityMode="true" delimiter=";" sql="SELECT T0.DocNum FROM ORCT T0 WHERE T0.Canceled ='N' AND T0.DocNum IN (SELECT T1.DocNum FROM ORCT T0 INNER JOIN RCT2 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OINV T2 ON T1.DocEntry = T2.DocNum WHERE T2.DocNum = '121')" disable-output-escaping="false"> 
    - <ResultSet xmlns="urn:com.sap.b1i.adapter:jdbcadapter" rowCount="1"> 
    - <Row> 
    <DocNum>163</DocNum>  
    </Row>
    </ResultSet>
    </Payload>
    <Payload Role="C" id="atom48" status="ok" input="atom35" queue="Q.INB_IQ_INTQ_ASYN_QS.0010000000" stream="sap.DRFISQueue3" />  
    - <Payload Role="X" id="atom33"> 
    <DocId xmlns="">163</DocId>  
    </Payload>
      </Body>
    This is my call object configuration
    This message is the Key Value:
    /vpf:Msg/vpf:Body/vpf:Payload[./@Role='X' and ./@id='atom33']/DocId
    This is my atom33:
    <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos; and ./@id=&apos;atom36&apos;]/jdbc:ResultSet/jdbc:Row">
    <DocId xmlns="">
    <xsl:value-of select="jdbc:DocNum"/>
    </DocId>
    </xsl:for-each>
    When checking the message of the join inbound it shows the following:
    So it seems that at some point i am completely losing some inbound message (such as the atom33).
    - <Msg xmlns="urn:com.sap.b1i.vplatform:entity"> 
    - <Body> 
    - <Payload Role="X" id="atom56"> 
    <DocId2 xmlns="" />  
    </Payload>
    - <Payload Role="C" id="atom55" system="0010000117"> 
    <B1CallResult status="failure" b1login="Technical User" method="Synchronous Cancel" objectid="24" payload="atom56" keyname="DocEntry" keyvalue="" />  
    </Payload>
    </Body>
    </Msg>
    This is the atom56 config, which is just a tryout. Or do I use a wrong payload in my call object?
    Help is greatly appreciated.
    Regards Simon

  • Package Variable Values in For Each Contaner

    I have a For Each File Container that loops through Excel files, executing a child package for each file found. I am using the RowCount transform to log the number of rows at various points in a DataFlow. When one file is processed the numbers are correct
    but when multiple files (e.g. 5) are processed some counts are zero when they shouldn't be. I have tried a 1 second sleep in the loop but that didn't fix the problem.
    R Campbell

    Please share more technical details
    numbers of what where, what Data Flaw how a package reports on the counts?
    Arthur
    MyBlog
    Twitter
    Actually, the title IS misleading.
    I have a parent package with a For Each File container
    and within that a child package is called, passing the file path and name. The child package has a
    DataFlow with quite a few branches in the flow. On some of those branches I have
    RowCount "transforms" each linked to its own
    package variable.
    At the CotrolFlow level a script is executed immediately after the DataFlow which writes the package variable values to the dts log.
    If I place one file at a time into the folder that the For Each Container is looking at and wait for it to be processed, the numbers are correct. If I place a number of files (say 5) in the folder at one time, some of the numbers logged are correct
    and some are zero.
    I did try a 1 second sleep at the start of the logging  script but, when I think about it, the package variables probably being read before the script starts to execute. If this is a timing issue (which I don't think that it should be) it might need
    to be a separate script between the DataFlow and the existing script, with a sleep in it.
    Because each loop of the parent package executes a new instance of the child package I am puzzled as to how there can be a timing issue. No matter how tight the loop might be, a new instance of the child package is executed each time.
    R Campbell

  • Jdbc driver creates new thread for each statement with a query timeout set

    I am profiling a web application that is using the Microsoft JDBC driver, version 1.1 to connect to a sql server 2005 database. Each java.sql.Statement that is created, within the application, gets a query timeout value set on it ( statement.setQueryTimeout(...) ).
    I have discovered that the JDBC driver creates a new thread to monitor each Statement and the query timeout value. When the application is under load these threads are getting created faster then they are being destroyed and I am concerned that this will cause a performance problem in production.
    One option I have is to remove the query timeout value and the monitor threads will not be created, another is to change JDBC drivers.
    I'm curious is there any way to control this behavior so that these threads are not created or are managed more efficiently.  Is there a workaround that anyone is aware of?   Is this considered a bug?
    I have found a similar bug here for the 2000 driver:
    http://support.microsoft.com/default.aspx/kb/894552
    Cheers

    Hi,
    Thank you for using the Microsoft SQL Server JDBC driver.  You are correct that a new thread is started to monitor the query timeout when a statement is executed.  This is a potential performance issue that we may look at addressing in the upcoming v1.2 release.  The current behavior is not configurable.  The only workaround with the v1.1 driver is to limit your use of query timeouts to only those statements which you reasonably might expect to actually time out.
    We do take customer feedback very seriously, so if anyone else is concerned about this particular issue, please chime in and we will be able to give it appropriate weight.
    --David Olix [MSFT]

  • How to get Runtime for each statement in abap program

    Is there any tool which tells the runtime of each statement in our program..apart from sto5 and se30
    Thanks in advance
    PRASANNA

    Determining the calculation time for calculating the tangent of 1. Since the runtime of the statement is less than a microsecond, the runtime of several executions in an inner loop is measured. The exection time for the loop itself is also measured in order to deduct it as an offset. These measurements are executed several times in an outer loop and the mean value is created using division by n0. Through division by ni, the runtime of an individual statement is determined.
    DATA: t0    TYPE i,
          t1    TYPE i,
          t2    TYPE i,
          t3    TYPE i,
          t4    TYPE i,
          tm    TYPE f,
          no    TYPE i VALUE 100,
          ni    TYPE i VALUE 1000,
          res   TYPE f.
    DO no TIMES.
      GET RUN TIME FIELD t1.
      DO ni TIMES.
        res = TAN( 1 ).
      ENDDO.
      GET RUN TIME FIELD t2.
      GET RUN TIME FIELD t3.
      DO ni TIMES.
      ENDDO.
      GET RUN TIME FIELD t4.
      t0 = t0 + ( ( t2 - t1 ) - ( t4 - t3 ) ).
    ENDDO.
    tm = t0 / ni / no.
    Source: SAP Help.
    Regards,
    Santosh

  • Tax Accounts - Is it necessary to have separate tax acct. for each state

    I am new at this:
    Is it necessary to have separate AR/AP/ account for each tax jurisdiction like state county etc?\
    Or do the sales tax reports for payments in SAP produce outstanding taxes per jurisdiction.
    I would prefer only one Sales Tax account and hope to have SAP produce the taxes due per jurisdiction.
    Mike

    Thanks Suda.
    So I only need to setup two tax accounts:
    1.  One tax account for tracking the AR taxes
    2.  One tax account for tracking the AP taxes
    So, to report the taxes to the different tax jurisdictions, SAP should be able to break then down individually for us to pay them.
    I am new at this ... so please be patient.
    Mike

Maybe you are looking for