XSL recursion losing value problem.

I've created an XSL stylesheet that i'm using to create a pie chart in svg. Each slice of the pie is done in a recursive call to the draw function. The slice number is passed to each recursive call with the value of counter + 1.
This seems to be pretty straight forward and working fine until I hit a for-each loop in the template. For some reason the for-each is setting the counter back to 1.
for example:
counter is now 2
<xsl:for-each select=...>
counter is now 1 for some reason
<xsl:call-template with param counter + 1
</xsl:for-each>
So the result is whenever the for-each is enter, counter has a value of 1.
attached is the actual stylesheet and a sample xml. I'm using oraxsl to do the transform.
<xsl:stylesheet version="1.0" type="text/xsl"
xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
xmlns:Mayura ="http://www.mayura.com/"
exclude-result-prefixes="Mayura">
<xsl:include href="CoolColors.xsl"/>
<xsl:include href="math.xsl"/>
<xsl:output standalone="yes" doctype-system="svg-19990812.dtd"
media-type="image/svg" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="/graph"/>
</xsl:template>
<xsl:template name="drawPie" match="graph">
<xsl:param name="x_origin" select="0"/>
<xsl:param name="y_origin" select="0"/>
<xsl:param name="gWidth" select="800"/>
<xsl:param name="gHeight" select="600"/>
<g id="pie chart" transform="translate({$x_origin}, {$y_origin})">
<xsl:variable name="count1" select="sum(values/value/@amount)"/>
count1 = <xsl:value-of select="$count1"/>
num_values = <xsl:value-of select="count(values/value)"/>
<xsl:call-template name="drawSlice">
<xsl:with-param name="x_origin" select="0"/>
<xsl:with-param name="y_origin" select="0"/>
<xsl:with-param name="gWidth" select="$gWidth"/>
<xsl:with-param name="gHeight" select="$gHeight"/>
<xsl:with-param name="counter" select="1"/>
</xsl:call-template>
</g>
</xsl:template>
<xsl:template name="drawSlice">
<xsl:param name="counter" select="1"/>
<xsl:param name="x_origin" select="0"/>
<xsl:param name="y_origin" select="0"/>
<xsl:param name="gWidth" select="800"/>
<xsl:param name="gHeight" select="600"/>
<xsl:param name="rotateMe" select="0"/>
DRAWSLICE1: <xsl:value-of select="$counter"/>
<xsl:for-each select="values/value">
DRAWSLICE2: <xsl:value-of select="$counter"/>
<xsl:if test="position()=$counter">
<xsl:call-template name="drawSlice">
<xsl:with-param name="counter" select="$counter + 1"/>
<xsl:with-param name="x_origin" select="$x_origin"/>
<xsl:with-param name="y_origin" select="$y_origin"/>
<xsl:with-param name="gWidth" select="$gWidth"/>
<xsl:with-param name="gHeight" select="$gHeight"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
some xml for it is:
<?xml version = '1.0' encoding = 'UTF-8'?>
<graph width="600" height="400" type="PIE">
<legend font_size="14"/>
<title font_size="30" font_color="red" fill_color="red">Monthly PIRs</title>
<title2 font_size="20" font_color="red" fill_color="red">2001</title2>
<values>
<value name="JANUARY" amount="25">
<graph width="600" height="400" type="PIE">
<title> JANUARY</title>
<values>
<value name="ENGINEERING" amount="3"/>
<value name="NEW BUSINESS/PROGRAMS" amount="2"/>
<value name="OPERATIONS" amount="16"/>
<value name="QUALITY" amount="3"/>
<value name="SAFETY" amount="1"/>
</values>
</graph>
</value>
<value name="FEBRUARY" amount="14">
<graph width="600" height="400" type="PIE">
<title> FEBRUARY</title>
<values>
<value name="ENGINEERING" amoun t="4"/>
<value name="HUMAN RESOURCES" amount="1"/>
<value name="INFO SYSTEMS" amount="1"/>
<value name="OPERATIONS" amount="7"/>
<value name="QUALITY" amount="1"/>
</values>
</graph>
</value>
<value name="MARCH" amount="5">
<graph width="600" height="400" type="PIE">
<title>MARCH</title>
<values>
<value name="ENGINEERING" amount="1"/>
<value name="HUMAN RESOURCES" amount="1"/>
<value name="INFO SYSTEMS" amount="1"/>
<value name="OPERATIONS" amount="1"/>
<value name="QUALITY" amount="1"/>
</values>
</graph>
</value>
</values>
</graph>
I've deleted alot of stuff out of it. The important lines are the DRAWSLICE.
The expected output would have each value of DRAWSLICE1 = DRAWSLICE2, however if you run it you'll see that DRAWSLICE2 is always = 1.
Any help appreciated,
Jeff

