2013 May 22 8:45 AM
Hello!
I noticed that my internal tables are cleared when I return to the selection screen from my report with help of the "back" button!
Has this behaviour changed (we use 7.31)?
Is there a possability to keep data within an internal table when I return to selection screen? Due to performance issues this internal tables should only be built up once!
Regards,
Gerhard
Hello!
I noticed that my internal tables are cleared when I return to the selection screen from my report with help of the "back" button!
Has this behaviour changed (we use 7.31)?
Is there a possability to keep data within an internal table when I return to selection screen? Due to performance issues this internal tables should only be built up once!
Regards,
Gerhard
2013 May 22 8:59 AM
2013 May 22 9:10 AM
Put data retrieval logic inside function module which has internal table in top include.
Global internal table will retain values on subsequent calls.
Do fresh selections only when:
2013 May 22 9:11 AM
It depends on how the BACK action is coded, if it performs a LEAVE TO SCREEN 0 (and no cleaning in first PBO), data is kept, if it use a LEAVE TO TRANSACTION sy-tcode or more recent LEAVE TO CURRENT TRANSACTION (release 6.40), data is cleared. And there are more and more program that use those statements.
Regards,
Raymond
2013 May 22 9:30 AM
Hello Raymond!
My experience is different, the coding of my BACK button is LEAVE TO SCREEN 0! When I return to selection screen and start execution immedialty again, the data are not kept (internal table is initial)!
Regards,
Gerhard
2013 May 22 10:02 AM
Hi Gerhard,
Even I when through this problem when I was in training period. Then I got to know the reason after 2 days.
The reason is whenever you go back to selection screen from the output screen, the program will be reloaded i.e the program execution starts from beginning, it re-initializes all the declarations. So there is no way you can retain the values. All the values will be lost once you go to selection screen.
If you want to retain the values then, before leaving the output screen, use the ABAP memory, export the values and use these values.
Before LEAVE TO SCREEN 0. Add this one line code.
EXPORT itab TO MEMORY ID 'ABC'.
Import wherever you want using this statement.
IMPORT itab FROM MEMORY ID 'ABC'.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |