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

ALV - Problem with checkbox.

Former Member
0 Likes
483

Dear All,

I have created an ALV Grid Control and have one column as a check box.

when i tick one checkbox in a line item i pop up a message saying "Do you wish to continue".

If the user selects NO then i automatically want to deselect the checkbox.

I tried clearing the work area of the internal table in the data change event.

But when the alv is refreshed the checkbox is still ticked.What should be done to avoid this.

Is freeing the custom container and creating it again everytime the user selects NO a good option?

Kindly suggest.

Regards,

Varun

Dear All,

I have created an ALV Grid Control and have one column as a check box.

when i tick one checkbox in a line item i pop up a message saying "Do you wish to continue".

If the user selects NO then i automatically want to deselect the checkbox.

I tried clearing the work area of the internal table in the data change event.

But when the alv is refreshed the checkbox is still ticked.What should be done to avoid this.

Is freeing the custom container and creating it again everytime the user selects NO a good option?

Kindly suggest.

Regards,

Varun

2 REPLIES 2
Read only

Former Member
0 Likes
447

In ALV you put check box like


X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.



in between you put logic 

 IF CHK = 'X' 
*---popup_to_continue_yes_no
    PERFORM POPUP_TO_CONT_YES_NO.
endif.


FORM POPUP_TO_CONT_YES_NO .
  CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
    EXPORTING
      TEXTLINE1 = 'Click OK to leave program'
      TITEL     = 'POPUP_CONTINUE_YES_NO'
    IMPORTING
      ANSWER    = ANS.
  IF ANS = 'J'.
    LEAVE PROGRAM.
  ENDIF.
ENDFORM.                    " POPUP_TO_CONT_YES_NO

Read only

Former Member
0 Likes
447

hi,

Try refresing the field using slis_selfield-refresh = 'x'.