cancel
Showing results for 
Search instead for 
Did you mean: 

BRF+ return value ' ' space

08-17-2023 7:08 PM
bjoern_rohde Explorer
4031 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

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

  • Element 1: W
  • Element 2: 5
  • Element 3: 12
  • Element 4: 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

  • Element 1: W
  • Element 2: " "
  • Element 3: 12
  • Element 4: 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.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Nana
Explorer

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

bjoern_rohde
Explorer
0 Likes

Hi Nana,

thank you very much for your comment - I will definitly try this.

Best regards

Björn

Answers (1)

Answers (1)

Carlos_Idiaquez
Participant

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

bjoern_rohde
Explorer

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 " ".