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: 

Regarding Counter in the SAP Script.

aaruljothi
Participant
0 Kudos

Hi Experts,

In my SAP Script form inside a window and teh element I need to have a counter variable that counts how many times that element is being called.

The calling program cannot be changed since it is a Standard SAP program.

I need to have it in the SAP script.

How can I do that.

Regards,

Arul jothi A

5 REPLIES 5

abdul_hakim
Active Contributor
0 Kudos

hi

&SAPSCRIPT-COUNTER_x& (x = 0.. 9):

These fields represent ten counter variables that you can use in your text and forms for any counting purposes. You can use the ‘+’ and ‘-’ formatting options to increment or decrement a counter before its value is printed. You can use the DEFINE control command to assign any specific value to a counter.

check the link

http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb3d07455611d189710000e8322d00/frameset.htm

cheers,

Abdul

0 Kudos

Hi Abdul,

It's giving an error message Text element 'SAPSCRIPT-COUNT not found.

0 Kudos

hi use &SAPSCRIPT-COUNTER_x&.go thru the document in the above link as well..

It will work fine..

Cheers,

Abdul

0 Kudos

Can you give some example.

Arul Jothi.

Former Member
0 Kudos

Hello Arul,

DEFINE &SAPSCRIPT-COUNTER_1& = 0.

when u want to increment the counter then use + to increment.