Application Development 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: 

Passing values to formula

Former Member
0 Kudos

Hi All,

Is there any function module to create and read formula?Here I need to calculate the price for purchased material.i am using formula to calculate price.Each tax code having its won formula.

I would like to store these formula in z-table and use it in my program.So there is no need to change my program when changes occurs.My Question is how to read this field value as formula?.........for reference refer the table tc25.

example: (pb00+jin2) / menge.

pb00 - base value,

jin2- service tax,

menge -quantity.

How should i pass the value to pb00,jin2 and menge.

Let me know if there is any doughts in my questions. It will be geartful if u share ur ideas with me pl.

Thanks in Advance!!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

you should use subroutine like this...

suppose you have to add two no.

then .

PERFORM ADD USING A

B.

form ADD USING AA type i

BB type i.

data :cc type i.

cc = AA + BB.

endform.

5 REPLIES 5

Former Member
0 Kudos

hi,

you should use subroutine like this...

suppose you have to add two no.

then .

PERFORM ADD USING A

B.

form ADD USING AA type i

BB type i.

data :cc type i.

cc = AA + BB.

endform.

Former Member
0 Kudos

Hi,

I can suggest you to create a function module which gets taxcode, pb00, jin2, menge and your logic should validate taxcode and according to that corresponding formulas should be executed and the result is returned using a export parameter.

You can use that FM in all your programs as well as if there is any change in the formula, only change is need in Function module calculation logic.

Regards

Karthik D

0 Kudos

Hi Karthik,

Thanks for ur reply....Actualy that is one option....I found some FM module to create and execute formulas....but i am not able create fromula using this......can u pl tel me whether thse FM will be useful for my requirement.did u seen tc25 table?There thay are maintaining some formulas right?Thats y i prefered formula option.

CHECK_FORMULA

EVAL_FORMULA

FORMULA_CHECK

FORMULA_EVALUATION

FIMA_FORMULA_CREATE.

0 Kudos

Hi,

I have referred that table, but it seems like all the given FM's are used for SAP's internal use, so we cannot confidently enter values into table tc25 and use that in our program. Also we cannot expect any results from it.

So i think creating a FM is the easy, efficient and manageable way to achieve your requirement.

Regards

Karthik D

0 Kudos

Hi,

Thanks for sharing ur Ideas and ur response!!!