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: 

ALV check box

Former Member
0 Kudos

hi Experts,

i am trying to put a check box in ALV report.... but i am not getting in output display..... i am not sure where i am doing wrong...

let me know where i did wrong...

i want check box as first column.... and remaing 4 columns next....

Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code

Giri

Edited by: Rob Burbank on Nov 24, 2009 2:06 PM

1 ACCEPTED SOLUTION

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer wiki code by me on ALV with Checkbox:-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bch...

Hope this helps you.

Regards,

Tarun

9 REPLIES 9

rainer_hbenthal
Active Contributor
0 Kudos

>

> let me know where i did wrong...

> Giri

You are doing wrong in formatting your relevant parts of your sorucecode. refer to the right on how to format a posting and read rules first.

0 Kudos

Hi Rainer...

I provided syntax for the program... but it didn't work properly...

Giri

Former Member
0 Kudos

Hi,

Do this.



  CLEAR t_fcat2.
  t_fcat2-col_pos  = 1.
  t_fcat2-fieldname = 'CHECKBOX'.
  t_fcat2-checkbox = 'X'.
  t_fcat2-edit = 'X'.
  t_fcat2-seltext = 'CHECK'.

  APPEND t_fcat2 TO t_fcat1.
  CLEAR t_fcat2.

Former Member
0 Kudos

Hi

for Alv With check box Check this link...

http://wiki.sdn.sap.com/wiki/display/Snippets/ALVGridDisplaywithcheckboxtoprocessselectedrecordsatruntime

Regards

ABG.

Former Member
0 Kudos

Hi Giri,

I have got an output with your code. However make sure that internal table IT_VBAK is not empty. If it is empty, you will not be able to see any checkbox then. I have made a small change in your code.

When I used your code with SY-REPID , I got a dump. So changed SY-REPID to SY-CPROG


*-----------------------------------------------------------*
*FORM build_fieldcat
*&--------------------------------------------------------- *
*Field catalogue
form build_fieldcat.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name         = sy-cprog
            i_internal_tabname     = 'IT_VBAK'
*            i_structure_name       = 'WA_VBAK'
*            i_client_never_display = 'X'
            i_inclname             = sy-cprog
*i_bypassing_buffer     =
*i_buffer_active        =
            changing
            ct_fieldcat            = it_fieldcat
       EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
*  IF sy-subrc 0.
*    * message id sy-msgid type sy-msgty number sy-msgno * with sy-msgv1
*    sy-msgv2 sy-msgv3 sy-msgv4.
*  ENDIF.

  CLEAR wa_fieldcat.
  LOOP AT it_fieldcat INTO wa_fieldcat.
    IF wa_fieldcat-fieldname = 'FLAG'.
      wa_fieldcat-seltext_s = 'EDIT'.
      wa_fieldcat-edit = 'X'.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-outputlen = 1.
      wa_fieldcat-checkbox = 'X'.
* wa_fieldcat-reprep = 'X'.
  MODIFY it_fieldcat FROM wa_fieldcat.
    ENDIF.
  ENDLOOP.
ENDFORM. "build_fieldcat

Kindly set to resolved if it helps you.

Regards

Abhii

Edited by: Abhii on Nov 24, 2009 10:07 AM

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer wiki code by me on ALV with Checkbox:-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bch...

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Hi Tarun,

thanks your blog helped alot...

i have question... in the current ALV program i am getting all standard functions, sort, sum and all...

now i ned to add a new button there for selected check boxes....

if i create new PF status.... i am getting only the 1 button with submit... i want all all other standard button which was previous there ....

am i need to code for all button in user_command routine?

Giri

0 Kudos

Hi,

Goto SE41, create a pf-status for your alv report program.

On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.

Delete the unwanted buttons and also you can add new buttons if reqd.

Activate pf-status --> and apply in alv program.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Hi Giri,

There is no problem with your code, I have checked on my system & got the output with the checkbox, only thing is dont pass SY-REPID directly assign it to some intermediate variable & make sure your internal table (IT_VBAK) is not empty.

Regards

Abhii