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 clear the screen cache?

Arun_Prabhu_K
Active Contributor
0 Likes
11,323

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
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
6,395

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

14 REPLIES 14
Read only

matteo_montalto
Contributor
0 Likes
6,395

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.

Read only

0 Likes
6,395

What is CLEAN? You mean CLEAR!

Read only

0 Likes
6,395

Sorry, my fault, I mistyped.

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
6,395

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.

Read only

0 Likes
6,395

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.

Read only

0 Likes
6,395

No I don't want by that means.

I want the solution via ABAP.

Read only

0 Likes
6,395

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

Read only

0 Likes
6,395

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

Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
6,395

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.

Read only

0 Likes
6,395

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

Read only

0 Likes
6,395

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

Read only

koolspy_ultimate
Active Contributor
0 Likes
6,395

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

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
6,396

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

Read only

0 Likes
6,395

Hi,

Maybe it's later...

With this method it's possible:

CALL METHOD cl_gui_frontend_services=>disablehistoryforfield

Regards!