04-19-2007 5:46 PM
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.
04-19-2007 5:52 PM
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.
04-19-2007 7:01 PM
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
04-19-2007 7:12 PM
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