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

How to clear slection screen input ?

rushi24
Explorer
0 Likes
2,794

How to clear selection screen input while clicking on another radio button .both radio button has the same selection screen.

At selection-screen output.

IF p_rec = 'X' .
CLEAR :s_lcdoc[].
ENDIF.

IF p_app = 'X'.
CLEAR : s_lcdoc.
ENDIF.

How to clear selection screen input while clicking on another radio button .both radio button has the same selection screen.

At selection-screen output.

IF p_rec = 'X' .
CLEAR :s_lcdoc[].
ENDIF.

IF p_app = 'X'.
CLEAR : s_lcdoc.
ENDIF.

5 REPLIES 5
Read only

former_member1716
Active Contributor
2,699

rushi24,

You have to deal carefully with the events of the ABAP report, You would have missed the USER COMMAND Keyword.

You have to code your Logic in event AT SELECTION SCREEN OUTPUT.

Below code (Example) should help you on the same.

PARAMETERS: p_rec RADIOBUTTON GROUP rb1 DEFAULT 'X' USER-COMMAND uc,
            p_app RADIOBUTTON GROUP rb1.

SELECT-OPTIONS: s_lcdoc FOR vbak-vbeln. * Example

AT SELECTION-SCREEN OUTPUT.

  CLEAR: s_lcdoc[].

START-OF-SELECTION.

  WRITE: s_lcdoc-low.

Regards!

Read only

michael_piesche
Active Contributor
0 Likes
2,699

If you want updates on your selection screen not only when the user hits 'Enter' or 'Executes' (F8) the report, but also when a radio-button is changed (or also checkbox is activated or a listbox item is selected), you have to use the USER-COMMAND option when defining the radiobutton parameter:

>> The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. ... When the user selects any radio button from the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN ...

Side note: An update based on changes for most other selection screen objects (mainly select-options and other parameters) is in general only achieved by pressing the 'Enter' button.

SELECT-OPTIONS: s_lcdoc FOR ... .
PARAMETERS p_rec RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND gr1.
PARAMETERS p_app RADIOBUTTON GROUP gr1.

AT SELECTION-SCREEN OUTPUT.
  IF p_rec = abap_true.
    CLEAR s_lcdoc[].
  ENDIF.
  IF p_app = abap_true.
    CLEAR s_lcdoc.   " -> not sure what you are trying to do here, but that doesnt work
                      " the header structure is always the first item of the select-options
                      " you can clear it here, but it will not affect the selection screen
                      " and it will be filled again with the next event, based on s_lcdoc[]
  ENDIF. 
Read only

0 Likes
2,699

when I selecting Input for p_app from multiple selections, it is selected after selecting P_REC it is.

But when I Do same for P_REC, values are not selecting on the selection screen .

Read only

0 Likes
2,699
rushi24I am still rather confused about what you are trying to achieve with clearing the select-option s_lcdoc. But that is what you wanted to know how to do it. In some instances it makes sense to clear certain input fields based on other selections, but until I dont know what your requirements are, I wont be able to assist you in this. Please be more specific and give examples of what and when you are trying to achieve something, especially for the START/END-OF-SELECTION events
Read only

michael_piesche
Active Contributor
0 Likes
2,699

rushi24, please follow up on your open question.

  • comment answers or your question if there are still open issues.
  • otherwise mark an answer as accepted if it helped you solve your problem
  • or post an answer of yourself and accept it if you found another useful solution yourself
  • or redirect your question to another question that is related and was useful to solve your problem
  • in the end, close your question