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

aritmatic in sapscript

Former Member
0 Likes
661

can i do 1+1 or 2-1 in layouts?

can i do 1+1 or 2-1 in layouts?

4 REPLIES 4
Read only

Former Member
0 Likes
626

Hi liat,

we cant do calculations in layouts...

Read only

Former Member
0 Likes
626

Hi Lil,

You can't do arthamatic calculation in SAP Script. But you can include your calculations in print program and then pass the results to script.

Lanka

Read only

Former Member
0 Likes
626

Hi liat,

you can do using performs.

this perform can be inside another program.

/: PERFORM GET_SUM IN PROGRAM ZSUM

/: USING &SUM&

/: ENDPERFORM

REPORT  zget_master         .        
            .
FORM get_sum TABLES in_tab STRUCTURE itcsy out_tab STRUCTURE itcsy.
  CLEAR v_sum.
...

endform.

Read only

Former Member
0 Likes
626

hi liat,

you can do all your arithmetic operations in your Program itself and pass it on to LAYOUT.

IF the number is generated dynamically in your layoutyou can use the format /E for example..

in program if the variable

TOTAL = 1+1.

CALL FUNCTION 'WRITE_FORM'

IMPORTING

ELEMENT = TOTAL

..........

in the script you can do

/E TOTAL

  • &TOTAL&

hope this is helpful

ps:reward points if helpful