Showing results for 
Search instead for 
Did you mean: 

how to separate amount in script

Former Member
0 Kudos

I copied standard layout into zform.

amount(wrshb) is coming from standard printprogram Rfkord10.

i want to print separately total debit amount sum which is ( + ) sign

and total credit amount sum which is ( - ) sign.

the filed is Rf140-wrshb.

final i want to display difference between debit and credit amount.

debit - credit = netbalance.

how to do this in scripts.

Accepted Solutions (0)

Answers (1)

Answers (1)

Active Contributor
0 Kudos

Call sub-routine inside your SAPscript , do your calculation and display the required value...


Go through this example


/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>

/:USING &<field name>&

/:CHANGING &<field name1&


Then create subroutine pool program and you have to write the code.

FORM ><subroutine name> tables int_cond structure itcsy

outt_cond structure itcsy.

data : value(20), value1(20). "do your own declarations

Read int_cond table index 1.

value = int_cond-value.

value1 = value1 + value.

Read outt_cond table index 1.

outt_cond-value = value1.

Modify outt_cond index 1.


Just rough idea given above.

close the thread once your question is answered.