Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive ALV

Former Member
0 Kudos

Hi Friends,

i am having an ALV, with fields Purchase order Number , Purchase Requestion, MIGO Number.

On clicking the respective recorde details its should go transaction codes ME23N or ME53N or MB03...

How to do, should we use Call transaction or set parameter statements

Help me Out.

regards

Kumar M

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please refer to the link below

http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm

Thanks,

Sriram Ponna.

6 REPLIES 6

former_member386202
Active Contributor
0 Kudos

Hi,

Refer this code

&----


*& Form user_command

&----


  • text

----


  • -->U_COM text

----


FORM user_command USING u_com LIKE sy-ucomm

sel_field TYPE slis_selfield.

*--Local Variables

DATA : lv_belnr TYPE belnr_d,

lv_bukrs TYPE bukrs,

lv_gjahr TYPE gjahr.

IF sel_field-fieldname EQ 'BELNR'.

READ TABLE it_bsis INTO wa_bsis WITH KEY belnr = sel_field-value.

IF sy-subrc EQ 0.

lv_belnr = wa_bsis-belnr.

lv_bukrs = wa_bsis-bukrs.

lv_gjahr = wa_bsis-gjahr.

ENDIF.

CASE u_com.

WHEN '&IC1'.

SELECT SINGLE belnr

bukrs

gjahr

FROM bsis

INTO (lv_belnr,lv_bukrs,lv_gjahr)

WHERE belnr EQ lv_belnr

AND bukrs EQ lv_bukrs

AND gjahr EQ lv_gjahr.

IF sy-subrc EQ 0.

SET PARAMETER ID : 'BLN' FIELD lv_belnr,

'BUK' FIELD lv_bukrs,

'GJR' FIELD lv_gjahr.

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDIF.

ENDFORM. "user_command

Regards,

pRashant

0 Kudos

I need explanation in simple words , with a simple example... from ALV report i need call the respective transactions...

i have got 10 fields in the ALV output,,, in which if i click on PO or PR or MIGO number the screen should change to ME23n or ME53n or MB03.

regards

Kumar M

Former Member
0 Kudos

ya u need to use CALL transaction stmt. but before that u need to use SET PARAMETER id for the respective parameter ids.

Reward if useful

regards

ANUPAM

Former Member
0 Kudos

hi,

In the ALV FM pass a subroutine name as shown below.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_USER_COMMAND = 'USER_COMMAND' .

set parameter ID for the required field

FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM

P_SELFIELD TYPE SLIS_SELFIELD.

CASE P_UCOMM .

WHEN '&IC1'.

ge tparameter id from the field.

call transaction ME23n or ME53N

endcase.

endform.

Former Member
0 Kudos

Hi,

Follow below code.

FORM dis_ship_list_grid USING v_repid TYPE sy-repid

fp_i_fieldcat TYPE slis_t_fieldcat_alv

fp_i_ship TYPE fp_i_ship.

SORT fp_i_ship BY tknum.

  • calling function module to diplay the data

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'SHIPMENT WITH SETTLEMENT STATUS'

it_fieldcat = fp_i_fieldcat

TABLES

t_outtab = fp_i_ship

EXCEPTIONS

program_error = 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.

ENDFORM. " dis_ship_list_grid

&----


-
-
-
-
-
---

*& Form USER_COMMAND

&----


-
-
-
-
-
---

  • Identify user Action On Report

----


-
-
-
-
-
--

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-sel_tab_field EQ 'I_SHIP-TKNUM' .

READ TABLE i_ship INTO wa_ship INDEX rs_selfield-tabindex.

SET PARAMETER ID 'TNR' FIELD wa_ship-tknum.

CALL TRANSACTION 'VT02N' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE i119.

ENDIF.

ENDCASE.

ENDFORM. "user_command

Regards

RAms

Former Member
0 Kudos

Hi,

Please refer to the link below

http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm

Thanks,

Sriram Ponna.