Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

If/Else/Then statement in Bex

Hi all,

I want to create some conditional logic in Bex formula. The logic I need is:

IF (KeyFigA exists) THEN (use KeyFigA) ELSE IF (KeyFigB exists) THEN (use KeyFigB) ELSE (use KeyFigC)

I am a bit confused on the operators I need to use...Can anyone help?



Former Member
Former Member replied


It depends on what you mean by "EXISTS" here. If it means that the value is <> 0, then the logic would be:

( KFA .NE. 0 ) * KFA + (KFA == 0 ) * (KFB .NE. 0 ) * KFB + ( KFA == 0 ) * ( KFB == 0 ) * KFC

Note: ".NE." above will actually be a < followed by >, but this silly editor doesn't like those characters.

Hope this helps...


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question