Application Development 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: 

Select and Deselect Check-Box in Output list

Former Member
0 Kudos

Hello Every1,

Can any1 give me the code for select and deselect all the check-boxes in the output list.

It's not an ALV report.

Thanks,

Siva.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Not sure about the structure of your program, but here is a little example .




report zrich_0002 no standard page heading.

data: check(1) type c.


start-of-selection.

* Write the initial list
  do 20 times.
    write:/ check as checkbox, sy-index.
  enddo.



at user-command.

* Set the checkbox on or off
  case sy-ucomm.
    when 'SELA'.
      check = 'X'.
    when 'DELA'.
      check = space.
  endcase.

* Rewrite the list
  sy-lsind = sy-lsind - 1.

  do 20 times.
    write:/ check as checkbox, sy-index.
  enddo.

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Not sure about the structure of your program, but here is a little example .




report zrich_0002 no standard page heading.

data: check(1) type c.


start-of-selection.

* Write the initial list
  do 20 times.
    write:/ check as checkbox, sy-index.
  enddo.



at user-command.

* Set the checkbox on or off
  case sy-ucomm.
    when 'SELA'.
      check = 'X'.
    when 'DELA'.
      check = space.
  endcase.

* Rewrite the list
  sy-lsind = sy-lsind - 1.

  do 20 times.
    write:/ check as checkbox, sy-index.
  enddo.

Regards,

Rich Heilman

former_member188685
Active Contributor
0 Kudos

Hi,

REPORT ZTEST_CHECK no STANDARD page heading

.

end-of-selection.

data: begin of itab occurs 0,

vbeln like vbak-vbeln,

posnr like vbap-posnr,

a(1),

end of itab.

select vbeln

posnr from vbap

up to 20 rows

into table itab .

loop at itab.

write:/ itab-a as checkbox,

itab-vbeln,

itab-posnr.

endloop.

Regards

vijay

former_member188685
Active Contributor
0 Kudos
REPORT  ZTEST_CHECK                             .

end-of-selection.


data: begin of itab occurs 0,
        vbeln like vbak-vbeln,
        posnr like vbap-posnr,
        a(1),
     end of itab.
select vbeln
       posnr from vbap
       up to 20 rows
       into table itab .
loop at itab.

write:/ itab-a as checkbox,
        itab-vbeln,
        itab-posnr.

endloop.

Regards

vijay

Former Member
0 Kudos

Hi siva,

Please check the below code.



***********************************************************************
*               Declaration Of Internal tables                        *
***********************************************************************
  DATA : BEGIN OF I_YHPTSRCE OCCURS 0.
          INCLUDE STRUCTURE YHPTSRCE.
  DATA:    SEL(1) TYPE C,
         END OF I_YHPTSRCE.


************************************************************************
*                        User Command
************************************************************************

  AT USER-COMMAND.

  CASE SY-UCOMM.

      WHEN 'SALL'.
        IF NOT P_CATT IS INITIAL.
          I_YHPTCNAMES-SEL = 'X'.
          MODIFY I_YHPTCNAMES TRANSPORTING SEL WHERE SEL = ' '.
        ELSEIF NOT P_TCASE IS INITIAL.
          I_YHPTCASE-SEL = 'X'.
          MODIFY I_YHPTCASE TRANSPORTING SEL WHERE SEL = ' '.
        ELSE.
          I_YHPTSRCE-SEL = 'X'.
          MODIFY I_YHPTSRCE TRANSPORTING SEL WHERE SEL = ' '.
        ENDIF.
        SY-LSIND = 0.
        PERFORM DISPLAY_DATA.

      WHEN 'DALL'.

        IF NOT P_CATT IS INITIAL.
          CLEAR I_YHPTCNAMES-SEL.
          MODIFY I_YHPTCNAMES TRANSPORTING SEL WHERE SEL = 'X'.
        ELSEIF NOT P_TCASE IS INITIAL.
          CLEAR I_YHPTCASE-SEL.
          MODIFY I_YHPTCASE TRANSPORTING SEL WHERE SEL = 'X'.
        ELSE.
          CLEAR I_YHPTSRCE-SEL.
          MODIFY I_YHPTSRCE TRANSPORTING SEL WHERE SEL = 'X'.
        ENDIF.
        SY-LSIND = 0.
        PERFORM DISPLAY_DATA.


Thanks&Regards,

Siri.