cancel
Showing results for 
Search instead for 
Did you mean: 

sort checkboxgroup

Former Member
0 Kudos

Dear all,

I would like to sort a checkboxgroup in column and not in line as done by SAP.

I have a checkboxgroup which gives a list of countries. I ask for 2 columns in my checkboxgroup but the countries are sort and writen in line, not in column :

  • Austria * France

  • Italy * Germany

I would like like this :

  • Austria *Italy

  • France * Germany

The way of reading is better in column in this kind of element as in line.

do you have a solution ?

Thanks

Véronique

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Sorry bu I don't understand your explanation.

In the checkboxgroup properties, I haven't Horizontal Gutter but only VGutter.

In fact to my checkboxgroup UI element, I bind the text with my context which contains the countries table.

I indicate the number of column count in my checkboxgroup and the system creates automatically 2 columns of checkbox as I said in my previous message.

In fact if I understand your answer, I haven't a direct solution to solve the problem. I have to sort the context table correctly to obtain the correct order in the checkbox column.

Thanks

Kind regards

Véronique

Former Member
0 Kudos

Hi,

In the Layout, use the 'Horizontal Gutter' UI element one for each row you need.

Bind both the rows to different internal tables.

In the coding, sort the list of values alphabetically. Then try using the below logic

count = count + 1.
        a = count MOD 2.
        IF a = 0.
          ls1_value1 = v1.
          APPEND ls1_value TO lt_1 .
        ENDIF.
        IF a = 1.
          ls2_value1 = v2.
          APPEND ls2_value TO lt_2.
        ENDIF.

lt_1 should be mapped to first row and lt_2 to the second row in the layout. Bind the table.

Hope it will work.