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: 

Global Memory

Former Member
0 Kudos

Hi ,

My requirement is that I need to have a filed COUNT which will have initial

value as 1 and it will be incremented for each record.

Suppose the end value for the first program run is 102.

Now I close the Session and open new session then the field count should start

counting from 103.

Using SET/GET parameter and EXPORT/IMPORT memory id doesnot work as the

memory value gets lost when we close the session.

3 REPLIES 3

Former Member
0 Kudos

what u can do is use some ztable which has a counter field or else create a z-table with counter as field. at end of the session update this table with the counter.

write a select statement to fetch the values and check the maximum value by sorting and use it when ever required.

Former Member
0 Kudos

Hi

As we know SAP works on appln server, so there is no concept of permant storage.

SAP processes data per session & finally updates the DB.

So you can store in custom ztable, & get it once you login back

Thanks

Sandeep

Reward if helpful

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Is this a continuously running number, indefinintly? If so, you should use a number range. Create the range in transaction SNRO, create the interval for your range(00001 to 99999), Then in your program simply use the funciton module NUMBER_GET_NEXT to get the next avaible number. The running number will always be updated in the database table NRIV.

No need to create a custom table to keep track of your number.

REgards,

Rich Heilman