*---------------------------------------------------------------------*
* FORM ALV_USER_COMMAND_DISPLAY_SEL
*---------------------------------------------------------------------*
* --> P_UCOMM *
* --> PS_SELFIELD *
*---------------------------------------------------------------------*
FORM alv_user_command_display_sel USING
prf_ucomm LIKE sy-ucomm
prs_selfield TYPE slis_selfield.
DATA: ldf_kunnr TYPE kunnr,
ldf_vbeln TYPE vbeln.
CASE prf_ucomm.
WHEN '&IC1'. "Double click
READ TABLE gdt_rept INDEX prs_selfield-tabindex. "Cursor position
CHECK sy-subrc EQ 0.
CASE prs_selfield-fieldname.
WHEN 'KUNAG'.
CLEAR ldf_kunnr.
ldf_kunnr = gdt_rept-kunag.
IF NOT ldf_kunnr IS INITIAL.
SET PARAMETER ID 'KUN' FIELD ldf_kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'KUNWE'.
CLEAR ldf_kunnr.
ldf_kunnr = gdt_rept-kunwe.
IF NOT ldf_kunnr IS INITIAL.
SET PARAMETER ID 'KUN' FIELD ldf_kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
WHEN OTHERS.
ENDCASE.
CLEAR prf_ucomm.
ENDFORM. "alv_user_command_display_sel
No comments:
Post a Comment