‎2008 Jun 23 9:11 AM
Hi all,
I'd like to define a static attribute for a class; while it seems that: for ABAP, static attribute of a class only valid for a http connection and after this connection it will be reset. I'm sad about this.
Do anybody know how I can define a Java/C++-like static attribute? I would to keep the content of this attribute for long time.
b.t.w. it seems SET PARAMETER ID and GET PARAMETER ID only works for flat field? What I want to keep is an internal table.
Many thanks and best regards,
Said
Edited by: Sayid Tong on Jun 23, 2008 10:21 AM
‎2008 Jun 23 10:01 AM
Hi Matthew,
While the persistence way is what I intend to avoid in this case. It's possible to use a database table (it's actually more than one for sake of deep structure) to store these data.
Regards,
Ping
‎2008 Jun 23 9:53 AM
You need to look at the persistency framework. Thomas Jung did a blog about it, and there's plenty of documentation. Search on "persistence abap objects" to find it all.
matt
‎2008 Jun 23 10:01 AM
Hi Matthew,
While the persistence way is what I intend to avoid in this case. It's possible to use a database table (it's actually more than one for sake of deep structure) to store these data.
Regards,
Ping
‎2008 Jun 23 10:12 AM
Have you considered using EXPORT and IMPORT to a cluster table?
regards
matt
‎2008 Jun 24 12:35 AM
Hi Ping,
you can use the server-side cookie facilities that are generally used with the BSP programming model. There is no reason you can't use this facility in any ABAP program.
This allows you to persist ABAP data structures and then "pop" them back out on demand.
Look at the cl_bsp_server_side_cookie class.
Cheers
Graham Robbo
‎2008 Jun 24 8:43 AM
Hi Matthew,
yes, i'm trying export and import. While an question: what's the area for a database table?
In ABAP keyword documentation, there is an example:
... DATABASE dbtab(ar) [FROM wa] [CLIENT cl] ID id
EXPORT tab = itab
TO DATABASE indx(XY)
FROM wa_indx
CLIENT cl
ID 'TABLE'.
While I didn't find explanation for database area and where to check it, in keyword docs and SAP help. Could you help explain it?
Thanks and regards,
Said
‎2008 Jun 24 8:59 AM
Area is whatever the programmer defines it to be. If you've defined the cluster table yourself, you can choose the area. It's just part of the key.
matt
‎2008 Jun 24 10:50 AM
Hi Matthew, hi Graham,
thanks for your help. the data cluster helps. i'll try cl_bsp_server_side_cookie class later also.
regards,
Said