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

Delete Records from selection screen

Former Member
0 Likes
2,810

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?

11 REPLIES 11
Read only

amit_khare
Active Contributor
0 Likes
1,549

On click of that radio button you can simply CLEAR/REFRESH all fields.

Read only

Former Member
0 Likes
1,549

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

Read only

0 Likes
1,549

Nothing is happening, what could be wrong?>

Read only

0 Likes
1,549

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

Read only

Former Member
0 Likes
1,549

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

Read only

0 Likes
1,549

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.

Read only

0 Likes
1,549

Hi,

Test my Sample code in the following Thread hope will help to get the point of solution.

[Selection-Screen|;

Hope My Sample Code in the following Thread will be more Useful for you Please test this too.

[selection-screen|]

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

Read only

Former Member
0 Likes
1,549

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

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,549

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

Read only

Former Member
0 Likes
1,549

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

Read only

Former Member
0 Likes
1,549

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