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 be getting one detail wrong.
Idea is to have a global stringvar as identifier in each section that changes value with section change. And then use this stringvar in a formula within that section.
//formula a
global stringvar section:="a"
//formula b
stringvar section:="b"
//formula test
stringvar section;
local numbervar test;
If section="a" Then
test:=1
Else If section="b" Then
test:=2;
test
However, the stringvar section is being shown correctly in each section but the result of test is always the same (that for the second section.


Does anybody see what I am doing wrong? Are formulas being executed even if they have not been used yet, i.e. global variable is declared before the formula is even being used?
Thank you
Alex