on ‎2023 Aug 17 6:08 PM
Hi dear community,
I have some trouble with a BRF+ task. I am looking for a solution to return a space " " as value for a single element.
Our use case:
We want to use BRF+ to generate a short text for materials with four BRF+elements
e.g. W_5_12_2
This is already done, but now there are some special possibilities:
One or more elements can be empty, and so we have to return one or more spaces " " (without the quotes of course and I also tried it with ' ' and * *)
e.g. W_ _12_2
1. I have tried to assign space value within a decision table
2. I have also tried to solve this with a workaround - Therefore I have created a formular with ' '. This solution only works if there are some digits infront. If the formular starts with a space, it won´t get returned.
3. I have tried to set a variable or a constant with a space value, but it automatically deletes all spaces.
Is there any possibility...a special string or something like that, to return a single space to an element?
And yes, the spaces are necessary to keep every digit on its regular position
Thank you very much in advance
1.

2.

3.

Request clarification before answering.
Hello Björn,
withing BRF+ this should work. If you are checking the simulation mode or BRF+ trace values, you will get wrong (condensed) results.
I made two easy formulas, one with '', the other with ' '; because we know, BRF+ treats this differently 😉
In debugger (Methode PROCESS_PURE) there is difference in hexa-value, so there is difference between those two values:

And there is even one example by SAP in formula (SHIFT_RIGHT_PLACES), where "blank" is put on the first place:

In debugger is this correctly shown:

I would say, according to hexa-values, that also your example is working:
First formula: abcd
Second formula: ' ' & 'abcd'
Third formula: ' ' & 'abcd' & ' '

Then I made simple decision table and incorporated it with formula and got this in BRF+ debugger:

Decision Table:

Formula CONCATENATE_BLANKS:

Formula for concatenating blank + 1:

I didn't check how ABAP is working after we leave BRF+, but if you don't see correct length values in PROCESS_PURE of your class, you should report bug to OSS or look for notes.
Best regards
Nana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bjbjoern.rohdern,
You can try to concatenate your result with a FORMULA.
Inside the formula, you can create an IF condition, if the element is INITIAL then " ". This will give you the space you are searching.
I hope this solve your requierement, please dont forget to point.
Best Regards,
Carlos Idiaquez
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carlos, thank you very much. Meanwhile I did something similar (I put "*"instead of " " in all decision tables)
And at the end I have implemented a formular which exchange all "*" to " ".
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.