Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    Thank you both for your support. I appreciate you trying to help me. I did not describe anything elae because there is nothing else to describe and I don't know what else to tell you. I have tried all kinds of approach ideas. There is effectively one input value, a simple mathematical...
  2. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    I do not know how to be more clear, I'm sorry. I am of course suppressing the sections I do not want to see. But the point is that I cannot change the input used (which alters the result) of a formula based on which section it is placed in. So, once again: I have one formula and two details...
  3. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    {Field1}=[11.2454, 22.4805, 66.32, 32.1206] {Field2}=[23.6734, 33.567, 19.0, 101.0003] Result ist the same value as input value but formatted either as decimal with adjusted number of decimal places toText({FieldX}, {?Decimals}) or scientific notation, i.e. 1.12454E+1. And then converted to a...
  4. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    Thank you for your help but to be honest, this discussion was going nowhere. Sample data? Use as many different float values as you want. Result? Use any number and convert it to text. As I said: input number, play with it, output result. Details are irrelevant. The goal was to identify the...
  5. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    Okay. I don't see how it makes any difference, but let's see. Here the simplest of simple examples (omitting the scientific notation creation steps). local numbervar input:=1.23;// example value for {field1} local stringvar final_result; local numbervar reference:={fieldref}; If input=0 Then...
  6. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    :-D What difference does it make? In one case the difference between the two fields is a factor. One value is the raw, relative value (€/month) and the other is the absolute (€ total). In other cases they have other data and are processed differently. I then convert and calculate different...
  7. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    Sorry, the `stringvar section_identifier` is taken from whatever formula is placed in the two sections. I did not write it down because I obviously do not know the formula. So in your examples it would have been the variable "test". // formula {a} placed in Details a somehow declare...
  8. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    I want to use one formula in details a and in details b. Then I want that formula to select the input database field depending on whether the formula is being called in details a or in details b. local numbervar inputdata; stringvar section_identifier; If section_identifier="Details_a" Then...
  9. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    @dgillz Thank you for your response, but no, your code does not work either (or rather it does, if that were the goal ;)... if you adjust the if expression to "=" instead of ":=" ) But the actual issue is that your code will return "1" for @ValueSecA, no matter whether I place it in details a...
  10. AleXSR700

    How can I make variable that is re-defined per section and readable in same-section formula?

    Good morning, unfortunately my initial approach for using a formula to identify the section the formula is iused in, was not possible with built-in methods (https://answers.sap.com/questions/13931185/possible-to-use-if-with-referal-to-eg-details-b.html). I now have a new approach but I seem to...
  11. AleXSR700

    How to find first non-zero decimal place?

    Do you, @pmax9999, or someone else know if it is possible to check if the number following the first non-zero decimal is itself a zero?
  12. AleXSR700

    How to find first non-zero decimal place?

    Yes, I opted for the exact same solution. :-) In addition I added an iteration limit of 99 (to prevent error messages whenever the number is 0) I think the error is, that the first case, i.e. 0 leading zeros means that there is a decimal. But if there is no decimal at all, then...
  13. AleXSR700

    How to find first non-zero decimal place?

    @pmax9999 I just found that if the value does not have any decimals, i.e. an integer, it seems the code no longer works. So if `Number:=10` the code will not work.
  14. AleXSR700

    How to find first non-zero decimal place?

    Perfect! I modified it to be independent of the amount of decimals. Although maybe I will limit to 99 to prevent the system from crashing. But it seems CR will simply output an error rather than crash. Or simply add an `If Number<>0` local numbervar Number:=10.00000123; local numbervar...
  15. AleXSR700

    How to find first non-zero decimal place?

    Sure thing. So, let's say I have a report displaying a number 0.0001234. Now the size of that report field is limited (say 1 cm width). A decimal number with 4 leading zeros might not fit in the field. So I can define a macimum amount of decimals by using toText(Number, Decimals). But, if I...
  16. AleXSR700

    How to find first non-zero decimal place?

    Hello everyone, I would like to display numbers with a defined amount of decimal places. Let's take 0.001 local numbervar Decimals :=2 toText(Value, Decimals) This would result in "0.00". So, if the resulting number where to only contain zeros, I would like to increase the amount of decimals...

Part and Inventory Search

Back
Top