The problem is related to the fact that a call-template does not change the current node or the current node list, while a for-each does.
When you recursively invoke call-template from within a for-each, you've changed the current node to I believe your <xsl:for-each select="values/value"> won't be finding what it thinks it will be finding.
I hope this working stylesheet gets you going in the right direction. Given your "jeff.xml" file, it produces the output:
<?xml version = '1.0' encoding = 'UTF-8'?>
<root>
<graph>
<slice name="JANUARY" amt="25" rel-id="1" abs-id="1">
<slice name="ENGINEERING" amt="3" rel-id="1" abs-id="2"/>
<slice name="NEW BUSINESS/PROGRAMS" amt="2" rel-id="2" abs-id="3"/>
<slice name="OPERATIONS" amt="16" rel-id="3" abs-id="4"/>
<slice name="QUALITY" amt="3" rel-id="4" abs-id="5"/>
<slice name="SAFETY" amt="1" rel-id="5" abs-id="6"/>
</slice>
<slice name="FEBRUARY" amt="14" rel-id="2" abs-id="7">
<slice name="ENGINEERING" amt="4" rel-id="1" abs-id="8"/>
<slice name="HUMAN RESOURCES" amt="1" rel-id="2" abs-id="9"/>
<slice name="INFO SYSTEMS" amt="1" rel-id="3" abs-id="10"/>
<slice name="OPERATIONS" amt="7" rel-id="4" abs-id="11"/>
<slice name="QUALITY" amt="1" rel-id="5" abs-id="12"/>
</slice>
<slice name="MARCH" amt="5" rel-id="3" abs-id="13">
<slice name="ENGINEERING" amt="1" rel-id="1" abs-id="14"/>
<slice name="HUMAN RESOURCES" amt="1" rel-id="2" abs-id="15"/>
<slice name="INFO SYSTEMS" amt="1" rel-id="3" abs-id="16"/>
<slice name="OPERATIONS" amt="1" rel-id="4" abs-id="17"/>
<slice name="QUALITY" amt="1" rel-id="5" abs-id="18"/>
</slice>
</graph>
</root>The stylesheet looks like:
<xsl:stylesheet version="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<root>
<xsl:apply-templates select="/graph"/>
</root>
</xsl:template>
<xsl:template match="graph">
<graph>
<xsl:apply-templates select="values/value" mode="drawSlice"/>
</graph>
</xsl:template>
<xsl:template match="value" mode="drawSlice">
<slice name="{@name}" amt="{@amount}"
rel-id="{position()}" abs-id="{count(preceding::value)+count(ancestor::value)+1}">
<xsl:apply-templates select="graph/values/value" mode="drawSlice"/>
</slice>
</xsl:template>
</xsl:stylesheet>I wasn't sure if you were trying to get the slice numbers to be relatively numbered to their siblings or absolutely numbered in document order, so I show both here.

