Skip to Content
author's profile photo Former Member
Former Member

checkboxes in the output

Hi,

In the o/p screen i have 4 push buttons checkall,uncheckall,change,export.There were few records present in the o/p screen and beside each record there is a checkbox.Now if the checkall pushbutton is clicked,then all the checkboxes have to be selected.If the uncheckall pushbutton is clicked,the all the checkboxes have to be unchecked.If the change pushbutton is clicked,then the control should go to next screen.How can I write the code for all the checkboxes to be selected or unselected?

Regards,

Hema

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 29, 2008 at 09:46 AM

    use AT SELECTION-SCREEN event to write your code.

    Just check the value of the checkbox and process acordingly.

    For Check value is 'X' and SPACE for uncheck.

    say -

    If v_uncheckall = 'X'.

    v_check = space.

    v_export = space.

    v_change = space.

    endif.

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:47 AM

    in user command u can write the following code:

    case sy-ucomm.

    when 'checkall'.

    ck1 = 'X'.

    ck2 = 'X'.

    ck3 = 'X'.

    ck4 = 'X'.

    when 'uncheckall'.

    clear: ck1,ck2,ck3,ck4.

    endcase.

    here ck1,2,3,4 are ckech box name and also declare char variable with the same name into the prog.

    I think this will help u.

    thanks

    Dharmishta

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      In my program 'REUSE_ALV_FIELD_CATALOG_MERGE' function module was used to declare the field catalog.

      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

      EXPORTING

      i_program_name = sy-cprog

      i_internal_tabname = 'OUTPUT'

      i_inclname = sy-cprog

      i_bypassing_buffer = 'X'

      CHANGING

      ct_fieldcat = gt_fcat

      EXCEPTIONS "#EC *

      inconsistent_interface = 1

      program_error = 2

      OTHERS = 3.

      LOOP AT gt_fcat INTO gs_fcat WHERE fieldname = 'CHECKBOX'.

      gs_fcat-checkbox = 'X'.

      gs_fcat-edit = 'X'.

      MODIFY gt_fcat FROM gs_fcat.

      ENDLOOP.

      gs_layout-zebra = 'X'.

      gs_layout-colwidth_optimize = 'X'.

      In this case,how can I check or uncheck the checkboxes?

      Regards,

      Hema

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:48 AM

    See the following ex:

    SELECTION-SCREEN: BEGIN OF BLOCK b1.

    PARAMETERS: B_all as checkbox usER-COMMAND rd1 DEFAULT 'X',

    B_ONE as checkbox,

    B_TWO as checkbox,

    B_THR as checkbox.

    SELECTION-SCREEN: END OF BLOCK b1.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF B_ALL = 'X'.

    B_ONE = 'X'.

    B_TWO = 'X'.

    B_THR = 'X'.

    MODIFY SCREEN.

    ELSEIF B_ALL = ' '.

    B_ONE = ''.

    B_TWO = ''.

    B_THR = ''.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.