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: 

Hi

Former Member
0 Kudos

Hi,

I had made a report with some fields along with a checkbox. I have also added a checkbox to each line and created a custom button in the PF-status. Now when I click this button all the checkboxes should be checked. Its just a report and the checkbox is given as a field in an internal table. The report is not a dialog program. So please help me how to achieve this. Thanks In Advance..

Vicky

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Look at sample program which is working as per your

requirement.

REPORT YUP_CHECKBOX.

DATA:BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE SFLIGHT.

DATA: CHECK(1),

END OF ITAB.

DATA:L_TABIX TYPE SY-TABIX.

START-OF-SELECTION.

SELECT * FROM SFLIGHT

INTO TABLE ITAB

UP TO 10 ROWS .

*

*

LOOP AT ITAB.

WRITE:/ ITAB-CHECK AS CHECKBOX ,ITAB-CONNID.

ENDLOOP.

SET PF-STATUS 'TEST'.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'SELE'.

LOOP AT ITAB.

L_TABIX = SY-TABIX.

READ TABLE ITAB INDEX L_TABIX.

IF SY-SUBRC = 0.

ITAB-CHECK = 'X'.

MODIFY ITAB INDEX L_TABIX TRANSPORTING CHECK.

ENDIF.

ENDLOOP.

LOOP AT ITAB.

WRITE:/ ITAB-CHECK AS CHECKBOX ,ITAB-CONNID.

ENDLOOP.

WHEN 'BACK' OR 'CANC' OR 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

Please mark point incase answer is helpful

Thanks,

Pramod

2 REPLIES 2

Former Member
0 Kudos

Hi Vicky,

You can have write simple code like:

   
     CASE sy-ucomm.
     WHen 'SELALL'.
     LOOP AT ITAB.
        ITAB-CHECK = 'X'.
        MODIFY ITAB.
      ENDLOOP.
      PERFORM WRITE_DATA. 
     ENDCASE.

Modify the internal table and call your subroutine to display the screen again. Or use the MODIFY LIST command in ABAP to modify the existing list without re-displaying the list.

Cheers

VJ

Former Member
0 Kudos

Hi,

Look at sample program which is working as per your

requirement.

REPORT YUP_CHECKBOX.

DATA:BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE SFLIGHT.

DATA: CHECK(1),

END OF ITAB.

DATA:L_TABIX TYPE SY-TABIX.

START-OF-SELECTION.

SELECT * FROM SFLIGHT

INTO TABLE ITAB

UP TO 10 ROWS .

*

*

LOOP AT ITAB.

WRITE:/ ITAB-CHECK AS CHECKBOX ,ITAB-CONNID.

ENDLOOP.

SET PF-STATUS 'TEST'.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'SELE'.

LOOP AT ITAB.

L_TABIX = SY-TABIX.

READ TABLE ITAB INDEX L_TABIX.

IF SY-SUBRC = 0.

ITAB-CHECK = 'X'.

MODIFY ITAB INDEX L_TABIX TRANSPORTING CHECK.

ENDIF.

ENDLOOP.

LOOP AT ITAB.

WRITE:/ ITAB-CHECK AS CHECKBOX ,ITAB-CONNID.

ENDLOOP.

WHEN 'BACK' OR 'CANC' OR 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

Please mark point incase answer is helpful

Thanks,

Pramod