Similar Messages

  • Rounding off value problem in sales order

    Hi All,
    This is related to a rounding off value problem in sales order.
    The problem is described by an example which is as follows -
    Selling Price of Material A = Rs. 176.76
    Excise charged = Rs. 21.80
    Total Price = Rs.176.76 + Rs.21.80 = Rs. 198.56
    On this total Trade Discount (ZDTD) having access sequence,is calculated  at the rate of 4% = Rs. 7.94
    But the condition base value after the discount is showing Rs.198.60 instead of Rs.198.56
    I want the system to reflect the value as Rs.198.56 intact and it should not round up to the nearest value i.e. Rs. 198.60
    Why is this happening? Is it possible to reflect the exact value? If yes what is needed to be done?
    The commercial round off is activated for the DIFF Condition Type.
    Looking forward to some valuable suggestions.
    Thanks & Regards
    Priyanka Mitra

    Hi Ramesh,
    Thanks for your suggestion but the problem has been solved by me.
    Regards
    Priyanka Mitra

  • Losing Connection Problem

    Hello,
    My name is Joey Hiemstra and i have a situation that needs your attention.
    Our router ( Linksys BEFW11S4 ) has problems with losing the connections.
    The Situation:
    We have 2 pc's connected to the router. When pc 1 ( the pc with no problems ) is running internet alone it has no problem, but when i go with my pc ( pc 2 ) the internet will drop in a time range to 20 min / 60 min. If pc 2 has internet al by himself ( pc 1 isn't working ) it will lose the internet in a time range from 20 min / 60 min. Even when im using pc 2 with a program that isn't using internet ( MSN is running ) it will lose it's internet connection. If im playing a mmorpg ( Massive Multiplayer Online Role Playing Game ) all by myself on pc 2 it will lose connection. If i play the same game on pc 1 it won't. So even if i use the internet or i dont use the internet it will lose his connection. The solution to this problem is every 20 min / 60 min going down the stairs > put power off the router > put power on the router > and internet will work again.
    You will see this is very annoying when pc 2 is downloading and approx 3 / 4 hours later you notice that internet dropped and he only downloaded for about 20 min.
    -Firmware of router is up to date
    -Cable connection
    -Cable's in good  condition
    -Quick internet when it's on
    What is the solution to this problem
    Router : BEFW11S4 Version 4 Firmware: 1.52.02

    Hmmmm... try to do this process on the 2nd PC.
    Go to start--control panel ---- performance and mainternance --- system ---hardware --- device manager --- network adapters --- right click on your PC's LAN card (example: Broadcom 10/100 Etherfast Adapter) and choose properties --- click on the advanced tab --- look for either Media Type, Connection Type, Link Speed or Duplex Mode ----- click on value --- make it either 10 half mode, 10 mbps half, or 10 base T ... Click OK, close and then restart PC.

  • Recursive animation block problem

    Hi all,
    i have a recursive animation block.  It calls itself according to the parameter value which can be 3 or less.
    when this parameter value is  two or one, animation is working correctly.  If the parameter value is 3, the animation block (although it works correctly in the code,debug mode), the screen seems to be called on it once.
    But, if the parameter value is 3, When I put  2 seconds between each recursion call,  the animation also seems  correctly on the screen.
    What could be the cause of the problem?
    Xcode 4. 2
    Build 4D199
    iphone 5.0 Simulator
    //Animation Definition
    -(CAAnimationGroup*) getAnimationGroupForLayer :(UIImageView *) layerView duration :(float) duration
        UIBezierPath *movePath = [UIBezierPath bezierPath];
        [movePath moveToPoint:layerView.center];
        [movePath addQuadCurveToPoint:self.totalQuestion.center controlPoint:CGPointMake(160, 240)];
        CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
        moveAnim.path = movePath.CGPath;
        CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"alpha"];
        opacityAnim.fromValue = [NSNumber numberWithFloat:1.0];
        opacityAnim.toValue = [NSNumber numberWithFloat:0.1];
        CAAnimationGroup *animGroup = [CAAnimationGroup animation];
        animGroup.animations = [NSArray arrayWithObjects:moveAnim, opacityAnim, nil];
        animGroup.duration   = duration;
        return animGroup;
    -(void) doAnim4Layer:(UIImageView *) layerView
        [layerView.layer addAnimation:[self getAnimationGroupForLayer:layerView duration:0.25] forKey:nil];
    //Recursion
    -(void) startAnimation:(int) counter
         [UIView animateWithDuration:0.25
                         animations:^{
                             [self doAnim4Layer:(counter == 3 ? self.star1:(counter==2? self.star2:self.star3))];                                             
                         completion:^(BOOL finished)
                                [self addStar:1];      
                                if(counter == 1)
                                    [self getNextQuestion]; 
                                }else{
                                    //sleep(2);  //works correctly when initial value 3
                                    [self startAnimation:counter-1];

    i found problem.  Let me explain.
    when  i was calling animation block, i called other method which is also CAAnimation.  But i didn't implement of its delegate methods (
    - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag{
    Now,  this delegate method is implemented and recursive animation  is done in this method.  Everthing is now ok.
    - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag{
      self.animationCounter--;
       [self addStar:1];
        if(self.animationCounter>=1)
            //recursive call
             [self layerMovedAnimation:
                           [self getAnimatedStar:self.animationCounter]
                                andLayerName:                       [NSString stringWithFormat:@"star_%d",self.animationCounter]];
        if(self.animationCounter == 0){

  • Losing values of attributes

    Hi
    I have a view object which has some of the columns coming out of EO and some of them are calculated. When I am traversing between pages of the train I am losing the values of derived attributes where as no problem with EO attributes.
    For some of the attributes I am setting the value (map) through LOV. I am losing those the value of those attributes that are derived.
    What is the best approach to keep the values of those attributes. I don't want to add these calculate columns in the table.

    Hi,
    Please go to t-code 'se16' and enter  '/bi0/mcostcenter'.  you should be able to see your entries by selecting particular value. Check what is the value of 'version' field for this record. If it is 'M' then your master data is not active. You need to activate it by selecting 'Activate Master data' from the right mouse click of 0costcenter info-object
    Cheers
    SB

  • List Of Values problem while running a form

    Hi all,
    Actually I had developed a form in Forms 4.5. If I connect to the Personal Oracle Database on the same machine, then it is working properly. But if I connect to Oracle server across network and try to run the form, then a message is coming ' F45RUN - The program you are trying to running had problem. Choose ''Close'' or ''Ignore'''. It is giving error of that sort.
    Actually the form has two list items, which will have the values selected from the database. If I comment out the statements 'Populate_list(....)', then the form is opening for runtime. What could be the problem??
    Thanks in Advance.
    Badarinath ([email protected]) If someone could mail me, then it would be even helpful.

    Hi Badrinath,
    I couldn't underestand the exact problem that you are facing. This may be just because of the different Datase versions. Just try to add "onlogon trigger" to your form having the following code in it:
    logon('username','password@connect_string to the server');
    Fully compile the form and then run.
    Let me know if OK.
    Regards,
    Aqueel([email protected])
    Hi all,
    Actually I had developed a form in Forms 4.5. If I connect to the Personal Oracle Database on the same machine, then it is working properly. But if I connect to Oracle server across network and try to run the form, then a message is coming ' F45RUN - The program you are trying to running had problem. Choose ''Close'' or ''Ignore'''. It is giving error of that sort.
    Actually the form has two list items, which will have the values selected from the database. If I comment out the statements 'Populate_list(....)', then the form is opening for runtime. What could be the problem??
    Thanks in Advance.
    Badarinath ([email protected]) If someone could mail me, then it would be even helpful.

  • BI7.0 Hexdecimal values problem while activating the data in DSO

    Hi Friends,
                     I've got the data upto PSA and i've run DTP also from PSA to DSO, but while activating the data in DSO from New Data Table to Active Data Table, it's giving the error given below:
    Error when assigning SID: Action VAL_SID_CONVERT table
      0DOC_HD_TXT     
    Value '1st disb' (hex. '00310073007400200064006900730062') of          characteristic 0DOC_HD_TXT contains invalid characters
    Process 000037 returned with errors.
                it isn't accepting the values like with numberels and chars together
    ex: 1st disb, 70 cr Gen Hsg.
                   I want the same to be in the report, how these are to be allowed?, i don't want to edit in PSA and there are a lot of values like that i can't edit all those, since there are thousands of records.
    Regards,
    BalajiReddy

    Hi Anil,
                       Thanx for your quick replay, i've allowed ',' in RSKC and i've checked the check box LOWER CASE LETTERS for IO 0DOC_HD_TXT, the problem was almost solved out. What does ',' mean by?
                          Why lower case letter has to be checked only for this IO (0DOC_HD_TXT), not for others? if it is checked, it allows only lower cases, doesn't allow upper cases i think. won't there be any problem? if it is done like that?
            pls tell me the reason, i'm really thankfull for your quick replay
    Regards,
    BalajiReddy

  • Insert CLOB values problem with 9.2 drivers and not with 10

    Hi
    We are using Oracle 9.2.0.5. We need to insert values bigger than 4000bytes using thin connection, so we've decided to use CLOB fields. With the 9.2.0.5 driver we can't do it, obtaining the classical exception explaining the data is bigger than the supported size but with the 10g driver (and, of course, same java code) it worked. The problem is that we want to mantain the equivalence between the database and driver not using the 10g driver with the 9.2.0.5 version of the db.
    Here it's the test code we've used:
    Data generation:     
              String data = "";
              Random rnd = new Random();
              long cont = 10000;
              while (cont > 0){               
                   int result = rnd.nextInt(255);
                   data = data + result;
                   cont--;
              Integer id = new Integer(2);
    Data insertion:
                   String queryString="INSERT INTO TMP_BUG_ORACLE (ID, VALOR) VALUES (?,?)";
                   preparedStatement = connection.prepareStatement(queryString);
                   preparedStatement.setInt(1,1);
                   preparedStatement.setString(2,this.datos);
                   int numero = preparedStatement.executeUpdate();               
                   System.out.println("Items inserted: " + numero);
                   preparedStatement.close();
                   connection.close();
    Table structure
         Name:          Type:
         ID           NUMBER
         VALOR      CLOB
    Response (only with 9.2.0.5 driver):
    java.sql.SQLException: El tamaño de los datos es mayor que el tamaño máximo para este tipo: 25708 (Data size is bigger than the maximum for this type: 25708)
    Thank you very much for all

    Hi,
    I had exactly the same problem. on Oracle 9.2 I wanted to insert a template file bigger than 4K. with the ojdbc14.jar from Oracle 9.2 it was not possible.
    What I did was this:
    I have used a JDBCwrapper to fix this issue. I can send it to you, if you send me your email.
    When I use the ojdbc14.jar from Oracle 10, I cannot insert a bigger file.
    How did you code your programm to insert big size data into a CLOB field with ojdbc14.jar driver from 10?
    thank you for your response

  • Cost of Goods sold value problem

    Dear all,
    In a Make To Stock, material use "Moving average" case.
    For example
    1-Sep: Moving avg = $30
    15-Sep: Sales & PGI (A)
    30-Sep: Moving avg = $70
    30-Sep: Sales & PGI (B)
    First of all, I expect the Cost of goods sold for Sales & PGI (A) should be $30, and $70 for (B).
    Is that correct?
    However, now I have all the Sales & PGI entries created on 30-Sep,
    And the posting date is controlled by the Actual GI Date in the Delivery.
    And I found that both PGI value became $70!!!
    Could anyone explain that to me??? Or could anyone provide me a solution to this?
    Many Thanks!
    Best regards,
    Chris

    PLease check this SAP note. I think this will solve your problem
    The following example should demonstrate how such prices can come about. The main cause of the steep rise in the price is that a posting, the value of which is externally predefined, results in a stock quantity which is close to zero. Furthermore, goods receipts exist which are valuated with the current moving average price since no external amount is specified.
    Example:
    Overview:
                                      Quantity        Value    MAP
    (1) Initial stock:                0 items        0.00 $   200.00 $
    (2) GR for 1st purchase order: +1500 items +300,000.00 $
        Stock after (2)            1500 items  300,000.00 $   200.00 $
    (3) GR for 2nd purchase order: +1500 items +330,000.00 $
        Stock after (3)            3000 items  630,000.00 $   210.00 $
    (4) GI for the delivery:       -2849 items -598,290.00 $
        Stock after (4)              151 items   31,710.00 $   210.00 $
    (5) Reversl of 150 itms from (1)-150 items  -30,000.00 $
        Stock after (5)                1 item    1,710.00 $1,710.00 $
    (6) Inventory difference        +150 items +256,500.00 $
        Stock after (6)              151 items +258,210.00 $ 1,710.00 $
    (7) Reversl of 150 itms from (1)-150 items  -30,000.00 $
        Stock after (7)                1 item  +228,210.00 $ 228,210.00 $
    Detail:
    1. In the following, say for material X price control 'V', the moving average price is 200.00 $ and the current entire valuated stock is 0 items.
    Assume you have a purchase order of 1500 items at 200.00 $ each. Moreover, 10 partial goods receipts are now posted for each of 150 items for this purchase order, so that material X then has a total stock of 1500 items with a value of 300,000.00 $.
    2. Another purchase order now exists of 1500 items at 220.00 $ each. Here also, 10 partial goods receipts are posted for each of 150 items goods receipt. As a consequence, material X now has a total stock of 3000 items with a value of 630,000.00 $. The moving average price is thus 210.00 $.
    3. Now let's look at a delivery of 2849 items. This is valuated as follows using the logic of the quantity to be posted * total value / total stock. This leads to a total stock of 150 items with a value of 31,710.00 $. This does not affect the moving average price, and thus remains 210.00 $ also after the posting.
    Now consider the following postings:
    4. You reverse the first goods receipt under 1. This reversal would valuate the goods receipt of 150 items with a value of 30,000.00 $. As a result Material X after posting has a total stock of 1 item with a value of 1,710.00 $. The moving average price would thus already be 1,710.00 $.
    5. There is now an inventory difference of 150 items without entering an external amount. This posting is valuated with the moving average price and leads to a stock quantity of 151 items with a stock value of 258,210.00 $.
    6. You now enter another reversal for one of the partial goods receipts cited under 1. This then is valuated again with a price of 200.00 $. This results in the material having a stock of 1 item with a value of 228,210.00 $.
    If you now repeat transactions/events 6 and 7, you can imagine that the moving average price grows rather quickly.
    Solution
    This effect is both from a business and accounting point of view the logical result if there are a lot of goods receipts which have to be valuated with the moving average price and goods issues which in contrast to this are posted with an externally predefined amount.
    You can determine tolerance limits for the moving average price variances in Customizing (Transaction: OMC0). Further information can also be found in the R3 guide:  MM - Invoice verification and material valuation.

  • List of Values Problem (messageLovInputBean).

    Hi There,
    I have a quite anoying problem with LOV's on my page.
    I'm using JDeveloper for RUP7.
    I have a messageComponentLayout region with my data.
    I have a input field named Category. This field contains the value of my LOV.
    I have create an LOV VO and Shared Region.
    I have then added a new field (messageLovInput, id: CategoryMeaning) to my region with the following lovMaps:
    MeaningToCategoryMeaning:
    LOV Region Item: Meaning
    Return Item: CategoryMeaning
    Criteria Item: CategoryMeaning
    ValueToCategory:
    LOV Region Item: Value
    Return Item: Category
    My problem is:
    The Category field contains the LOV code from the database. If I select a new value from the LOV the Category and CategoryMeaning fields get updated. If I then apply my changes the new value is saved to the database. That is as it should be.
    But. When the page is loaded the CategoryMeaning field is empty. Even though my Category field contains the value fetched from the database.
    What am I missing here? How can I get the CategoryMeaning field to show the Meaning corresponding to the Value saved in the Category field?
    Thank you in advance.
    Best Regards
    Kenneth Kristoffersen

    Hi Ravi,
    Thank you for your reply.
    There is no "default value" on a messageLovInput bean, so I tried to set he "initial value" to ${oa.IncidentVO1.ExternalAttribute9}
    The CategoryMeaning field shows the text ${oa.IncidentVO1.ExternalAttribute9} and not the value.
    BR Kenneth

  • List of values problem

    Hi...
    during data entry,the user selects from a select list a value and then goes to another select list to continue data entry,the problem is that the second list depends on the first one.Both select lists are on list of values and in the second list of values query the condition was like this:
    'where department = :p3_department'
    where the :p3_department is the first select list.
    at runtime,I see that the second list is empty.
    where I went wrong?
    thanks in advance

    Hi mhdamer,
    you can make your first select list of the type: 'Select List with redirect'
    If you do that and in your second list you make the where clause like you did:
    'where column = :P1_COL_SELECT_LIST_1.
    Though it can be that if you select something from the list, that the page will be refreshed (redirected), so that everything you filled in is gone. Then you must try to make the first select list the first field.
    Kind regards,
    Dave

  • XSLT mapping calls Java class, with hardcoded values-problem at Transport

    Hi All,
    I know the subject may be  misguiding, but i need some suggestions how to handle the following scenario.
    From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
    The problem is, i have hardcoded the Connection parameters....
    and now that we transport these objects to production, the connection parameters will change.
    I thought of two solutions
    1) i create a new java class for Production system
    2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
    But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
    What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
    XI Gurus, please suggest me the correct way to handle.....
    Thanks a lot.
    Mona

    Mona,
    This is what i do..
    1) Parametrize ur current calling class,
    2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
    The call from your current class will be just like
    dbConnect.Runsql("sql as a string");
    the runSql can then internally call
    dbConnect().connect(); //that should do the connection opening.
    then create a prepared statement from your string input and call the db.......
    this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
    Regards
    Ravi

  • SAP ABAP Proxy - recursive data structure problem

    Hi,
    For our customer we try to bind SAP with GW Calendar using GW Web Services. We tried to generate ABAP Proxy from groupwise.wsdl file but there are problems: GW uses recursive data structures what ABAP Proxy can not use. Is there any simple solution to this problem?
    Best regards
    Pawel

    At least I don't have a clue about ABAP Proxy.
    You are pretty much on your own unless someone
    else has tried it.
    Preston
    >>> On Tuesday, August 03, 2010 at 8:26 AM,
    pawelnowicki<[email protected]> wrote:
    > Hi,
    >
    > For our customer we try to bind SAP with GW Calendar using GW Web
    > Services. We tried to generate ABAP Proxy from groupwise.wsdl file but
    > there are problems: GW uses recursive data structures what ABAP Proxy
    > can not use. Is there any simple solution to this problem?
    >
    > Best regards
    > Pawel

  • Abt clear value problem in scripts

    Hi,
    Im working on scripts.in scripts im calculating totals by using subroutine.but im facing problem.
    my problem is first time i calculated it's working fine.
    when i go back and enter other order number it's taking previous order number and present total and it displays these totals.
    i clear the it_out in se38 and the varible which holds the total.
    but it's not working.
    please help me in this.
    Thanks & Regards,
    Srinivas

    Hi this is my abap code.
    FORM get_extpr_tot TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.
    REFRESH : it_output.
    CLEAR v_extpr_tot.
      DATA: v_vbeln2(10) TYPE n.
      REFRESH it_input.
      Clear v_vbeln2.
    clear v_extpr_tot1.
      READ TABLE it_input INDEX 1.
      MOVE it_input-value TO v_vbeln2.
      READ TABLE it_input INDEX 2.
      MOVE it_input-value TO v_extpr_tot.
      v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.
      READ TABLE it_output INDEX 1.
      WRITE v_extpr_tot1 TO it_output-value LEFT-JUSTIFIED.
      MODIFY it_output INDEX 1.
       Clear it_output.
      clear v_extpr_tot1.
    REFRESH it_output.
    ENDFORM.                    "GET_EXTPR_TOT
    and my se71 code is
    PERFORM GET_EXTPR_TOT IN PROGRAM ZSP_SD_ORDCM.
    USING &VBDKA-VBELN&
    USING &V_PRICE&
    CHANGING &V_EXTPR_TOT1&
    ENDPERFORM
    please help me

  • Passing URL as attribute value  PROBLEM

    Here that is a problem
    I had responce.sendRedirect(
    http://167.230.25.121/wts/servlet/ProcessServlet?index=0&ScreenID=http://167.230.25.121/wts/servlet/PoliciesTransactio
    nLogServlet?isFromReport=yes)
    In old NAS 4.0 when i get
    responce.getAttribute("ScreenID")
    I recieve the whole parametr.
    in Tomcat 4.01
    I recieve NULL.
    I need to encode URL somehow and pass it as attribute value.
    I've noticed on Hotmail site MS does it tricky.
    http://209.185.240.250/cgi-bin/linkrd?_lang=EN&lah=d49440f3ef7bf6c2393bf11ff0c8e94e&lat=1012514523&hm___action=http%3a%2f%2fwww%2eWHERESMYREBATE%2ecom
    Can some1 advise , How to do that ? 10x

    What is involved here is to analyze the string and convert any non-alphabetic characters to what is known as escape character (% followed by a hexadecimal representation of the ASCII character).
    It is not that difficult to write a method to do that.
    V.V.

Maybe you are looking for

  • Multiple abends on server hosting groupwise webaccess

    Hi all, I've suddenly got a problem with my Webaccess agent, this started happening a couple of weeks ago and I've tried to install the agent on another server. Problem: After the server abends about 10-20 times i get this message in agent log window

  • WPC pages gives portal runtime error

    hi Experts, i am trying to make a WPC page  but while i am in edit page and i click on page layout or publish or finish i am getting portal runtime error in the pop up window. i am having WPC_Editor role. please suggest what can be the problem here.

  • Am I able to purchase an iPhone 5s?

    My girlfriends mom told me she would allow me to join their family plan as long as I pay her my part ($10(adding a line) $30)data)) I am planing to wait in line for the launch of the iPhone 5s. The account holder will not be there (her mom) but my gi

  • G5/2.3 GHz Computer will neither restart nor shut down

    I unplugged everything except the monitor and keyboard. I ran AppleJack under the deep cleaning mode ("applejack AUTO") after first running it in the normal setting ("applejack auto shutdown"). Still, it will not shut down-even under single user mode

  • MMBE On-order stock columns

    Hi, in trx MMBE when on-order stock column wiil be again 0 ? I postes a goods receipt and MIRO but it remains with the quantity of the only one PO I created... Best regards