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: 

Manually added select all button does not work on first click

Former Member
0 Kudos
328

    Hi all,

I have placed a "select all" and "deselect all" button manually in a report. When i click the button it does not select all the field at first click and only in the second click the fields get selected. Can anyone help me in this regard.

WHEN 'SEL'.
       itab-chkbox = 'X'.
       LOOP at itab INTO wa_itab WHERE chkbox = ' '.
         wa_itab-chkbox = 'X'.
         MODIFY itab FROM wa_itab.
         ENDLOOP.
         ENDIF.

     WHEN 'DESEL'.
       itab-chkbox = ' '.
       LOOP at itab INTO wa_itab WHERE chkbox = 'X'.
         wa_itab-chkbox = ' '.
         MODIFY itab FROM wa_itab.
         ENDLOOP.


Regards,

Sam.

1 ACCEPTED SOLUTION

vamsilakshman_pendurti
Active Participant
0 Kudos
201

Hi Samuel,

In Reuse_ALV_GRID_DISPLAY Function module u have one parameter like i_callback_usercommand...

there you should take one Perform command like USER_COMMAND

For this implement as like the below mention code

FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                   I_SELFIELD TYPE SLIS_SELFIELD.
   DATA: REF1 TYPE REF TO CL_GUI_ALV_GRID.
   CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
     IMPORTING
       E_GRID = REF1.
   CALL METHOD REF1->CHECK_CHANGED_DATA.
   CASE F_UCOMM.

  WHEN 'SALL'.

    WA_itab-CHECK = 'X'.
      MODIFY  ITAB FROM WA_Itab TRANSPORTING CHECK WHERE CHECK <> 'X'.
      CLEAR WA_itab.

      I_SELFIELD-REFRESH = 'X'.

    WHEN 'DALL'.

      WA_itab-CHECK = ' '.
      MODIFY  ITAB FROM WA_itab TRANSPORTING CHECK WHERE CHECK = 'X'.
      CLEAR WA_itab .

      I_SELFIELD-REFRESH = 'X'.


ENDCASE.


Hope it will helps you,



Thanks,

vamsi.

9 REPLIES 9

former_member202818
Active Contributor
0 Kudos
201

Hi Samuel,

Where u wrote it? its should be before loop in PBO.

Can u paste Screen flow logic?    

Regards

Sreekanth

0 Kudos
201

Hi Sreekanth,

I haven't done any codings to the PBO... 

0 Kudos
201

MODULE %_PBO_REPORT.

MODULE %_PF_STATUS.

MODULE %_END_OF_PBO.

PROCESS AFTER INPUT.

   MODULE %_BACK AT EXIT-COMMAND.

   MODULE %_INIT_PAI.

FIELD !AUFNR MODULE %_AUFNR .

CHAIN.
   FIELD AUFNR .
   MODULE %_END_OF_SCREEN.
   MODULE %_OK_CODE_1000.
ENDCHAIN.

former_member197132
Participant
0 Kudos
201

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_9000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

module USER_COMMAND_9000 input.

Case sy-ucomm.

WHEN 'SEL'.

       itab-chkbox = 'X'.

 

WHEN 'DESEL'.
       itab-chkbox = ' '.

endcase.

if itab-chkbox = 'X'.

LOOP at itab INTO wa_itab WHERE chkbox = ' '.

         wa_itab-chkbox = 'X'.

         MODIFY itab FROM wa_itab.

         ENDLOOP.

Elseif. itab-chkbox = ' '.

       LOOP at itab INTO wa_itab WHERE chkbox = 'X'.

         wa_itab-chkbox = ' '.

         MODIFY itab FROM wa_itab.

         ENDLOOP.

endif

endmodule.         

0 Kudos
201

Hi Shailendra


Thanks for your reply. This is not a module pool program. But as u mentioned i have done the same changes but nothing worked.

vamsilakshman_pendurti
Active Participant
0 Kudos
202

Hi Samuel,

In Reuse_ALV_GRID_DISPLAY Function module u have one parameter like i_callback_usercommand...

there you should take one Perform command like USER_COMMAND

For this implement as like the below mention code

FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                   I_SELFIELD TYPE SLIS_SELFIELD.
   DATA: REF1 TYPE REF TO CL_GUI_ALV_GRID.
   CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
     IMPORTING
       E_GRID = REF1.
   CALL METHOD REF1->CHECK_CHANGED_DATA.
   CASE F_UCOMM.

  WHEN 'SALL'.

    WA_itab-CHECK = 'X'.
      MODIFY  ITAB FROM WA_Itab TRANSPORTING CHECK WHERE CHECK <> 'X'.
      CLEAR WA_itab.

      I_SELFIELD-REFRESH = 'X'.

    WHEN 'DALL'.

      WA_itab-CHECK = ' '.
      MODIFY  ITAB FROM WA_itab TRANSPORTING CHECK WHERE CHECK = 'X'.
      CLEAR WA_itab .

      I_SELFIELD-REFRESH = 'X'.


ENDCASE.


Hope it will helps you,



Thanks,

vamsi.

0 Kudos
201

Hi Vamsi,

I have used it... in my report already..

0 Kudos
201

Vamsi thanks the problem got solved... as per your suggestion i used

I_SELFIELD-REFRESH = 'X'. and gor solved. Thanks all for your support and help.



Regards,

Sam.

0 Kudos
201

Hi

See this code...

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_CALLBACK_PROGRAM                 = SY-REPID
        
         I_CALLBACK_USER_COMMAND    = 'USER_COMMAND'
         IS_LAYOUT_LVC                                = GS_LAYO
         IT_FIELDCAT_LVC                            = GT_FCAT
*       IT_EVENTS                                        = GT_EVENTS
       TABLES
         T_OUTTAB                                          = ITAB[].
      
in the above Function Module have you used that parameter ........


    I_CALLBACK_PROGRAM                 = SY-REPID


Check it once......



Thanks ,

vamsi.