cancel
Showing results for 
Search instead for 
Did you mean: 

Formula for chosing value from one of two fields not working

Former Member
0 Kudos

HI SAP experts,

I am trying to use a formula within a Transformation in SAP BI 7. I have got two fields in the DataSource: FKSAK and FKSTK. There's only one field to be filled if I look at one entry, so either FKSAK is empty and FKSTK has a value or the other way around. Now I have tried the following formula in order to pass the value of the populated field to an InfoObject: IF( FKSAK = '', FKSAK = FKSTK, FKSAK ) . First, the formular editor tells me that formula syntax is correct. However, when I try to save the transformation rule or to peform a test of it I get an error message : Formula cannot be compiled. Can anybody tell me, what I have done wrong?

Best regards

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Martin,

As far as I know, the formula editor in BI 7.0 is quite unstable but, have you tried using the is_initial formula instead of ='' ?

Another suggestion, do not use the expert mode in the formula editor, it has given me a lot of trouble...

Kind regards,

Andreea

Former Member
0 Kudos

Hi Andreea,

thanks for answering so prompt :-).

I have tried the following formula (created without using the expert mode): IF( IS_INITIAL( FKSAK ), FKSAK = FKSTK, FKSAK )

However, the error stays the same (please note that it turns out as soon as I want to save or test the rule....not directly after I wrote the formula).

Regarding the formula I have two more hunches what the cause for the error could be:

  • What is the initial value for FKSAK? Do I have to set it up anywhere?

  • Is the replacement of FKSAK with FKSTK using the formula element FKSAK = FKSTK correct?

Best regards

Martin

Former Member
0 Kudos

My bad

I did not read you formula carfully. It should be

IF( IS_INITIAL( FKSAK ), FKSTK, FKSAK )

The assignement on the true branch was wrong.

You don't need to enter any initial value, in fact I think you can leave it like ='', it does the same thing in this case.

Cheers,

Andreea

Former Member
0 Kudos

Thanks Andreea,

I'm quite a newbie to these formulas. It's working now. I was successful activating the transformation. However, if I try to test this transformation rule I get a short dump. Let's hope that it will work anyway.

Best regards

Martin

Former Member
0 Kudos

Hi again

Do you get the short dump while trying to load data?

Former Member
0 Kudos

Hi Andreea,

no, the short dumped appeared as I clicked on "Test transfer rule" in the transformation view. It told me something about "Assertion not set correctly". Anyway, The data load was successful.

Cheers

Martin

Former Member
0 Kudos

yeah...the transfer rules editor...

sometimes it works to get out of RSA1 and then call it again

well, at least the data is loading correctly

Answers (2)

Answers (2)

Former Member
0 Kudos

Why don't you use ABAP routine instead??

Former Member
0 Kudos

Hello everybody,

I have exactly the same case. I used the formula which andreea recommended, tested the Transformation rule. Everything was positive. But then I activated the data in DSO and then the activation of the request wasn't successfull.

Does anybody know what the reason could be?

thank you