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

How to add two values in script .?

Former Member
0 Likes
1,007

Hi ,

i have a requirement where in a value must be incremented in SAP script . How to perform that . ?

Hi ,

i have a requirement where in a value must be incremented in SAP script . How to perform that . ?

3 REPLIES 3
Read only

Former Member
0 Likes
697

Hi,

you can try the below options.

1. You can call the specific statement in a window with specific text element in the driver program whenever required. Before calling this window with the mentioned text element, increment the varinable and pass the structure to WRITE_FORM.

2. It is also possible to call a SUBROUTINE POOL in script, by passing the USING and CHANGING parameters.

Read only

Former Member
0 Likes
697

Hi,

If you want a counter kind of thing then you can directly use counters provide by SAPscript.

To learn about counter follow this link : [http://help.sap.com/saphelp_nw70/helpdata/en/d1/802d7d454211d189710000e8322d00/frameset.htm]

And if you want to increase value of any variable used in the print program or declared in SAPscript then you

can write a form routine in a program and call this routine from the SAPscript. To learn how to call form routine

from sapscript follow this link : [http://help.sap.com/saphelp_nw70/helpdata/en/d1/802d7d454211d189710000e8322d00/frameset.htm]

Regards,

Bhavesh.

Read only

Former Member
0 Likes
697

Hi Geetanjali,

You can declare a variable in your print program.Incrementing the value can be done in the print program itself before or after you call "WRITE_FORM".

Then you can use the value this variable inside your script by &var&.

Hope this helps

Regards

Avinash