11-19-2014 9:30 PM
Hi Guys,
I have a scenario where the Relational Operator is coming from a table and i need to use it in my IF ENDIF condition.
IF VARIABLE1 DYNAMIC OPERATOR VARIABLE2.
endif.
DYNAMIC OPERATOR is coming from a table and can get GE, LE , EQ , LT etc...
Apologies if this is asked before but i know about dynamic SELECT , Loop and not IF clause.
If someone can suggest.
Thanks
Bhanu
11-20-2014 4:57 AM
Hi Malik,
This can be done with range or select option.
http://scn.sap.com/thread/1757917
Regards
Sreekanth
11-20-2014 4:19 AM
Hi Bhanu,
Please check if this helps:
Fetch your operator from table to VAR1.
CASE VAR1 . " no need for this to be a field symbol
WHEN 'EQ'.
IF var1 EQ var2.
PERFORM things_i_want_for_EQ.
ENDIF.
WHEN 'NE'.
IF var1 NE var2. " changed to NE
PERFORM things_i_want_for_NE.
ENDIF.
WHEN 'LT'.
IF var1 LT var2. " changed to LT
PERFORM things_i_want_for_LT.
ENDIF.
ENDCASE.
Thanks
Sri
11-20-2014 4:57 AM
Hi Malik,
This can be done with range or select option.
http://scn.sap.com/thread/1757917
Regards
Sreekanth
11-20-2014 5:43 AM
You can best achieve this by using returning parameters in local classes.
Read the abap documentation for returning.
11-20-2014 9:56 PM
Hi Guys,
It actually turned out to be a very simple and small code to deal with this scenario.
Sreekanth: Your referance worked and all i had to do was a simple routine passing my variable1 and variable 2 and operator in a range.
Chinmay: Not sure if you are referring to a local class which calls ranges.
Srilakshmi: I never wanted to write all that code.
Thanks everyone i am marking this as answereed