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: 

Problems with checkbox in ALV-GRID OO

Former Member
0 Kudos

Hi,

i have Problems by listing an editable checkbox

in ALV GRID OO and handle the itab with

the marked fields.

Here my Code extract. Has anybody an idea or a short example.

TYPES: BEGIN OF ALV_TAB,

...

SGTXT LIKE RK23B-SGTXT,

CHECK(1),

...

END OF ALV_TAB.

*

DATA: ITAB TYPE TABLE OF ALV_TAB.

*

Is this Declaration correct??

<b> GS_FIELDCAT-FIELDNAME = 'CHECK'.

GS_FIELDCAT-CHECKBOX = 'X'.

APPEND GS_FIELDCAT TO GT_FIELDCAT.

*

GS_LAYOUT-EDIT = 'X'.

GS_LAYOUT-BOX_FNAME = 'CHECK'.</b>

CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IT_TOOLBAR_EXCLUDING = PT_EXCLUDE

IS_LAYOUT = GS_LAYOUT

CHANGING

IT_FIELDCATALOG = GT_FIELDCAT

IT_OUTTAB = ITAB.

*

FORM HANDLE_USER_COMMAND USING E_UCOMM.

*

CASE E_UCOMM.

WHEN 'REFR'.

*

<b> Here i will have the itab with the marked checkbox.

how can i refresh?</b>*

WHEN 'EXCEL'.

*

MESSAGE I010 WITH E_UCOMM.

*

ENDCASE.

*

ENDFORM. "HANDLE_USER_COMMAND

Regards, Dieter

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, in reference to....

ASE E_UCOMM.
WHEN 'REFR'.
*
Here i will have the itab with the marked checkbox.
how can i refresh?*

Do you want to get rid of the checks in any checkbox?

If so, just loop at modify.



ASE E_UCOMM.
WHEN 'REFR'.
<b>   Loop at itab where check = 'X'.
        itab-check = space.
        modify itab.
   endloop.</b>


Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, in reference to....

ASE E_UCOMM.
WHEN 'REFR'.
*
Here i will have the itab with the marked checkbox.
how can i refresh?*

Do you want to get rid of the checks in any checkbox?

If so, just loop at modify.



ASE E_UCOMM.
WHEN 'REFR'.
<b>   Loop at itab where check = 'X'.
        itab-check = space.
        modify itab.
   endloop.</b>


Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Try adding the SEL_MODE = 'D' in the layout structure.

Thanks,

Naren

0 Kudos

Hi Naren,

thanks for your answer. I think i will not using

a checkbox i will try it with SEL_MODE.

I use SEL_MODE = 'A', i think its the same as

= 'D', isn't it?.

2 Questions:

Is there any Ducumentation of the several SEL_MOD?

If i mark in ALV for example 3 lines.

I get the lines via:

CALL METHOD GR_ALVGRID->GET_SELECTED_ROWS

IMPORTING

ET_INDEX_ROWS = LT_ROWS

ET_ROW_NO = LT_ROID.

*

CALL METHOD CL_GUI_CFW=>FLUSH.

<b>Do you know any METHOD to deselect the Lines?</b>

Thanks for help

Regards, Dieter

Former Member
0 Kudos