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: 

This is an ALV Report

Former Member
0 Kudos

If have Displayed a ALV report , i that my requirement is :

Double click on line -> navigation to MM03 (Material master material; Accounting or Costing View) andd skip selection screen.

for this i have written a call transaction program but i dont know what i should do for this Double click on line ->.

please help me as this is very urgent , i will reward points if helpfull.

thanks and regards,

prasadnn

1 ACCEPTED SOLUTION

Former Member
0 Kudos

try this..

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_REPID

<b> I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>

FORM <b>USER_COMMAND</b> USING P_UCOMM TYPE SY-UCOMM

P_SELFLD TYPE SLIS_SELFIELD.

CASE P_UCOMM.

<b>WHEN '&IC1'. "Double click</b>

CALL TRANSACTION ....

ENDCASE.

ENDFORM.

4 REPLIES 4

Former Member
0 Kudos

try this..

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_REPID

<b> I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>

FORM <b>USER_COMMAND</b> USING P_UCOMM TYPE SY-UCOMM

P_SELFLD TYPE SLIS_SELFIELD.

CASE P_UCOMM.

<b>WHEN '&IC1'. "Double click</b>

CALL TRANSACTION ....

ENDCASE.

ENDFORM.

Former Member
0 Kudos

hi,

check the below example.

u have to use

form val using user_command like sy-ucomm sel type slis_selfield.

report zalvinteractive1 .

tables : lfa1,ekko,ekpo.

select-options : vendor for lfa1-lifnr.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

end of itab.

data : begin of jtab occurs 0,

ebeln like ekko-ebeln,

aedat like ekko-aedat,

end of jtab.

data : begin of ktab occurs 0,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

end of ktab.

type-pools : slis.

data : repid like sy-repid.

data :lfa1_b type slis_t_fieldcat_alv,

lfa1_w type slis_fieldcat_alv,

ekko_b type slis_t_fieldcat_alv,

ekko_w type slis_fieldcat_alv,

ekpo_b type slis_t_fieldcat_alv,

ekpo_w type slis_fieldcat_alv,

events_b type slis_t_event,

events_w type slis_alv_event.

perform get_val.

repid = sy-repid.

select lifnr name1 from lfa1 into table itab where lifnr in vendor.

*perform val USING USER_COMMAND sel.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = repid

it_fieldcat = lfa1_b

it_events = events_b

tables

t_outtab = itab.

&----


*& Form GET_VAL

&----


  • text this is to put column headings

----


form get_val.

lfa1_w-fieldname = 'LIFNR'.

lfa1_w-ref_tabname = 'LFA1'.

lfa1_w-ref_fieldname = 'LIFNR'.

append lfa1_w to lfa1_b.

lfa1_w-fieldname = 'NAME1'.

lfa1_w-ref_tabname = 'LFA1'.

lfa1_w-ref_fieldname = 'NAME1'.

append lfa1_w to lfa1_b.

ekko_w-fieldname = 'EBELN'.

ekko_w-ref_tabname = 'EKKO'.

ekko_w-ref_fieldname = 'EBELN'.

append ekko_w to ekko_b.

ekko_w-fieldname = 'AEDAT'.

ekko_w-ref_tabname = 'EKKO'.

ekko_w-ref_fieldname = 'AEDAT'.

append ekko_w to ekko_b.

ekpo_w-fieldname = 'EBELP'.

ekpo_w-ref_tabname = 'EKPO'.

ekpo_w-ref_fieldname = 'EBELP'.

append ekpo_w to ekpo_b.

ekpo_w-fieldname = 'MATNR'.

ekpo_w-ref_tabname = 'EKPO'.

ekpo_w-ref_fieldname = 'MATNR'.

append ekpo_w to ekpo_b.

events_w-name = 'USER_COMMAND'.

events_w-form = 'VAL'.

append events_w to events_b.

endform. "GET_VAL

&----


*& Form VAL

&----


  • text

----


  • -->USER_COMMANtext

  • -->SEL text for retrieving data

----


form val using user_command like sy-ucomm sel type slis_selfield.

data : ven(10) type n,

po(10) type n.

data : mat(10) type c.

if sel-fieldname = 'LIFNR'.

ven = sel-value.

select ebeln aedat from ekko into table jtab where lifnr = ven.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = repid

  • I_STRUCTURE_NAME = EKKO_B

it_fieldcat = ekko_b

it_events = events_b

tables

t_outtab = jtab.

endif.

if sel-fieldname = 'EBELN'.

po = sel-value.

select ebelp matnr from ekpo into table ktab where ebeln = po.

call function 'REUSE_ALV_POPUP_TO_SELECT'

exporting

i_title = 'ITEM DETAILS'

i_tabname = 'EKPO'

it_fieldcat = ekpo_b

i_callback_program = repid

importing

es_selfield = sel

tables

t_outtab = ktab.

endif.

  • logic to select a record

if sel-fieldname = 'MATNR'.

mat = sel-value.

set parameter id 'MAT' field mat.

call transaction 'MM02' and skip first screen.

endif.

endform. "VAL

Former Member
0 Kudos

Write a sub routine for user_command

and in that do the following

1) Get the parameter id of the field to be double clicked

Then pass the required thing in the below code

& Form user_command----


FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN '&IC1'.

READ TABLE IT_EKPO INDEX RS_SELFIELD-TABINDEX.

SET PARAMETER ID 'BES' FIELD IT_EKPO-EBELN.

CALL TRANSACTION 'ME23N'.

ENDCASE.

ENDFORM.

If Helpful Reward Points

Arpit

Former Member
0 Kudos

hi,

simple chk this link.

code is there.

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

Rgds

Reshma