Application Development and Automation 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: 
Read only

ALV problem

Former Member
0 Likes
375

Dear frnds,

I have to create an ALV in a report using ALV Grid display function in such a way that the user could able to select rows and can perform udation and deletion ect.But i am having problem with the navigation.Whenever a user double click the row to select that row the coursor position sets to the first line.Eg.when double clicked in the 100th row the row is selected but coursor position resets to row 1.what i can do ...i am pasting the code portion below....pls help me

FORM user_command USING u_com LIKE sy-ucomm

sel_field TYPE slis_selfield.

CASE u_com.

WHEN '&IC1'.

TEMP_INDEX = sel_field-tabindex.

READ TABLE i_final INTO wa_final INDEX TEMP_INDEX.

IF sy-subrc = 0.

IF wa_final-status EQ space OR wa_final-status = '@02@'.

wa_final-status = '@01@'.

ELSEIF wa_final-status = '@01@'.

wa_final-status = '@02@'.

ENDIF.

wa_final-chkbx = 'X'.

MODIFY i_final FROM wa_final INDEX sy-tabix

TRANSPORTING status

chkbx.

CLEAR wa_final.

ENDIF.

sel_field-refresh = 'X'.

endif.

Endform.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
344

Hi

U need to indicate to keep the position after refreshing the list:

FORM USER_COMMAND USING U_COM LIKE SY-UCOMM
                       SEL_FIELD TYPE SLIS_SELFIELD.

  CASE U_COM.

    WHEN '&IC1'.
      TEMP_INDEX = SEL_FIELD-TABINDEX.
      READ TABLE I_FINAL INTO WA_FINAL INDEX TEMP_INDEX.
      IF SY-SUBRC = 0.

        IF WA_FINAL-STATUS EQ SPACE OR WA_FINAL-STATUS = '@02@'.
          WA_FINAL-STATUS = '@01@'.
        ELSEIF WA_FINAL-STATUS = '@01@'.
          WA_FINAL-STATUS = '@02@'.
        ENDIF.

        WA_FINAL-CHKBX = 'X'.
        MODIFY I_FINAL FROM WA_FINAL INDEX SY-TABIX
        TRANSPORTING STATUS
        CHKBX.
        CLEAR WA_FINAL.
      ENDIF.

      SEL_FIELD-REFRESH = 'X'.

      SEL_FIELD-COL_STABLE = 'X'. "<---Keep the colunm
      SEL_FIELD-ROW_STABLE = 'X'. "<---Keep the row
    ENDIF.
  ENDFORM.                    "user_command

Max

1 REPLY 1
Read only

Former Member
0 Likes
345

Hi

U need to indicate to keep the position after refreshing the list:

FORM USER_COMMAND USING U_COM LIKE SY-UCOMM
                       SEL_FIELD TYPE SLIS_SELFIELD.

  CASE U_COM.

    WHEN '&IC1'.
      TEMP_INDEX = SEL_FIELD-TABINDEX.
      READ TABLE I_FINAL INTO WA_FINAL INDEX TEMP_INDEX.
      IF SY-SUBRC = 0.

        IF WA_FINAL-STATUS EQ SPACE OR WA_FINAL-STATUS = '@02@'.
          WA_FINAL-STATUS = '@01@'.
        ELSEIF WA_FINAL-STATUS = '@01@'.
          WA_FINAL-STATUS = '@02@'.
        ENDIF.

        WA_FINAL-CHKBX = 'X'.
        MODIFY I_FINAL FROM WA_FINAL INDEX SY-TABIX
        TRANSPORTING STATUS
        CHKBX.
        CLEAR WA_FINAL.
      ENDIF.

      SEL_FIELD-REFRESH = 'X'.

      SEL_FIELD-COL_STABLE = 'X'. "<---Keep the colunm
      SEL_FIELD-ROW_STABLE = 'X'. "<---Keep the row
    ENDIF.
  ENDFORM.                    "user_command

Max