Skip to Content
author's profile photo Former Member
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' )

Thanks for your help.

Regards, Thomas

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.