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

screen variables clearing based on condition

Former Member
0 Likes
3,367

Hi all,

       i had a selection screen in my program, along with radio buttons and a check box. Now i need to clear all the scree variables based on the selection criteria(radio buttons and check box).

      For that i had cleared the screen variable in At selection screen output event. but my problem is, After inputting the input fields if i am choosing any radio button or check box the inputted values from the input fields are clearing.

    My aim is to clear the inputted values only after executing the program and inputted values should not clear while choosing a radio button or check box.

how to achieve this ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,357

So if I got you right, you need to clear the selection screen fields based on the radio button or check box you select. And this should be done after executing the program?

When you execute a program the system takes you to a new screen. So I don't think you need to worry about clearing the field values.

Please explain clearly, or if you can show the selections screen and tell why you wish to clear after executing that might help giving a better answer.

Thanks.

16 REPLIES 16
Read only

Former Member
0 Likes
2,357

Hi Lokesh,

If you put the logic of clearing the input fileds in At selection screen output, the fields will get clear before the execution.

I suggest you to put the clearing logic at the end of "start-of-selection" (after you have used the field values in your program logic).

And I did not understand why do you want to clear the screen fields after executing? Can you explain?

Thanks!

Read only

0 Likes
2,357

hi arash,

            i tried by clearing at both start-of-selection and end of selection as well. but values are not clearing.

          that is a part of user requirement.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,357

Set a flag "selection-screen to clear" at the beginning of START-OF-SELECTION. In AT SELECTION-SCREEN OUTPUT, clear the selection-screen only if this flag is set, and unset it.

NB: If you clear data in another event, they could be copied from the preceding user inputs if associated to memory id.

Regards,

Raymond

Read only

0 Likes
2,357

hi raymond,

         as you sujjested, the flag which is set at start of selection is getting cleared once the program was executed, so there no point of the clearing values  at At selection screen output based on the flag..

  

Regards,

Lokesh.

Read only

Former Member
0 Likes
2,357

I do not understand the requirement as well. Can you please explain it more detailed?

So you got radiobuttons and checkboxes in your selection screen, and then you got some input fields as selection criteria? And you want to clear the input fields after executing? Straight after executing? This would imho be useless because when you clear it in start-of-selection you canot work with the entered values so there would be no need for it.

Or do you want to clear them at the end of your whole process in the report, e.g. after your list (or something else) is displayed? If so, why doing it? In normal cases you got your selection screen where you can filter some values e.g. for a SELECT statement in your start-of-selection block. This block is only gone through one time straight after clicking the executing button of your selection screen. When you go back to your selection screen then and want to do a new selection you can just overwrite the value. Or do you just want to have the fields cleared after doing this, means after going back from your list back to selection screen?

Regards

Michael

Read only

0 Likes
2,357

Hi michael,

             i had two radio buttons and a check box , all are having  common input fields, So after entering the input values, user may change another radio button or check box also. Now at the time of choosing the radio buttons or check box the values in the screen input fields should not get clear.

           once the selection was fine and after executing the program only the inputted values needs to be cleared.

          For this i am clearing my screen fields in At-Selection-screen-output event, Here the problem is it is clearing the values each time of choosing the radio button or check box it self, so this should not happen...

  any suggestions on this.

Read only

Former Member
0 Likes
2,358

So if I got you right, you need to clear the selection screen fields based on the radio button or check box you select. And this should be done after executing the program?

When you execute a program the system takes you to a new screen. So I don't think you need to worry about clearing the field values.

Please explain clearly, or if you can show the selections screen and tell why you wish to clear after executing that might help giving a better answer.

Thanks.

Read only

0 Likes
2,357

Hi arash,

             i had two radio buttons and a check box , all are having  common input fields, So after entering the input values, user may change another radio button or check box also. Now at the time of choosing the radio buttons or check box the values in the screen input fields should not get clear.

           once the selection was fine and after executing the program only the inputted values needs to be cleared.

          For this i am clearing my screen fields in At-Selection-screen-output event, Here the problem is it is clearing the values each time of choosing the radio button or check box it self, so this should not happen...

  any suggestions on this.

Read only

0 Likes
2,357

If you clear the the fields at " At selection screen output" , every time any of the fields on selection screen is changed - the fields will get clear. So this is not the right option.

One more question, what is the output of this program? a report? I mean what is supposed to happen when you hit execute?

Thanks!

Read only

0 Likes
2,357

Hi Lokesh,

USER-COMMAND (function code) attached with radio buttons? is it required for you?

If your output is an ALV, set you own GUI status.

Then handle the back button i user command.

FORM user_command USING r_ucomm     LIKE sy-ucomm

                                             rs_selfield TYPE slis_selfield.

if r_ucomm = 'BACK'.

       LEAVE TO TRANSACTION 'ZXX'.

Read only

0 Likes
2,357

Hi lokesh,

As per your requirement follow the below code:  (rad1 and rad2 are radio buttons) and (Chk is checkbox)

Start-of-selection.

if   rad1 = 'X'.

Clear the selection screen variables(As per requirement)

else rad2 = 'X'.

Clear the selection screen variables (As per requirement)

endif.

If chk = 'X'.

Clear the selection screen variables (As per requirement)

Endif.

Kind regards,

Vivek

Read only

0 Likes
2,357

Hi arash,

            It is a smratform

Read only

0 Likes
2,357

Hi,

Try... LEAVE TO TRANSACTION 'ZMYTCODE' after the function module(used for calling smartform).

Read only

0 Likes
2,357

hi sreekanth,

                 what will happen if use leave to transac stmt..?

             wether it will clear the screen variables??

Read only

0 Likes
2,357

Definitely... i have tried this..

                  CALL FUNCTION  FM_NAME "  '/1BCDWB/SF00000611'

*                EXPORTING

*                ARCHIVE_INDEX              =

*                ARCHIVE_INDEX_TAB          =

*                 ARCHIVE_PARAMETERS         =

*                 CONTROL_PARAMETERS         =

*                  MAIL_APPL_OBJ              =

*                    MAIL_RECIPIENT             =

*                     MAIL_SENDER                =

*                   OUTPUT_OPTIONS             =

*                     USER_SETTINGS              = 'X'

*                    IMPORTING

*                   DOCUMENT_OUTPUT_INFO       =

*                   JOB_OUTPUT_INFO            =

*                      JOB_OUTPUT_OPTIONS         =

                       TABLES

              git_form     = git_form

               EXCEPTIONS

              FORMATTING_ERROR           = 1

               INTERNAL_ERROR             = 2

              SEND_ERROR                 = 3

            USER_CANCELED              = 4

             OTHERS                     = 5

            .

          IF sy-subrc <> 0.

* Implement suitable error handling here

           ENDIF.

LEAVE to TRANSACTION 'ZFORM'.

Read only

former_member188282
Active Participant
0 Likes
2,357

Hi Rabgappa,

Check the program flow in debug mode.

Regards,

Rajesh.B