Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

RE:ALV grid (oops concept)

Hi,

I have got an alv grid (oops concept) which shows sflight table details in disable mode.Now my requirement is when i double click on carrid(airline no) it should be enabled(change mode).What i did is i created an internal table like

TYPES: BEGIN OF GTY_SFLIGHT.

TYPES: CELLTAB TYPE LVC_T_STYL.

INCLUDE STRUCTURE SFLIGHT.

TYPES: END OF GTY_SFLIGHT.

and used the event

METHODS: CATCH_DOUBLECLICK

FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID

IMPORTING

E_COLUMN

ES_ROW_NO

SENDER.

In the method i wrote it like this

METHOD CATCH_DOUBLECLICK.

DATA: LT_ROWID TYPE LVC_T_ROID,

LS_ROWID TYPE LVC_S_ROID.

  • CALL METHOD GRID1->GET_SELECTED_ROWS

  • IMPORTING

  • ET_ROW_NO = LT_ROWID.

  • read table gt_outtab into ls_outtab index es_row_no-row_id.

  • READ TABLE LT_ROWID INTO LS_ROWID INDEX 1.

READ TABLE GT_OUTTAB INTO WA_OUTTAB INDEX ES_ROW_NO-ROW_ID.

LOOP AT WA_OUTTAB-CELLTAB INTO LS_CELLTAB.

IF LS_CELLTAB-FIELDNAME EQ 'CARRID'.

IF LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.

LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.

MODIFY WA_OUTTAB-CELLTAB FROM LS_CELLTAB.

ENDIF.

ENDIF.

ENDLOOP.

MODIFY GT_OUTTAB FROM WA_OUTTAB INDEX ES_ROW_NO-ROW_ID.

CALL METHOD SENDER->REFRESH_TABLE_DISPLAY.

  • call method grid1->refresh_table_display.

ENDMETHOD. "catch_doubleclick

i wrote the same code in standard eg BCALV_EDIT_05.But the

field carrid is not coming in editable mode.

Wht can be the problem.

Thanks in advance.

Alex.

Not what you were looking for? View more on this topic or Ask a question