‎2009 Feb 12 5:07 PM
Hi,
I have built a report with a selection screen, and it has 2 radio buttons. First button is just to display the records, but the second button, when selected will deleted the records displayed in the fields on the selection screen, but I cannot seem to figure out the logic or the code I need to make that functionality working. Can anybody help me out here?
‎2009 Feb 12 5:09 PM
On click of that radio button you can simply CLEAR/REFRESH all fields.
‎2009 Feb 12 5:11 PM
hi,
Check this code, if it is as per your requirement.
select-options:
s_field for spfli-carrid.
AT SELECTION-SCREEN OUTPUT.
IF P_RAD2 EQ 'X'.
IF SCREEN-NAME CS 'S_FIELD'.
REFRESH S_FIELD. " If s_field is a select-options on the selection screen
CLEAR S_FIELD. " Refresh and clear delete the entries exiting in the s_field from table and header
ENDIF.
ENDIF.Thanks
Sharath
‎2009 Feb 12 5:37 PM
‎2009 Feb 12 5:42 PM
Hi,
Are you using USER-COMMAND addition with you radio button like in the following Sample code if not than please try after adding this.
parameter: rb1 radiobutton group radi default 'X' user-command ucomm,Hope will solve out,
Kind Regards,
Faisal
‎2009 Feb 12 5:43 PM
hi,
Can you post your code here so that i can have a look at it.
In the parameter declaration,
Parameters:
p_rad1 radiobutton group g1 user command 'ONLI',
p_rad2 radiobutton group g1.have been maintained..??
Thanks
Sharath
‎2009 Feb 12 5:57 PM
None of that sample code made anything work....
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-b02.
PARAMETERS: p_delete RADIOBUTTON GROUP g1 user-command ucomm, "Delete Records
p_show RADIOBUTTON GROUP g1. "Show Records
SELECTION-SCREEN END OF BLOCK blk2.
‎2009 Feb 12 6:16 PM
Hi,
Test my Sample code in the following Thread hope will help to get the point of solution.
Hope My Sample Code in the following Thread will be more Useful for you Please test this too.
The Above Link are not exactly according to your requirement but after testing above code you will be able to under stand the functionality and Hopefully solve out your problem,
Sorry, one thing more you must have to take care if you are using Parameters than use
clear: p_name.and if you are using Select-option than to clear the body of the select-option which is in fact a internal table use like following.
Clear: s_name[], " To clear the Body of the internal table which select option is using.
s_name. To clear the Header of internal table which select option is using.Kind Regards,
Faisal
Edited by: Faisal Altaf on Feb 12, 2009 11:28 PM
‎2009 Feb 12 6:03 PM
hi,
Tables spfli.
Parameters:
p_delete radiobutton group rad1 user-command 'ONLI',
p_record radiobutton group rad1.
select-options:
s_field for spfli-carrid.
AT SELECTION-SCREEN OUTPUT.
IF P_DELETE EQ 'X'.
REFRESH S_FIELD.
CLEAR S_FIELD.
ENDIF.This is working for the field S_FIELD.
Run this code .
Thanks and regards
Sharath
‎2009 Feb 13 5:55 AM
Hi Daniel,
Use this code:-
DATA : p_vbeln type vbap-vbeln,
p_posnr type vbap-posnr.
DATA : p_rb1 radiobutton group gp1 default 'X',
p_rb2 radiobutton group gp1.
AT SELECTION-SCREEN OUTPUT.
if p_rb2 = 'X'.
"clear screen fields
"like:-
clear : p_vbeln,
p_posnr.
endif.
START-OF-SELECTION.
"your code/concept
END-OF-SELECTION.
"your code/concept
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Feb 13 6:18 AM
parameter: p_rbut1 radiobutton group radi default 'X' user-command ucomm,
p_rbut2 radiobutton group radi.
AT SELECTION-SCREEN OUTPUT.
IF P_RBUT2 EQ 'X'.
IF SCREEN-NAME CS 'S_FNAME'.
REFRESH s_fname
CLEAR s_fname.
ENDIF.
Regards,
Joan
‎2009 Feb 13 6:38 AM
Hi,
the below code will clear the selection when the second radio button is chosen,
check it out:
TABLES: mara.
SELECT-OPTIONS:
so_matnr FOR mara-matnr.
PARAMETERS:
p_rad1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND clear,
p_rad2 RADIOBUTTON GROUP g1.
AT SELECTION-SCREEN.
IF p_rad2 EQ 'X'.
REFRESH so_matnr[]. "Clear all values
ENDIF.Regards,
Manoj Kumar P