SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Очистка памяти



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Сергей
Участник
Участник



Joined: 25 Oct 2007
Posts: 49

PostPosted: Fri Dec 07, 2007 2:29 pm    Post subject: Очистка памяти Reply with quote

Возник не праздный вопрос, как очистить память
1) после использования Функциональных модулей
2) ABAP memory
3) SAP memory

необходимо, чтобы исключить влияние оставшихся в памяти данных при последующем запуске ФМ или программ?

Кто обладает какой полезной информацией, давайте соберем ее в одном месте.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Fri Dec 07, 2007 5:01 pm    Post subject: Reply with quote

Начну:
1) по использованию ФМ - однозначно ответить нельзя, зависит как и откуда вызываются. В общем виде - если надо проинициализировать глобальные переменные в группе функций (при условии что написанного деструктора не существует) - то использовать ASSIGN и чистить, чистить и чистить.
2) по ABAP memory (памяти на клиенте) - не забывать очищать SPA/GPA параметры после их использования
3) по SAP memory (глобальной системной памяти) - кроме FREE MEMORY ID ничего не знаю.

Резюме: ничего нового относительно ABAP-справки не написал, будем ждать новых ответов.
Back to top
View user's profile Send private message Blog
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Sat Dec 08, 2007 12:13 am    Post subject: Reply with quote

Начну со справки:

Passing Data Between Programs

SAP Memory

SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).

ABAP Memory

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.



2) Вся ABAP memory полностью чистится FREE MEMORY без ID.

Code:
DATA: lifnr TYPE lifnr.
lifnr = '777'.
EXPORT lifnr TO MEMORY ID 'Z_LIFNR'.
WRITE: / 'lifnr=', lifnr.

CLEAR lifnr.
WRITE: / 'lifnr=', lifnr.

IMPORT lifnr FROM MEMORY ID 'Z_LIFNR'.
WRITE: / 'lifnr=', lifnr.

FREE MEMORY.

CLEAR lifnr.
IMPORT lifnr FROM MEMORY ID 'Z_LIFNR'.
WRITE: / 'lifnr=', lifnr.


3. SET PARAMETER ID 'MAT' FIELD space.

1) пока подожет Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.