2014 Jul 16 1:28 PM
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 ?
2014 Jul 16 2:29 PM
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.
2014 Jul 16 1:42 PM
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!
2014 Jul 16 1:54 PM
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.
2014 Jul 16 2:13 PM
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
2014 Jul 16 2:32 PM
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.
2014 Jul 16 2:15 PM
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
2014 Jul 16 2:44 PM
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.
2014 Jul 16 2:29 PM
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.
2014 Jul 16 2:44 PM
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.
2014 Jul 16 3:02 PM
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!
2014 Jul 16 3:12 PM
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'.
2014 Jul 17 3:54 AM
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
2014 Jul 17 5:03 AM
2014 Jul 17 5:11 AM
Hi,
Try... LEAVE TO TRANSACTION 'ZMYTCODE' after the function module(used for calling smartform).
2014 Jul 17 5:19 AM
hi sreekanth,
what will happen if use leave to transac stmt..?
wether it will clear the screen variables??
2014 Jul 17 5:27 AM
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'.
2014 Jul 17 5:22 AM
Hi Rabgappa,
Check the program flow in debug mode.
Regards,
Rajesh.B