11-28-2011 7:01 AM
hi experts .
i am retriving details form kna1 and vbak table using common column kunnr in alv grdi format .after data is retrived i want when user click on value of netwr it display Sales Order Details (List of Sales Orders) from VBAK table using interactive report format. so please help me write code to above solution.
Moderator message : Spec dumping not allowed, read forum rules before posting. Thread locked.
Edited by: Vinod Kumar on Nov 28, 2011 1:34 PM
11-28-2011 7:37 AM
Hi,
Use CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
In this FM in EXPORTING use parameter " i_callback_user_command".
e.g i_callback_user_command= 'USER_COMMAND'.
Now define a FORM as
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE rs_selfield-fieldname. "this will capture the field on which you clicked
when 'VBELN'.
"SOMETHING SHOULD HAPPEN say sales order details fetched into table it_sales.
when 'LIFNR'.
"SOMETHING SHOULD HAPPEN
ENDCASE.
Now again use CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' and provide value as it_sales for parameter "t_outtab"
ENDFORM. "user_command