Monday, February 7, 2011

Abap multiple selection-screen using radio button

It is really general to have an Abap Report which have Multiple Output for single AVL or report list.  On selection-screen usually we will use Radio button as command option, how to control the radio button action to work as below configuration?



 *Run option
selection-screen begin of block blca with frame title text-t0a.
parameters:   rb_post radiobutton group rb1 default 'X' user-command tuc1,
              rb_test radiobutton group rb1.
selection-screen end of block blca.
*Email option


selection-screen begin of block blcb with frame title text-t0b.
selection-screen begin of line.
parameter cb_email as checkbox.
selection-screen comment (10) text-p02.
selection-screen comment 20(15) text-p01.
parameter p_email type ad_smtpadr.
selection-screen end of line.
selection-screen end of block blcb.




at selection-screen output.
  loop at screen.
  if rb_test = 'X'.
    if screen-name = 'CB_EMAIL' or screen-name = 'P_EMAIL'.
      screen-input = 1.
      modify screen.
    endif.
 elseif rb_post = 'X'.
   if screen-name = 'CB_EMAIL' or screen-name = 'P_EMAIL'.
      screen-input = 0.
      clear p_email.
      clear cb_email.
      modify screen.
    endif.
  endif.
 endloop.


Importance things you need to insert ‘User-Command ‘ key . this user-command will automatically trigger the At-Selection screen output to run the command from radio button.

0 comments:

Post a Comment