Skip to Content
0
Former Member
Oct 16, 2006 at 05:20 AM

not able to capture selected row in the ALV toolbar

24 Views

I am calling 5 standard transactions from my ALV list: 2 transaction from the list by selecting flds.(MATNR,EBLEN)

EBELN is not setting parameter.(please help me)

3 transactions from ALV toolbar.(I need to select a row from the list from this row matnr and werks need to pass as parameters to these 3 transactions.

the problem is not able to capture the the matnr and werks.

Please see the code below and help me.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

DATA:gs_selfield TYPE slis_selfield,

ok_code LIKE sy-pfkey.

CASE r_ucomm.

WHEN '&IC1'.

gs_selfield = rs_selfield.

IF gs_selfield-fieldname = 'EBELN'.

MOVE 'EVRTN' TO rs_selfield-fieldname.

SET PARAMETER ID 'VRT' FIELD rs_selfield-value.

  • SET PARAMETER ID 'BES' FIELD rs_selfield-value.

CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.

ELSE.

IF gs_selfield-fieldname = 'MATNR'.

SET PARAMETER ID 'MAT' FIELD rs_selfield-value.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

ENDCASE.

ok_code = sy-ucomm.

READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-value.

SET PARAMETER ID 'MAT' FIELD wa_rep_tab-matnr.

SET PARAMETER ID 'WRK' FIELD wa_rep_tab-werks.

CASE ok_code.

WHEN 'MD04'.

CALL TRANSACTION 'MD04'." AND SKIP FIRST SCREEN.

WHEN 'MMBE'.

CALL TRANSACTION 'MMBE'." AND SKIP FIRST SCREEN.

WHEN 'MD51'.

CALL TRANSACTION 'MD51' ."AND SKIP FIRST SCREEN.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDFORM.

Please help me............