cancel
Showing results for 
Search instead for 
Did you mean: 

How to deduct values in the script

Former Member
0 Kudos

Hi friends,

I developed cheque printing ...in script..

In my form i am getting Regup-Skfbt it is a value...

and also Regup-dmbtr it is amount..

how i will deduct in my script Regup-skfbt minus regup-dmbtr.

after deducting i want to display in form..

how to declare variables in the script.

its very urgent... pls do the needful...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

do this in ur driver program

define a variable like Regup-Skfbt

v_1 like Regup-Skfbt.

loop at Regup.

v_1 = ( Regup-Skfbt - Regup-dmbtr ).

endloop.

display that variable on script

as &v_1&

hope this will solve ur problem.

reward if helpful.

Former Member
0 Kudos

Hi Venkat,

You cannot declare fields in Scripts directly and also you cannot do arithmetic operations as well. If you want to do it, you can do them in your print program only. If you dont want to disturb your print program, then use PERFORM and ENDPERFORM statement in your script, which will call a subroutine/program and do the necessary. ie., you have to create a ZCALCULATION program in SE38. Call this program from your script by using PERFORM and ENDPERFORM. check out the below link for the syntax.

http://pijush.wordpress.com/2007/05/06/port-of-oia-santorini/

thanks & regards

Kishore Kumar Maram

Former Member
0 Kudos

Hi,

/: DEFINE &ZDIFF_VAL& = ''

PERFORM DIFF IN PROGRAM 'PROGRAM'

USING &Regup-skfbt&

USING &regup-dmbtr&

CHANGING &ZDIFF&

ENDPERFORM

FORM address

TABLES itab STRUCTURE itcsy

otab STRUCTURE itcsy.

LOOP AT itab.

CASE itab-name.

WHEN 'Regup-skfbt'.

l_val1 = itab-value.

WHEN 'regup-dmbtr'.

l_val2 = itab-value.

ENDCASE.

ENDLOOP.

l_val = l_val1- l_val2.

otab-value = l_val.

MODIFY otab TRANSPORTING value WHERE name EQ 'ZDIFF'.

endform.

use this ZDIFF to display the difference in form.

Thnks,

Rajesh.

Former Member
0 Kudos

Hi,

Thank u for u r response. Pls let me know the l_val, l_val1, l_val2 data types. I am getting the problem in this area only.

Regards,