06-11-2007 9:19 AM
Hi all,
I'm using FM 'REUSE_ALV_GRID_DISPLAY' in my program. However, I'm having problem getting the current row or the cursor position in my ALV. If possible, I do not wish to use OO method in doing this. Is there any other way?
06-11-2007 9:24 AM
HI,
whenever you click on any row of a alv
grid or list display
selfield structure will be flled with the row contents
try this
FORM USER_COMMAND USING PV_UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
if SELFIELD-TABNAME = internal table name
endif.
endform.
check out the structure SELFIELD.
reward points if helpful
regards,
venkatesh
06-11-2007 9:26 AM
hi
i assume u mean to capture the current line or the line index that is selected in the grid display..if so, then do something like this
data: W_BOXNAM TYPE SLIS_FIELDNAME VALUE 'BOX'.
declare a char. field BOX of length 1 in the itab that you are displaying in grid
in layout, LAYOUT-BOX_FIELDNAME = 'BOX'.
in itab, the value of field BOX will be set to X when it's selected...can get the row no with sy-tabix inside the loop.
loop at itab where box = 'X'.
endloop.
if helpful, reward
Sathish. R
06-11-2007 9:28 AM
Hello Mil,
When u double click a row we can able to capture the column value field name every thing.#
Check this.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CHECK RS_SELFIELD-FIELDNAME = 'VBELN_O' OR
RS_SELFIELD-FIELDNAME = 'VBELN'.
CASE R_UCOMM.
WHEN '&IC1'. "doubleclick
SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
* IF RS_SELFIELD-FIELDNAME = 'VBELN_O'.
IF RS_SELFIELD-FIELDNAME = 'VBELN_O'.
IF NOT RS_SELFIELD-VALUE IS INITIAL.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ELSE.
MESSAGE E999(Z48MM) WITH TEXT-T02 SPACE SPACE SPACE.
ENDIF.
ELSEIF RS_SELFIELD-FIELDNAME = 'VBELN'.
PERFORM CALL_TRANSACTION_VA23 USING RS_SELFIELD-VALUE.
* CALL TRANSACTION 'VA23' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND