Application Development 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: 

How to clear the screen cache?

karun_prabhu
Active Contributor
0 Kudos
5,421

Hi guys.

I want to know if there is a way to clear the screen fields cache via ABAP.

Like I want to remove all previously typed values in a text box field in a module pool screen in subsequent executions.

Thanks in advance.

1 ACCEPTED SOLUTION

karun_prabhu
Active Contributor
0 Kudos
493

By ticking the attribute No Input History for the field in the Screen Painter, no history will be maintained.

14 REPLIES 14

matteo_montalto
Contributor
0 Kudos
493

Hi,

don't know if I understood it well, anyway; you could try a CLEAN of the text box in the AT SELECTION-SCREEN OUTPUT section of your screen. You should then find a way to identify exactly the condition that should lead to the cleansing (sy-ucomm check?).

In example;

AT SELECTION-SCREEN OUTPUT.

IF <your_condition_is_met> EQ 'X'.

CLEAN <input_box_parameter>.

ENDIF.

0 Kudos
493

What is CLEAN? You mean CLEAR!

0 Kudos
493

Sorry, my fault, I mistyped.

karun_prabhu
Active Contributor
0 Kudos
493

I meant clearing the screen cache.

Eg : I have a text box for Production Order number .

1st time, I input 4000028.

Next time, I execute , the text box will be empty but when I press the space bar, I will have 400028. This is what I want to remove from my screen.

0 Kudos
493

what you need to do is press space bar then go to that particular number which you want to be delete using the up and down keys from keyboard.

then after reaching that particular Order number click on delete button in the keyboard.

hope this solves your problem.

0 Kudos
493

No I don't want by that means.

I want the solution via ABAP.

0 Kudos
493

Hi,

My thoughts...The cached values that you are talking about are stored as local data within the GUI (or whwre the local data is stored - C:\Documents and Settings
\...
SapWorkDir) and i don't think there is a way for you to clear this using ABAP(i might contradict myself).

To see what i mean, just go to "Customize Local Layout"(ALT+F12) on SAP Gui system tool bar, and click on Options->Local Data.

You could try with CL_GUI_FRONTEND_SERVICES=>FILE_DELETE, once you have identified the cache files, not sure though all the best.

Regards,

Chen

0 Kudos
493

Hi,

you can use "SAP GUI scripting". It allows to delete ALL input history (for all fields), and add entries programmatically; It is not possible to access input history outside SAP GUI, as explained in the "SAP GUI scripting" documentation -> http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%20scripting%20api.pdf

BR

Sandra

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos
493

If you delete ALL input history (for all fields) then certain users will probably be pissed off after running the program since they lose their cached values they may rely on in various transactions.

I know I wouldn't be too happy

Perhaps it is possible to delete this history for just one field... that'd be much better.

0 Kudos
493

Hi Tamas,

If you delete ALL input history (for all fields) then certain users will probably be pissed off after running the program since they lose their cached values they may rely on in various transactions.

>

> I know I wouldn't be too happy

>

> Perhaps it is possible to delete this history for just one field... that'd be much better.

I didn't say it was perfect (I agree, I was a little bit disappointed too, to not see any single deletion method). Note that in the documentation, it is said that only SAP GUI software itself can act on the input history. So my opinion is that only SAP GUI scripting methods can play with the input history. Sometimes there are limitations, and we must cope with it :-).

Sandra

0 Kudos
493

Hi,

Hurrah, to disable or enable input history of only ONE field, we can do it programmatically using method cl_gui_frontend_services=>disablehistoryforfield (with flag true or false). It is available since at least release 7.0

Moreover, user can switch it on or off manually, by CTRL + right click (since at least SAP GUI 7.20).

BR

Sandra

koolspy_ultimate
Active Contributor
0 Kudos
493

try this

in application tool bar

click customize local layout (alt + f12)

click options

go to local data tab.

select of or on as per your requirement

karun_prabhu
Active Contributor
0 Kudos
494

By ticking the attribute No Input History for the field in the Screen Painter, no history will be maintained.

0 Kudos
493

Hi,

Maybe it's later...

With this method it's possible:

CALL METHOD cl_gui_frontend_services=>disablehistoryforfield

Regards!