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

Clear Parameters

Former Member
0 Likes
1,531

Hi,

I want to clear the parameters after I process something and then go back. After all

the process I have tried something like this.

CLEAR P_VAR.
P_VAR = ''.

But doesn't work, it still have the previous value. Someone knows how can I solve this?

Regards,

Isaac Melendez

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,430

I recently did the same and it works

Did you placed the code in at selection-screen?

12 REPLIES 12
Read only

Former Member
0 Likes
1,431

I recently did the same and it works

Did you placed the code in at selection-screen?

Read only

Former Member
0 Likes
1,430

Is P_VAR a parameter on the selection screen? can you show us how you declared it?

Read only

Former Member
0 Likes
1,430

Hi Isaac,

using debugging you can find exactly where the data is append into your parameter.

Check the declaration of the field. It may contain any default values.

The best solution for youe query is Debugging.

Thanks.

Read only

0 Likes
1,430

yes, debugging should show you why it's not clearing.

even with a default value in the parameter declaration, you should be able to easily clear it.

PARAMETERS: p_var like rlgrap-filename DEFAULT 'c:\test'.

START-OF-SELECTION.

WRITE: /5 p_var.

CLEAR p_var.{/code}

Read only

0 Likes
1,430

Hi,

I solve my problem, thanks to you guys. The problem was that I put the code

in the START-OF-SELECTION, not in AT SELECTION-SCREEN.

Regards,

Isaac Melendez

Read only

Former Member
0 Likes
1,430

Hi again,

I have a problem when clearing the parameters. I clear them in AT SELECTION-SCREEN, but they are clear when I press Execute button.

How can I clear them just when I go back, not in the Execute button.

Regards,

Isaac Melendez

Read only

Former Member
0 Likes
1,430

Hi,

can you give me the part of code, Under At selection-screen, where you are using CLEAR statement.

In my program...its working properly.

Give me the code...will go thru that.

Regards

Sandeep reddy

Read only

0 Likes
1,430

Hi Sandeep,

Here is the code:

DATA: LV_MES(2) TYPE C.

PARAMETERS: P_MES(2) TYPE c OBLIGATORY.

AT SELECTION-SCREEN.
  CLEAR: P_MES.

START-OF-SELECTION.

* Here is empty P_MES when I execute
  LV_MES = P_MES.

END-OF-SELECTION.

Regards,

Isaac Melendez

Read only

0 Likes
1,430

Issac is working ok.

Why do you want it to clear when you go back?

It is possible, but you will exit the report, so I don't get why you would want that

Read only

0 Likes
1,430

Hi Ramiro,

It isn't working like I want. The process is.

- I fill the parameters values.

- I execute the program.

- Then it show me a report.

- Then I go back to the parameters screen (and I want to clear the parameters here).

The problem is that if I Clear the parameters in AT SELECTION-SCREEN, then the

parameters are cleared when I press execute button.

- I fill the parameters values.

- I execute the program. (before, the parameters are cleared, and I can't process them)

- Then it show me a report.

- Then I go back to the parameters screen (and I want to clear the parameters here).

Regards,

Isaac Melendez

Read only

Former Member
0 Likes
1,430

Hi,

DATA: LV_MES(2) TYPE C.

PARAMETERS: P_MES(2) TYPE c OBLIGATORY.

AT SELECTION-SCREEN.

CLEAR: P_MES.

START-OF-SELECTION.

  • Here is empty P_MES when I execute

LV_MES = P_MES.

END-OF-SELECTION.

You are writing CLEAR , immediately aftr AT SELECTION-SCREEN..

SO, when you press execute...this event will get trigerd. And the Parameter will get cleared.

But, at wat stage you want to clear the parameetr , tell me.

I modified your code like this....jus chk.

In case ur requirement is not fullfilled...please revert back.

If it solves ur problem, dont forget to reward points.

DATA: LV_MES(2) TYPE C.

PARAMETERS: P_MES(2) TYPE c OBLIGATORY.

AT SELECTION-SCREEN.

LV_MES = P_MES.

CLEAR: P_MES.

write : lv_mes.

Regards

Sandeep reddy

Read only

0 Likes
1,430

Hi Sandeep,

That works, thanks.

Regards,

Isaac Melendez