cancel
Showing results for 
Search instead for 
Did you mean: 

Alv grid checkbox and radio button

0 Kudos
467

Hello community,

I have a scenario which requires me to display a alv grid as below: The column1 needs to dynamically display checkbox or radiobutton as per table values: Radiobuttongrp options should be either or...

Column1 Column2

Checkbox. Fieldname1

Checkbox. Fieldname2

Checkbox. Fieldname3

Checkbox. Fieldname4

Radiobuttongrp1 Fieldname5

Radiobuttongrp1 Fieldname6

Radiobuttongrp1 Fieldname7

Radiobuttongrp2. Fieldname8

Radiobuttongrp2. Fieldname9

Radiobuttongrp2. Fieldname10

I have already developed an alv with checkboxes. But this requires a dynamic grid which needs to be populated correspondingly to values maintained in table...

I'm open to new suggestions as well just in case if this can be achieved through dynamic selection screen...

former_member1716
Active Contributor
0 Kudos

Hello Vish Sri,

Can you elaborate your requirement more by using few fields as example? That will be better for us to understand!

Accepted Solutions (1)

Accepted Solutions (1)

SimoneMilesi
Active Contributor

Did you try to google "alv grid radiobutton"?
I do not think you can have different groups out of the box, but you have to use some trick like a secondary internal table with Group and Fieldname and then use it in the HANDLE_HOTSPOT_CLICK event to have the groups.

DoanManhQuynh
Active Contributor
0 Kudos

unfortunately there is no "empty checkbox" icon...I just found ICON_WD_IFRAME which closed.

SimoneMilesi
Active Contributor
0 Kudos

quynh.doanmanh which release? S/4 1809 works with the blog i linked

You can check my quick&dirty example report-icon.txt

Sandra_Rossi
Active Contributor

Simone Milesi You show radio buttons, these are not check boxes.

Close "empty check boxes" are also ICON_DRAW_RECTANGLE or ICON_WD_TRANSPARENT_CONTAINER, but anyway none are satisfying.

SimoneMilesi
Active Contributor

My bad, sandra.rossi and quynh.doanmanh !

I misread that checkbox with radiobutton 😕

0 Kudos

IMHO, I think either radio buttons or checkboxes can only be displayed in the output ALV grid column. It is not possible to display them both in one column!!!

0 Kudos

IMHO, I guess it is not possible to display radiobutton and checkbox in the same alv column...

SimoneMilesi
Active Contributor

I'm sorry sriksrid, but you are wrong: the column contains an icon, so every icon can be shown.

DoanManhQuynh
Active Contributor
0 Kudos

Vish Sri

ALV grid only have checkbox, no radio button there so the workaround here is use icon but for the fact that there is no empty checkbox icon. If you still want both checkbox and radio in one column (which I don't see why...) you may try to create your own empty checkbox icon and upload it to SAP.

0 Kudos

Quynh Doan Manh

If you still want both checkbox and radio in one column (which I don't see why...)

The radiobutton options are for either or selection... In a radio button group two fields are displayed the user can choose only one radio button option...
DoanManhQuynh
Active Contributor
0 Kudos
Vish SriIf it your requirement I cant say anything, checkbox and radio button in 1 table just make confuse what row user can select or not, what if there is hundreds radio buttons there? So incase this is about condition that user can pick, maybe you should split the checkbox type conditions to 1 ALV and radio button type conditions to other ALV. multiple ALVs sample is out there.
Sandra_Rossi
Active Contributor

The ALV grid with such checkboxes and radiobuttons in one column looks like a multiple choice test:

Question 1: xxxxxxx (only one choice) <== the text may overlap several cells in an ALV grid
◎ 1. xxxxxxxxxxxxxx
◉ 2. xxxxxxxxxxxxxxxx
◎ 3. xxxxxxxxxxxxxx

Question 2: xxxxxxxxxxxxxxxxx (zero or several choices are possible)
☐ 1. xxxxxxxxxxxxxx
☒ 2. xxxxxxxxxxxxxxxx
☐ 3. xxxxxxxxxxxxxx

Answers (1)

Answers (1)

0 Kudos

@Quynh Doan Manh : Just to clarify on your point...

checkbox and radio button in 1 table just make confuse what row user can select or not, what if there is hundreds radio buttons there?

A custom table has been created for this purpose to classify the fields whether it is a checkbox or radio button...

Clnt F1 RDgrp1

Clnt F2 RDgrp1

Clnt F3 RDgrp2

Clnt F4 RDgrp2

F1 & F2 belong to grp1 (either or selection) and F3 & F4 belong to grp2

(either or selection). The buttongroups primarily function as the limiting factor for the choices for the radio button for the user...

Sandra Rossi Spot on... Exactly my requirement!!

Multiple alvs should be one solution for this requirement...

Sandra_Rossi
Active Contributor
0 Kudos

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Sandra_Rossi
Active Contributor
0 Kudos

Simone Milesi solution would work. It's possible to do it with one ALV.

By the way, why not doing it with HTML? (cl_gui_html_viewer or UI5, BSP, WD)