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...
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...
{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...
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...
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...
:-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...
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...
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...
@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...
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...
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...
@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.
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.