Round to first non-zero digit

I am looking for a way to round floating point values the first n'th non-zero digit to the right of the decimal point.
for example if n = 1 then
round 0.01111 to 0.01
round 0.001111 to 0.001
round 0.0001111 to 0.0001
If I use the round argument then I need a way to determine what the parameter should be for the 2nd argument.
This requires me knowing how many zeros are to the right of the decimal point and before the first non-zero digit.
I have developed the following function to determine this. It is based on the binary search algorithm and will iterate at most 8 times.
CREATE OR REPLACE FUNCTION NUMBER_OF_LEADING_ZEROS(P_VALUE BINARY_DOUBLE) RETURN NUMBER IS
     L_MIN_ZEROS NUMBER;
     L_MAX_ZEROS NUMBER;
     L_MID NUMBER;
     L_ABS_VALUE BINARY_DOUBLE;
BEGIN
     L_MIN_ZEROS := 0;
     L_MAX_ZEROS := 130;
     L_ABS_VALUE := ABS(P_VALUE);
     IF L_ABS_VALUE IS NULL THEN
          RETURN NULL;
     ELSIF L_ABS_VALUE = BINARY_DOUBLE_NAN Or L_ABS_VALUE < POWER(10, -L_MAX_ZEROS) Then
          RETURN L_MAX_ZEROS;
     ELSIF L_ABS_VALUE >= 0.1 Then
          RETURN 0;
     END IF;
     LOOP
          L_MID := TRUNC((L_MIN_ZEROS + L_MAX_ZEROS) / 2);
          IF L_ABS_VALUE < POWER(10, -L_MID) And L_ABS_VALUE >= POWER(10, -(L_MID + 1)) Then
               RETURN L_MID;
          ELSIF L_ABS_VALUE < POWER(10, -(L_MID + 1)) Then
               L_MIN_ZEROS := L_MID + 1;
          ELSE
               L_MAX_ZEROS := L_MID - 1;
          End If;
     END LOOP;
END;If anyone can think of a more efficient way of doing this that would be great.

