Register Login

At user command in ALV

Updated Jun 27, 2019

 FORM USER_COMMAND USING UCOMMAND LIKE SY-UCOMM USER_FIELD TYPE SLIS_SELFIELD.
 

  DATA:D_PO(10) TYPE C.
  CLEAR:IS_FINAL.

  READ TABLE IT_FINAL INTO IS_FINAL INDEX USER_FIELD-TABINDEX.
  BREAK-POINT.
  IF SY-SUBRC EQ 0.
    D_PO = IS_FINAL-EBELN.
    SET PARAMETER ID 'BES' FIELD D_PO.
    CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
*    ELSE.
*      CLEAR
  ENDIF.
ENDFORM.
"user_command

I have an ALV output with two fields puchase document no-ebeln and material doc no-belnr,

If i click ebeln it should go to me23n and if i press belnr it should go to T.code:MIR4.

PLease help on this,Piece of code is only for ebeln ..please suggest how to include belnr.


×