on 11-17-2021 8:32 AM
I have a requirement to detect leading spaces and lagging spaces from any field can you please suggest IS rule syntax to be used
for example i want to be able to detect the following scenarios
1) (SPACE) ABC
2) ABD(SPACE)
appreciating your help
Laith
Hi Laith,
The response to your question last year (detecting leading spaces in information steward | SAP Community) was more on how to remove the spaces before applying a rule.
I expect you want to create a rule where all records that do NOT have leading or trailing spaces will pass the rule and all the others will be failing.
My suggestion would be to have in the rule expression then the comparison of strlen($input)=strlen(ltrim($input) and if this returns a FALSE, then there must be some Spaces in your $input variable. Same for rtrim.
If you do not want to separate with 2 rules between the leading or trailing spaces you could combine the ltrim(rtrim($input)).
I didn't verify and test the rule within an IS system, but it should be an idea on how to solve the requirement.
Niels
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.