Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: how to bring control from standard t-code back to alv list ?

$
0
0

Hi Vikas,

 

Please refer to below steps.

1. create Event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
   IMPORTING
     ET_EVENTS             = V_EVENTS
EXCEPTIONS
  LIST_TYPE_WRONG       = 1
  OTHERS                = 2            .

IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

 

2. populate event data.

READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.

  IF SY-SUBRC EQ 0.

    WA_EVENT-FORM = 'USER_COMMAND'.

    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-NAME.

  ENDIF.

 

3. double click column

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

  CASE R_UCOMM.

    WHEN '&IC1'.
      READ TABLE IT_MATNR INDEX rs_selfield-tabindex.
      SET PARAMETER ID : 'MAT' FIELD IT_MATNR-MATNR.
      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

  ENDCASE.

ENDFORM.                    "user_command

 

4. add event internal table in ALV function.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = V_REPID
     I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
     IS_LAYOUT                         = ALV_LAYOUT
     IT_FIELDCAT                       = I_FIELDCAT[]
     I_SAVE                            = 'A'
     IT_EVENTS                         = V_EVENTS
    TABLES
      T_OUTTAB                          = IT_DATA
            .

 

 

Thanks,

Yawa


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>