‎2008 Jul 24 11:09 AM
hi,
i am using a ALV report now i want to make it interactive. as i click on the current page i need to go MIR4 transaction. how can i do it?
please please help on this issue.
‎2008 Jul 24 12:03 PM
to make an alv interactive i did the following steps
try it by yourself then only u can learn dont copy and paste the code
step1: declare an iternal table and work area of the type
data: it_events type standard table of slis_t_alv_events,
wa_events like line of it_data.
step2: use the function module
reuse_alv_get_events
and pass the internal table to the fm so that u will get all the events in an internal table . This internal table will have 2 fields like name and form. In the name field u will have all the names of events like
top_of_page,end_of_page,user_command etc
so what ever event u want to use modify the internal table according it.For example if u want to use user_command.
read the internal table it_events into wa_events with key name eq 'USER_COMMAND'.
after reading the internal table
move 'f_user_command' to wa_events-form.
then modify the internal table according to it
modify it_events from wa_events transporting form.
after this the internal table will have name = USER_COMMAND and
form = 'f_user_command'.
call this form anywhere in the program
form f_user_command using r_ucomm like sy-ucomm
rs_selfield like slis_selfield.
case r_ucomm.
write u r code as appropiate
WHEN '&IC1'.
SET parameter ID 'AUN' FIELD rs_selfield-value.( aun is the parameter id for the field for which u r clicking depending on that select the parameter id)
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
‎2008 Jul 24 11:11 AM
Hi Poonam,
Check this link for sample code:
http://www.sap-img.com/abap/an-interactive-alv-report.htm
Hope this helps you.
Regards,
Chandra Sekhar
‎2008 Jul 24 11:13 AM
‎2008 Jul 24 11:14 AM
hi,
Check the link below for sample code:
http://abapreports.blogspot.com/2008/06/sample-interactive-alv-report-with-at.html
http://www.sap-img.com/abap/an-interactive-alv-report.htm
With luck,
Pritam.
‎2008 Jul 24 11:14 AM
hi,
Refer to the link
http://voiceofabap.blogspot.com/2008/05/interactive-alv-report.html
http://abapreports.blogspot.com/2008/06/sample-interactive-alv-report-with-at.html
Regards
Sumit Agarwal
‎2008 Jul 24 11:33 AM
Hi ,
There is a very easy way to do it.
If you are clicking on the page, for example you are clicking on a particular column, after that you just
CALL TRANSACTION 'XXX' ( Whatever transaction you want)
SKIP INITIAL SCREEN.
That would do the trick.
Regards,
Khan.
‎2008 Jul 24 11:54 AM
where should i write this user command. i mean before alv display or where?
‎2008 Jul 24 11:57 AM
hi this is written in the use command..
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM I_SELFIELD TYPE SLIS_SELFIELD.
CASE F_UCOMM.
WHEN 'DATA.
CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
‎2008 Jul 24 12:05 PM
‎2008 Jul 24 12:11 PM
Check the sample code.
In this example when i click on the sales order number, i am navigation to The transaction VA03.
REPORT ztest_alv.
TYPE-POOLS:slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_field LIKE LINE OF it_fieldcat.
DATA: BEGIN OF it_likp OCCURS 0,
vbeln TYPE likp-vbeln,
END OF it_likp.
wa_field-fieldname = 'VBELN'.
wa_field-tabname = 'IT_LIKP'.
wa_field-hotspot = 'X'.
APPEND wa_field TO it_fieldcat.
SELECT vbeln FROM likp
UP TO 10 ROWS
INTO TABLE it_likp.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_likp
EXCEPTIONS
program_error = 1.
*&---------------------------------------------------------------------*
*& Form user_Command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->UCOMM text
* -->SELFIELD text
*----------------------------------------------------------------------*
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN '&IC1'.
IF selfield-fieldname = 'VBELN'.
SET PARAMETER ID 'VL' FIELD selfield-value.
CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.ENDFORM. "user_Command
‎2008 Jul 24 12:17 PM
Hi,
Its function code value for sy-ucomm which is passed to that FM.
‎2008 Jul 24 11:35 AM
hi check this program..
use CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
in the usercommand ...
http://www.sap-basis-abap.com/abap/to-call-transaction-in-alv.htm
‎2008 Jul 24 12:03 PM
to make an alv interactive i did the following steps
try it by yourself then only u can learn dont copy and paste the code
step1: declare an iternal table and work area of the type
data: it_events type standard table of slis_t_alv_events,
wa_events like line of it_data.
step2: use the function module
reuse_alv_get_events
and pass the internal table to the fm so that u will get all the events in an internal table . This internal table will have 2 fields like name and form. In the name field u will have all the names of events like
top_of_page,end_of_page,user_command etc
so what ever event u want to use modify the internal table according it.For example if u want to use user_command.
read the internal table it_events into wa_events with key name eq 'USER_COMMAND'.
after reading the internal table
move 'f_user_command' to wa_events-form.
then modify the internal table according to it
modify it_events from wa_events transporting form.
after this the internal table will have name = USER_COMMAND and
form = 'f_user_command'.
call this form anywhere in the program
form f_user_command using r_ucomm like sy-ucomm
rs_selfield like slis_selfield.
case r_ucomm.
write u r code as appropiate
WHEN '&IC1'.
SET parameter ID 'AUN' FIELD rs_selfield-value.( aun is the parameter id for the field for which u r clicking depending on that select the parameter id)
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
‎2008 Jul 24 2:20 PM
Hi Poonam,
I've got a few very simple steps for making ALV interactive , so that it calls up a transaction code on user interaction (double click on a field):
After the FM: 'REUSE_ALV_GRID_DISPLAY' do the follwing in ur code:
FORM user_command USING f_ucomm LIKE sy-ucomm i_selfield TYPE slis_selfield.
CHECK f_ucomm = '&IC1 '.
CHECK i_selfield-tabindex > 0.
READ TABLE itab INDEX i_selfield-tabindex.
CHECK sy-subrc = 0.
CHECK NOT itab-kunnr IS INITIAL.
SET PARAMETER ID 'KUN' FIELD itab-kunnr.
SET PARAMETER ID 'BUK' FIELD itab-bukrs.
CALL TRANSACTION 'FD03' AND SKIP FIRST SCREEN.
ENDFORM. "USER_COMMAND
I've used this example from my a code written by myself which works perfectly fine...U can replace ITAB-KUNNR & ITAB_BI-UKRS by your internal table & fields for which u want interactive action to take place....Also plz replace the Tcode: FD03 by your Tcode which u want to call..
Hope it resolves ur problem..
Regards
Ankur Godre