2006 Oct 11 7:52 PM
Hi !
Folks, I need create a formula which has to be render for one program ABAP, you all know if exist any module of function which do this?
Exemple: if field1 > field2 then 5.
Field1 = 3 and field2 = 2.
Thanks.
2006 Oct 11 8:09 PM
2006 Oct 11 8:18 PM
Example of function module:
Input Fields
Input Code = "if field1 > field2 then 5"
Output Fields
Result
Tables
Field Name | Field Value
Field1 3
Field2 2
The function should understand the codes ( if, else, than, etc )
Thanks.
2006 Oct 11 8:25 PM
If I understand the situation you would pass just the input code and you wish to output the table with possible values of field1 and field2 ?
Can you please confirm if that is your requirement ????
<b>If that is the case --->
input = 'If field1 > field2 then 5'.
U can try the below logic.
1. Find the string length of input.
2. Search for 'then' in the input string.
3. Calculate the difference between strlen(input) and sy-fdpos from the previous step.
4. Initialise lvalue using the positions from 3.
5. Similarly find the Operator.
6. Do lval times.
field1 = sy-index.
field2 = lval - sy-index.
if field11 > field2.
move field1, field2 to itab.
append itab.
endif.</b>
Message was edited by: Anurag Bankley
Message was edited by: Anurag Bankley
2006 Oct 11 8:29 PM
2006 Oct 11 8:34 PM