Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Evaluate a formula at runtime

Former Member
0 Likes
463

Dear All,

I need to evaluate a formula which is stored in a Z-table at runtime.

e.g. (a + b) - c * d / 100 (stored in a z-table) at runtime.

how can this be achieved in abap.

Thanks in anticipation.

2 REPLIES 2
Read only

Former Member
0 Likes
413

Try this Logic:

Suppose nees to Evaluate A + B at runtime.

Data:Fs(255) type c,
       itab like standard table of fs.


Append 'Report Ztest' to Itab.
Append 'Data : a type i,' to itab.
Append 'Data : b type i' to Itab.

Get the formula from Ztable.
Append Formula into Itab.   " X = A + B.

Insert Report 'Ztest' from Itab.          " New program Created.

Submit Program 'Ztest' .      " Send Values to variables or use IMPORT/EXPORT

Delete The Program 'Ztest'.

Hope this will resolve the issue.

Regards,

Gurpreet

Read only

Former Member
0 Likes
413

Hi!

look at FM 'EVAL_FORMULA' and demo report RSCALC01.