Application Development and Automation 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: 
Read only

how to empty current user sap memory

Sandra_Rossi
Active Contributor
0 Likes
6,790

I had just an issue regarding 2 subsequent CALL TRANSACTION with same data and same transaction code (*). In the second call there was an error because one of the screens was not displayed anymore. It was because a sap memory was initially empty and was set (SET PARAMETER) during the first call, then the second call did not display a screen because the sap memory was set.

In the future, if I encounter again this kind of issue, I'd like to reset whole sap memory between the 2 calls, to check quickly if the issue comes from sap memory or not.

Is there a way to know programmatically which sap memories are defined in the current transaction, so that to clear them ? The classic debugger displays them, but how can we do it by ourselves.

Thank you

(*) For info, it was sap memory DDY and transaction XD07 (with XD02 between 2 transactions). I also found that maybe the problem might occur with sap memory KDY and transaction KD07 (+ KD02).

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
4,821

Hi Sandra,

Frankly this was the question I ansked myself couple days ago. And didn't find appropriate way to do it.

I think two "replacement" solutions are possible:

a) You may clear field by field and set parameters once again - this you probably already thought of and it requires knowing all parameters in that memory, so it is ugly approach

b) you can use CALL TRANSACTION tcode STARTING NEW TASK - this opens up new user session (not external one), accross which SAP memory doens't apply. So here you will be sure that no data will occupy it once you enter tcode.

Of course there has to be some nicer solution which I would like to get to know too.

Regards

Marcin

I had just an issue regarding 2 subsequent CALL TRANSACTION with same data and same transaction code (*). In the second call there was an error because one of the screens was not displayed anymore. It was because a sap memory was initially empty and was set (SET PARAMETER) during the first call, then the second call did not display a screen because the sap memory was set.

In the future, if I encounter again this kind of issue, I'd like to reset whole sap memory between the 2 calls, to check quickly if the issue comes from sap memory or not.

Is there a way to know programmatically which sap memories are defined in the current transaction, so that to clear them ? The classic debugger displays them, but how can we do it by ourselves.

Thank you

(*) For info, it was sap memory DDY and transaction XD07 (with XD02 between 2 transactions). I also found that maybe the problem might occur with sap memory KDY and transaction KD07 (+ KD02).

12 REPLIES 12
Read only

Former Member
0 Likes
4,821

hi,

Use FREE MEMORY ID to free the SAP memory.

The FREE MEMORY statement without the ID addition deletes the entire ABAP memory of the current external session.

Regards

Milan

Read only

0 Likes
4,821

Thx but FREE MEMORY ID is about "ABAP memory". I know how to "empty" a given SAP memory, for instance SET PARAMETER ID 'DDY' FIELD space. What I want is to empty all existing SAP memories, but I want a generic way to do it any time.

Read only

Former Member
0 Likes
4,821

Hi,

To clear the memory ID,

Suppose if your memory id is VC_APPL,

DELETE FROM MEMORY ID 'VC_APPL'.

FREE MEMORY ID 'VC_APPL'.

You global search on "MEMORY ID" in the transactions main program to get the memory ID's used in it. I'am not sure wether it solves your requirement.

Thanks & Regards,

Adithya M.

Read only

0 Likes
4,821

look at documentation, "abap memory" (export ... to memory id ..., etc.) is not "sap memory" (set parameter id ...). My question is about sap memory. Thx

Read only

0 Likes
4,821

If your program is not a class you can use free memory statement without ID addition. But this will clear all memory which is not recommended. Search free memory keyword in standard abap documentation.

What do want to clear any sample ?

Edited by: Gungor Ozcelebi on Jul 21, 2009 1:15 PM

Read only

Former Member
0 Likes
4,821

Hi Frn ,

if you want to free the SAP memory ... use below code (iindirect approch )

SET parameter ID 'MAT' field SPACE.

thanks and regards ..

Priyank

Read only

MarcinPciak
Active Contributor
0 Likes
4,822

Hi Sandra,

Frankly this was the question I ansked myself couple days ago. And didn't find appropriate way to do it.

I think two "replacement" solutions are possible:

a) You may clear field by field and set parameters once again - this you probably already thought of and it requires knowing all parameters in that memory, so it is ugly approach

b) you can use CALL TRANSACTION tcode STARTING NEW TASK - this opens up new user session (not external one), accross which SAP memory doens't apply. So here you will be sure that no data will occupy it once you enter tcode.

Of course there has to be some nicer solution which I would like to get to know too.

Regards

Marcin

Read only

0 Likes
4,821

Hi Marcin / Sandra,

Had the same issue

Used the first approach

The second one, if i set any paramter in my program and call another transaction then the data which i set won't be transferred. Am i right Marcin ?

Regards

Read only

0 Likes
4,821

Hi Rajvansh,

Yes that's correct. SAP memory is valid only b/w external GUI sessions (but within one user session). Here we have separate user sessions, so SAP memory will be initialized for each new call.

Regards

Marcin

Read only

0 Likes
4,821

Thank you Marcin, at last someone who understands the question (thank you ).

CALL TRANSACTION ... STARTING NEW TASK doesn't exist. I guess it's a "typo" error. You mean a CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'X' for example.

Do you know an existing function module which has all parameters same as CALL TRANSACTION ? (especially for OPTIONS FROM keyword, I use it very often), so that to easily replace CALL TRANSACTION by a function module if I need to.

Another solution I was investigating is to use the new debugger, as it is able to get the list of sap memories, but the new debugger can't be enhanced as far as I know

Read only

0 Likes
4,821

Yes, of course I mixed it with calling FM, but you got the point.

As for similar FM I am looking at CALL_TRANSACTION_FROM_TABLE_CO which might fulfill your requirement. Inside it parameter options from is filled based on FM parameters i_mode and i_update (all in all options from is just other way of supplying all these parameters in CALL TRANSACTION). Other way would be writitng a custom (RFC-enabled) FM, but of course it's better to find some standard solution to apply it on different systems if necessary.

Try that FM. I think the one you mentioned about ABAP4_CALL_TRANSACTION should also be bring similar functionality.

Regards

Marcin

Read only

0 Likes
4,821

When I meant OPTIONS FROM, it was about other fields like NOBINPT or RACOMMIT which are sometimes useful.

About the FM, I'll see later, when I need it, it won't be an issue. Thx a lot.