Former Member

# Transformation formular with variables

Hello everyone!

I have a problem My formula is to long.

```IF( /BIC/ZC_CALLB = 1, IF( /BIC/ZK_NDSTTG <> 0, IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 2, '<= 2', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 5, '<= 5', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 10, '<= 10', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 15, '<= 15', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 30, '<= 30', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 45, '<= 45', 'IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 60, '<= 60', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 90, '<= 90', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 120, '<= 120', '> 120' ) ) ) ) ) ) ) ) ), 0 ), 'NULL' )
```

I would like to shrink my formula like the following example but I don't know how to create temp. variables.

```var1= ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR
IF( /BIC/ZC_CALLB = 1, IF( /BIC/ZK_NDSTTG <> 0, IF( var1 <= 2, '<= 2', '> 2' )
```

Regards, Thomas

10|10000 characters needed characters exceeded

### Related questions

Posted on May 20, 2008 at 12:22 PM

We can not use Variables in Formula.

But in such cases ABAP routine should be preferred over Formula, because of writing and debugging ease.

Rgds,

Vikram.

10|10000 characters needed characters exceeded
• Former Member

Hello,

thanks for you answer but the problem is solved. The formula was wrong one ' to much. ðŸ˜‰

The formula works fine now.

Regards, Thomas