so small change to the above...
WITH tab AS
  ( SELECT 1.11111 col1 FROM dual
UNION ALL
   SELECT 0.001111 FROM dual
UNION ALL
   SELECT 0.0001111 FROM dual
UNION ALL
   SELECT 12.8518 FROM dual
--end of test data
SELECT ROUND(col1,case when LENGTH(regexp_substr(col1,'.0*'))=1 then 0 else LENGTH(regexp_substr(col1,'.0*')) end) col1,
  LENGTH(regexp_substr(col1,'.0*'))
   FROM tab;o/p of test when applied......
SQL> WITH tab AS
  2    ( SELECT 1.11111 col1 FROM dual
  3  UNION ALL
  4     SELECT 0.001111 FROM dual
  5  UNION ALL
  6     SELECT 0.0001111 FROM dual
  7  UNION ALL
  8     SELECT 12.8518 FROM dual
  9    )
10  --end of test data
11   SELECT ROUND(col1,case when LENGTH(regexp_substr(col1,'.0*'))=1 then 0 else LENGTH(regexp_subs
tr(col1,'.0*')) end) col1
12     FROM tab;
      COL1
         1
      .001
     .0001
        13Ravi Kumar

Similar Messages

  • How to find first non zero value from the numeric value or string?

    Hiii, Every body
              I have one numeric indicator in which some valuse is coming with the decimal value, lets say 0.00013, now i want to find the first non-zero value from this numeric indicator, then what should i do to do so? i have converted it in the string, but i could not find any method to find first non-zero value from that string or either from the numeric indicator????
          Can you please help me, how to do it? i have attached the vi and write all the description inside.
    Thanks in Advance,
    Nisahnt
    Attachments:
    Find first nonzero.vi ‏20 KB

    Just convert it to an exponential string and take the first character .
    Message Edited by altenbach on 05-10-2006 08:00 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FisrstNonzeroChar.png ‏3 KB
    FindFirstNonzeroCharacter.vi ‏20 KB

  • AutoSize not working properly in TextField when using non-zero line spacing

    When using non-zero line spacing, the autoSize property is not functioning as expected, causing text fields to scroll that shouldn't.  Also, when using device fonts, the sizes of the TextFields are wrong in the Flash IDE.
    I have a TextField whose height is supposed to be dynamic, depending the width of the TextField.  wordWrap is true, the text is left aligned, and the autoSize value is flash.text.TextFieldAutoSize.LEFT.
    When the TextField's width is adjusted, the height increases or decreases as expected, but when I scroll the mouse wheel over the TextField, it allows a single line to scroll out of view.  This should not be happening.  The autoSize property should ensure the TextField is large enough to neither require nor allow scrolling.
    Has anyone else encountered this issue or know how to fix it?
    Update: Been a problem since at least 2006! > http://blog.nthsense.net/?p=46
    http://www.kirupa.com/forum/showthread.php?288955-Disabling-textfield-scrolling   Bug is caused by using a line height ("line spacing" in Flash) larger than zero, for example 1.0pt.  It looks like when I reduce the line spacing of the text field to zero, the issue goes away.  There doesn't seem to be anything wrong with how autoSize is calculating the required height of the text (i.e. it is exactly textHeight + 4 pixel gutter, and drawing the rectangle (2,2,textWidth,textHeight) aligns visually with the text), so it must have to do with how the TextField is deciding whether it needs to scroll or not, and that separate calculation is being thrown off by the non-zero line spacing.  The additional non-zero spacing at the end of the last line could be making the TextField think it needs to scroll, even though it's hight is sufficient at "textHeight + 4".  Apparently the problem manifests when using a non-zero leading value as well.
    In fact, it has to be related to the leading value exactly, since the following code stops the textfield from scrolling.
    //body is TextField
    var tlm:TextLineMetrics = body.getLineMetrics(body.numLines - 1);
    trace(tlm.leading); //traces "1" here.  traces zero when line spacing is zero, and traces larger values with larger line spacing values
    body.autoSize = flash.text.TextFieldAutoSize.NONE; //turn off autosize so the height can be set manually
    body.height += tlm.leading; //increase height of textfield by leading value of last line to cause scrolling to be turned off.
    Honestly, this is pretty unacceptable bug.  First of all, scrolling should not be sensitive to trailing line spacing, because autoSize and textHeight do not include it. It need to be consistent, and I think textHeight and autoSize setting height = textHeight + 4 is correct.  Vertical scrolling should use textHeight as it's guage for whether scrolling is necessary, but instead, it's obviously involving the leading values of the last line.  At the very least, vertical scrolling should simply be disabled when autoSize is turned on and wordWrap is true, because the TextField should be big enough to fit all the text.  The workaround of manually adjusting the height is also no good, since turning autoSize back on will immediately change the size back and trigger scrolling again.  I also shouldn't have to set line spacing to zero just to use the autoSize feature, since the scrolling calculations are wrong in this way.

    No, lol.  Luckly, I replace most of my TextFields on the display list with my subclass TextFieldEx.  I just call a clone method that accepts a TextField and returns a TextFieldEx with identical properties.
    I corrected the problem via modifying the subclass to behave differently when autoSize is not NONE and wordWrap is true.  Under those conditions, the maxScrollV and scrollV property values are fixed at 1, and the class listens for its own SCROLL event and sets scrollV to 1 when it occurs.  That allows me to leave everything else alone, including text selection, and use whatever line spacing I want.
    The modification seems to work fine so far.
    For anyone interested in doing something similar, here is a clone method that will copy a TextField.
    public static function clone( t:TextField ):TextFieldEx
                                  var te:TextFieldEx = create( "", t.width, t.type, t.multiline, t.wordWrap, t.selectable, t.embedFonts, t.defaultTextFormat );
                                  te.alpha = t.alpha;
                                  te.alwaysShowSelection = t.alwaysShowSelection;
                                  te.antiAliasType = t.antiAliasType;
                                  te.autoSize = t.autoSize;
                                  te.background = t.background;
                                  te.backgroundColor = t.backgroundColor;
                                  te.blendMode = t.blendMode;
                                  //te.blendShader = t.blendShader;
                                  te.border = t.border;
                                  te.borderColor = t.borderColor;
                                  te.cacheAsBitmap = t.cacheAsBitmap;
                                  te.condenseWhite = t.condenseWhite;
                                  te.displayAsPassword = t.displayAsPassword;
                                  //te.embedFonts = t.embedFonts;
                                  te.filters = t.filters;
                                  te.gridFitType = t.gridFitType;
                                  te.height = t.height;
                                  te.opaqueBackground = t.opaqueBackground;
                                  te.restrict = t.restrict;
                                  //te.selectable = t.selectable;
                                  te.sharpness = t.sharpness;
                                  te.thickness = t.thickness;
                                  te.transform = t.transform;
                                  //te.type = t.type;
                                  te.useRichTextClipboard = t.useRichTextClipboard;
                                  //te.wordWrap = t.wordWrap;
                                  //Assign text last
                                  te.htmlText = t.htmlText;
                                  return te;
    //And the create method it uses
    public static function create( text:String = "", width:Number = NaN, type:String = null, multiline:Boolean = false, wordWrap:Boolean = false, selectable:Boolean = true, embedFonts:Boolean = false, font_or_textformat:*=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null ):TextFieldEx
                                  var tf:TextFieldEx = new TextFieldEx();
                                  tf.width = isNaN(width) ? 100 : width;
                                  tf.defaultTextFormat = (font_or_textformat is TextFormat) ? (font_or_textformat as TextFormat) : new TextFormat( font_or_textformat as String, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading );
                                  tf.embedFonts = embedFonts;
                                  tf.multiline = multiline;
                                  tf.wordWrap = wordWrap;
                                  tf.selectable = selectable;
                                  tf.type = type;
                                  tf.text = text; //setting text last ensures the text line metrics returns correct values
                                  //Initialize the TextField's size to fit the text.
                                  if (!multiline)
                                            //When in single-line mode and no specific width is given,
                                            //expand width to entire line.
                                            if (isNaN(width))
                                                      tf.width = tf.textWidth + 4; //match width of text
                                  //Height is always automatically adjusted to fit the text by default.
                                  //It's better than the arbitrary 100px default height.
                                  var minimum_height = tf.getLineMetrics( 0 ).height;
                                  var h:Number = tf.textHeight;
                                  tf.height = (h < minimum_height) ? (minimum_height + 4) : (h + 4); //match height of text, ensuring height is at least enough to display one line, even if there is no text
                                  return tf;

  • While creating OpenDirectory replica, I get a "non-zero status code". How do I fix this?

    I'm trying to create an OpenDirectory replica with OS X 10.9.2 servers running Server 3.1.1. The server seems to connect to the master momentarily, but ultimately the connection fails. The log file shows:
    May 21 11:25:01 inglewoodmirror.local Server[323]: An error occurred while configuring InglewoodMirror as a directory replica:
    Error Domain=XSActionErrorDomain Code=69 "Server returned a non-zero status code"
    UserInfo=0x608000a73500 {NSLocalizedDescription=Server returned a non-zero status code}
    The Apple Discussion titled, "Error occurred creating OD replica" addressed the issue by running Workgroup Manager to backup users, before destroying and recreating the OD.  However, that user also botched the master-replica relationship by changing the host name of the master without destroying the replica's first.
    I'm hoping that there is a simpler method to solve this issue.  It is my understanding that Workgroup Manager is a depricated app, so I am hesitant to use the method recommended by the referenced solution.
    What causes this error?  How can one attempt to remedy this without destroying the master?

    Update
    I have been trying to diagnose this by analyzing the network traffic, which has been enlightening, but it suddenly dawned on me that I had not checked the "Logs" section of the Server application.  Checking the Log and changing the specific Log to "Configuration Log" in the OpenDirectory section, I see the following:
    This error is much more clear than the text described above.  It seems that the problem is not network communication, rather it is that the OpenDirectory administrator is not the same as the system administrator.  I had thought that the user account was one and the same.
    So, now the question becomes.....
    How do I determine the userId of the directory administrator?
    The password is known.  We have a standard password that we use in this company for such things, but the user account is not known.  That changes based on the machine which houses the directory.  Does anyone have a suggestion?

  • Allocation Question -- Selecting Non-zero Dimension Members?

    Hi experts,
    (BPC 7.5 NW)  During an Allocation process, if you have a dimension, such as COSTCENTER for which only some members have data (in my case, about 400 of 700), which is not the driver dimension and you'd like to have the Allocation write back to those same members, while leaving the blank ones blank, is there some special process?
    In this example, you can see it selecting the CC's which are <> NO_COSTCENTER, but USING the Allocation rate, which as a stat account is stored in NO_COSTCENTER.
    So, it all works, except that the logic function writes a percentage to all three CC's specified in the *XDIM_MEMBERSET, even if there were initially values in only one or two.  Is there any way to have it write only to the ones that were initially populated/non-zero?
    ===================================================================================
    *XDIM_MEMBERSET ACCOUNTGL=A54442000,A54443000,A59989000,ALLOC_0702
    *XDIM_MEMBERSET COSTCENTER=CC01000,CC01004,CC01027,NO_COSTCENTER
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *XDIM_MEMBERSET CO_CODE=C001
    *XDIM_MEMBERSET TIME=2007.APR
    *RUNALLOCATION
    *FACTOR=USING
    *DIM COSTCENTER WHAT<->NO_COSTCENTER; WHERE<->NO_COSTCENTER; USING=NO_COSTCENTER
    *DIM ACCOUNTGL WHAT=A54442000,A54443000; WHERE=A59989000; USING=ALLOC_0702
    *ENDALLOCATION
    *COMMIT
    Edited by: Garrett Tedeman on Nov 4, 2010 6:59 PM
    Edited by: Garrett Tedeman on Nov 4, 2010 7:24 PM
    Update -- Just discovered that the "AMOUNT" keyword, which was used on the MS version, will not validate on BPC 7.5 NW.

    Hi Garrett,
    I'm not sure I understood what is the problem here: is it that allocation overrides some existing values on those Cost centers and Account A59989000 or you just don't like those records with zeroes?
    If it's the last one, that just run light optimization and check that zero elimination is turned on. It will delete your records with zeros.
    If it's the first one, that common practice is to use additional Dimension (DATASRC for example) and populate it with some value for all Cost centers from which you taking data (INPUT for example); than include it in allocation with WHAT = INPUT. You have to define additional member in that dimension (RESLT for example) and put WHERE = RESLT in allocation. By using this technique you achieve at least two benefits:you don't override existing values and you can run allocation as many times as you want without deleting results of previous allocations. You don't have to use that dimension in your reports and data will be just summarized across that Dimension.
    Please let me know if you had something different in mind.
    Regards,
    Gersh

  • How to start a contour move from a non-zero position

    Hi,
    I am using a PXI 7344 motion controller under LabVIEW 8 to do a vector contour move. How can I start the contour from a non zero position ? I want to use absolute position mode. The test requires the x axis to move to a known distance and wait for a known time (more than a 1 hour) before the contour starts.

    Hi Milinda,
    Unfortunately the zero position is inserted at the beginning of the
    array points by the firmware. As far as I know there is no way to stop
    this happening. The only way to get round this is to use reletive
    positioning and keep track of the current position.
    Regards
    Jon B
    Applications Engineer
    NIUK

  • Cisco ASA non zero downtime upgrade

    Hello,
    with a NON zero downtime procedure upgrade all connections are lost, even nat and arp table ? here, http://www.cisco.com/c/en/us/td/docs/security/asa/asa84/configuration/guide/asa_84_cli_config/ha_overview.html#wp1078922, on Table 61-2 State Information I think it is only for plain failover but not for upgrade with a non zero downtime upgrade procedure.

    Assuming you have a working HA pair with stateful failover, the Cisco supported answer is that you cannot skip minor releases (i.e. going from 9.1 directly to 9.3).
    You CAN upgrade directly from 9.1(2) to 9.1(5) as that third ordinal (the number in parentheses) is known as the maintenance release level.
    See table 1-6 in the Release notes for confirmation, excerpted here:
    "You can upgrade from any maintenance release to any other maintenance release within a minor release.
    For example, you can upgrade from 8.4(1) to 8.4(6) without first installing the maintenance releases in between."
    Note that 9.1(3) or later have some restrictions that are unique to those more recent code levels as some file system changes were put in place that requires certain prerequisites for a successful upgrade. Given that you are on 9.1(2) already that doesn't affect you in this case but it may be a consideration for other readers. Those requirements are noted just above Table 1-6 in those release notes.

  • How to find three consecutive non zero number from an array

    Hi, I'm trying do a very simple program in labview, but I'm stuck.
    I have an array of u8 in a sequence of zeros and non zeros, but I'm interested on finding the first three consecutive non zeros on the array.
    ie.  0 0 0 0 1 0 0 2 3 0 0 2 3 3 0 0 ...
    the output would be 2 3 3
    Thank you Gustavo R. 
    Solved!
    Go to Solution.

    GustavoRamirez wrote:
    the output would be 2 3 3
    None of the examples given above output the specified array of three elements. You need to also deal with the case where no match is found. Your while loops will never finish!
    Here's another way to do this.
    Message Edited by altenbach on 06-10-2009 11:21 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FindFirstNonzeroSubset.PNG ‏8 KB
    FindFirstNonzeroSubset.vi ‏12 KB

  • Fast way to find the number of non-zero terms in an array or image

    I am trying to use the Standard Deviation PtbyPt Vi.  It takes in a series of points, can be reset when beginning the calculation.  There is also an input for sample size.  I am calculating some statistics on an array...and would only  to include like the non-zero elements that are  in the sample. 
    Is there a quick way to look at an array and find the number of non-zero elements?
    Thanks.
    Solved!
    Go to Solution.

    GerdW wrote:
    - for big arrays this may lead to "out of memory" problems because of creation of data copies
    Here's a quick rundown on memory allocations based on the algorithm.
    (case 1&3)
    If you do the "!=0, ?1:0, I32, sum" shuffle, each step needs to allocate a new array, so if the input array is DBL and uses N amount of memory, we need 7N/8 more memory.
    (Total of 15N/8, or 13N/8 if we don't need the I32, but in this case the array are too small to worry about anything )
    The nice thing is that it works for any array dimensionality (1D, 2D, 5D, etc...)
    (Case 2&5)
    If you do the summing in a shift register, No additional array memory is needed. Unfortunately, the code needs to be changed by adding an extra FOR loop for each dimension (see case 5 for 2D inputs).
    (Case 4)
    If we reshape the N-D array to a 1D array, we need to create a second copy, so the memory usage is about twice. This also works for any dimension.
    In real life, and if memory is a potential issue, you should always do some benchmarks.
    Often, the issues are more complex, so this is just a quick summary.
    Message Edited by altenbach on 10-23-2008 11:59 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CountNonZero.PNG ‏29 KB

  • Error saving map. Stored procedure returned non-zero result BizTalk Bug

    Hallo all
    MSDN is reporting this Bug.
    "Error saving map. Stored procedure returned non-zero result." error message when you deploy the BizTalk Server 2010 applications in BizTalk Server 2010 Administration Console"
    http://support.microsoft.com/kb/2673264/en-us
    I am having this problem in BizTalk 2013. Is this correct? or I am doing something wrong..
    This error occured as I was about to deploy BizTalk application from Visual studio 2012 to BizTalk 2013.
    If this bug is available in 2013, where can I get a fix for it..
    Thanks in Advance
    AKE

    Hi AKE,
    Fix for this bug in BizTalk Server 2013 is not publicly available yet. Only option to get the fix for this bug is to contact:
    http://support.microsoft.com/contactus/?ws=support
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • ABAP Query - How to display non-zero entries

    Hi All,
    I have created a simple query having the join of 4 tables.
    Now I need to display the output for only non-zero entries of a particular field.
    How this can be achieved ?
    Please let me know-
    1) Either , there are ways to restrict the entries during selection itself(I do not want to give this field in selection screen)
    2) Or , Delete the entries having zero value before display.
    I debugged the standard report for query and found out the internal table where the
    result is stored, but it is not allowing to be used in the coding sections of infoset.
    Thanks ,
    Neethu

    In select add condition field1 NE 0 or SPACE.
    Edited by: Shaik Hussain on Nov 30, 2010 1:46 PM

  • Condition Type VPRS to br made as mandatory and Non Zero

    Dear Experts,
    In the pricing procedure i want to make  condition type VPRS (Stansard Price) as mandatory and non Zero. It means system should give an error message if the value for condition tye ZPRS is either blank or Zero. I know how to make this condition ZPRS as mandaory but dont know how to mark as non zero.
    Pl guide on the same.
    Thanks in advance.
    Pallavi

    Hello,
    Please ensure to have the below setting in place as far the pricing condition type ZPRS is concerned.
    Subtotal will be "B" and Requirement should be "4".
    "Condition category" of the Pricing Condition Type should be G.
    Maintain the Price values at Accounting tab 1 of the Material Master record so that when Sales Order is processed the value will be picked from Material master.
    There should not any access sequence assigned to this Pricing Condition Type.
    Kindly update this thread based on above suggestion so this issue can be resolved.
    Regards,
    Sarthak

  • Select non-zero columns

    if we have data in the following format:
    c1 c2 c3 c4
    0 234 0 12
    0 111 0 11
    0 280 0 38
    0 387 0 49
    the above no.of columns can be variable
    how can we select only non-zero columns - c2 and c4

    Hi,
    This requires dynamic SQL.
    To find if table_x.c1 contains anything except 0 (incluiding NULL), you could say:
    SELECT  'TABLE_X', 'COL1'  FROM  dual  WHERE EXISTS (SELECT NULL FROM table_x WHERE NVL (c1, 1) != 0);What you have to do, using dynamic SQL, is write a SELECT statement like that for every column you want to test.
    So you'll need a query like
    SELECT  'SELECT '''
            || table_name
            || ''', '''
            || column_name
            || ''' FROM dual WHERE EXISTS (SELECT NULL FROM '
            || table_name
            || ' WHERE NVL ('
            || column_name
            || ', 1) != 0);'  -- Omit ';' in PL/SQL
    FROM    all_tab_cols
    WHERE   ...  -- whatever you needIn SQL*Plus, you can write all of these statements to a SPOOL file, and then execute it by saying @spool_file.
    In PL/SQL, you would use EXECUTE IMMEDIATE to run each statement.

  • *** ERROR = The Java VM terminated with a non-zero exit code.

    DEAR MASTERS
              after configuring SLD on integerated ABAP+JAVA   server0 not starting   
    trc file: "D:\usr\sap\W55\DVEBMGS00\work\dev_server0", trc level: 1, release: "700"
    node name   : ID9278150
    pid         : 4140
    system name : W55
    system nr.  : 00
    started at  : Sat Mar 21 08:45:23 2009
    arguments       :
           arg[00] : D:\usr\sap\W55\DVEBMGS00\exe\jlaunch.exe
           arg[01] : pf=D:\usr\sap\W55\SYS\profile\W55_DVEBMGS00_wipro5
           arg[02] : -DSAPINFO=W55_00_server
           arg[03] : pf=D:\usr\sap\W55\SYS\profile\W55_DVEBMGS00_wipro5
           arg[04] : -DSAPSTART=1
           arg[05] : -DCONNECT_PORT=1060
           arg[06] : -DSAPSYSTEM=00
           arg[07] : -DSAPSYSTEMNAME=W55
           arg[08] : -DSAPMYNAME=wipro5_W55_00
           arg[09] : -DSAPPROFILE=D:\usr\sap\W55\SYS\profile\W55_DVEBMGS00_wipro5
           arg[10] : -DFRFC_FALLBACK=ON
           arg[11] : -DFRFC_FALLBACK_HOST=localhost
    JHVM_BuildArgumentList: main method arguments of node [server0]
    [Thr 4668] Sat Mar 21 08:58:30 2009
    [Thr 4668] JHVM_RegisterNatives: registering methods in com.sap.bc.krn.perf.PerfTimes
    [Thr 4668] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartup.JStartupFramework
    [Thr 4668] JLaunchISetClusterId: set cluster id 9278150
    [Thr 4668] JLaunchISetState: change state from [Initial (0)] to [Waiting for start (1)]
    [Thr 4668] JLaunchISetState: change state from [Waiting for start (1)] to [Starting (2)]
    [Thr 4428] Sat Mar 21 08:59:58 2009
    [Thr 4428] JHVM_RegisterNatives: registering methods in com.sap.mw.rfc.driver.CpicDriver
    [Thr 4428] JHVM_RegisterNatives: registering methods in com.sap.i18n.cp.ConverterJNI
    [Thr 4616] JLaunchIExitJava: exit hook is called (rc = -11113)
    [Thr 4616] **********************************************************************
    ERROR => The Java VM terminated with a non-zero exit code.
    Please see SAP Note 943602 , section 'J2EE Engine exit codes'
    for additional information and trouble shooting.

    Hi,
    Please find the link below for J2EE start up problem.
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e09e4a5e-8280-2a10-ca98-a59dd47d396d]
    Please refer to following note for VM settings.
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=723909]
    Please also check the license validity on this server.
    Hope this helps.
    Manoj Chintawar

  • Non zero values in the extraction of the planning area

    In our DP implementation we have been trying to extract 2 key figures  from the planning area, one of the key figures might have zero values, when we set the indicator for the non zero values then it only eliminates the records for which both the key figure are zero but that is not what I want. I am trying to have a setting in the data source where we can reject the records even if one of the key figure has zero values.
    Are there any settings for that while we are generating the data source.
    Thanks in advance

    Hi Colin,
    This can be easily solved using a slightly different ABAP routine. You can assign the fields that you need to check into other field symbols and then check the value of those field symbols.
    Here's one possible solution. I based in from the ABAP code you posted.
    field-symbols: <LS_EXTR_BLOCK> TYPE any,
                         <ls_fcst> type any,
                         <ls_hist> type any.
    data: w_pos type sy-tabix.
    loop at ct_data assigning <LS_EXTR_BLOCK>.
    w_pos = sy-tabix.
    assign component '/BI0/9AVCORFCST'
       of STRUCTURE <LS_EXTR_BLOCK> to <ls_fcst>.
    assign component '/BI0/9AVCORHIST'
       of STRUCTURE <LS_EXTR_BLOCK> to <ls_hist>.
    if <ls_fcst> = 0 and <ls_hist> = 0.
      delete ct_data index w_pos.
    endif.
    endloop.
    Aside from the solution above, you can also define the structure of CT_DATA (that's basically the structure of the extract structure of your datasource). You can then assign the contents of CT_DATA to a field-symbol and the delete data using that field symbol.
    Here's an example:
    TYPES:
    TY_DATA_TABLE type table of *PUT THE NAME OF YOUR EXTRACT STRUCTURE HERE*.
    field-symbols:
    <FS_DATA_TABLE> type TY_DATA_TABLE.
    DELETE <FS_DATA_TABLE> WHERE /bi0/9avcorfcst = 0
    and /bi0/9avcorhist = 0.
    You can check the name of the extract structure by viewing table /SAPAPO/TSAREAEX field EXPORT_STRU. You can also see the name of the extract structure in debug mode by looking at the value of the parameter IV_DDIC_REFERENCE.
    Hope this helps

Maybe you are looking for