Hi Experts,
I have a problem with the radio button entry not clearing out. Below is my code which is in the iterator. I have 2 buttons on my bsp page "Approve All" and "Reject All" push-buttons.
First when I click on "Reject All" push-button ls_action = 'REJC' and all the Reject radio buttons get selected as expected, but as soon as I click on the "Approve All" push-button both Approve radio button as well as the Reject radio buttons get selected, which leads to confusion. Can any one body please suggest me to tackle this issue. Thanks.. Below is the code which is inside the render_cell_start
method of the iterator.
WHEN 'OPTION'.
DATA:
lo_radiobuttongrp TYPE REF TO cl_htmlb_radiobuttongroup,
lo_radiobutton TYPE REF TO cl_htmlb_radiobutton,
lo_table TYPE REF TO cl_bsp_bee_table.
CLEAR : lv_appr_checked,lv_rejc_checked,ls_action.
READ TABLE model->appr_status[]
WITH KEY product_id = current_row_ref->product_id
INTO ls_status.
if sy-subrc = 0.
ls_action = ls_status-action.
endif.
IF ls_action = 'APPR'.
lv_rejc_checked = 'FALSE'.
lv_appr_checked = 'TRUE'.
ELSEIF ls_action = 'REJC'.
lv_appr_checked = 'FALSE'.
lv_rejc_checked = 'TRUE'.
ELSEIF model->ev_flag = 'X'.
lv_appr_checked = 'FALSE'.
lv_rejc_checked = 'TRUE'.
ELSE.
lv_appr_checked = 'FALSE'.
lv_rejc_checked = 'FALSE'.
ENDIF.
CREATE OBJECT lo_table.
lo_radiobuttongrp = cl_htmlb_radiobuttongroup=>factory(
columncount = '2'
id = current_row_ref->product_id ).
lo_table->add( element = lo_radiobuttongrp
level = 1 ).
lo_radiobutton ?= cl_htmlb_radiobutton=>factory(
id = current_row_ref->product_id
id_postfix = 'APPR'
key = 'APPR'
text = 'Approve'
checked = lv_appr_checked
).
lo_table->add( element = lo_radiobutton
level = 2 ).
lo_radiobutton ?= cl_htmlb_radiobutton=>factory(
id = current_row_ref->product_id
id_postfix = 'REJC'
key = 'REJC'
text = 'Reject'
checked = lv_rejc_checked
).
lo_table->add( element = lo_radiobutton
level = 2 ).
p_replacement_bee ?= lo_table.
ENDCASE.