‎2005 May 18 6:18 PM
Hi Friends,
I want to build a report based on <b>ALVs</b> and also like a <b>Interactive reports</b>.
Eg: First I want to display customer details in first <b>ALV Grid</b>. IF the user click on the <b><u>Cust No</u></b> the next screen should shown the <b>order headers</b> of that <b>customers</b>, when the user click on <u><b>Order No</b></u> in this screen I want to display in the next screen with the details of that <b>Sales orders</b>.
Here I m having the doubts where I have to <u><b>Hide the Cust No or Order No</b></u>. Where I have to use
<b>AT LINE-SELECTION</b> command. In each screen is necessary to call the Function Module <b>REUSE_ALV_GRID_DISPLAY</b>.
Plz send me asap.
Regards
Praveen Kumar
‎2005 May 19 4:33 AM
Hi,
If u want to call a transaction when the user double clicks on cust no and order no.
DATA: event_receiver TYPE REF TO lcl_event_receiver.
CLASS LCL_EVENT_RECEIVER DEFINITION.
Event receiver definitions for ALV actions
PUBLIC SECTION.
CLASS-METHODS:
Row Double click for dirll down.
HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW
E_COLUMN
ES_ROW_NO.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
----
GRID: HANDLE_HOTSPOT
----
Hotsport
----
METHOD handle_double_click.
PERFORM F9007_HANDLE_DOUBLE_CLICK USING E_ROW_ID
E_COLUMN_ID
ES_ROW_NO.
ENDMETHOD.
ENDCLASS.
FORM F9007_HANDLE_DOUBLE_CLICK USING P_ROW
P_COLUMN
P_ROW_NO.
DATA: lw_output LIKE LINE OF i_output. "Output table
CLEAR lw_output.
READ TABLE i_output INDEX p_row INTO lw_output.
CASE p_column .
WHEN 'custno'.
IF NOT lw_output-vbeln1 IS INITIAL .
SET PARAMETER ID 'XXX' FIELD lw_output-custno .
<b> CALL TRANSACTION c_transaction_call_nameoftrans AND SKIP FIRST SCREEN</b> .
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDFORM. " F9007_HANDLE_DOUBLE_CLICK
If this is ur requirement then no need to call the Function Module REUSE_ALV_GRID_DISPLAY again.
<b>If u want to call a transcation by pressing a button in the menu bar then do it as
In PAI.</b>
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
perform.............
LEAVE PROGRAM.
WHEN 'BACK'.
perform.............
SET SCREEN '0'.
WHEN 'DISP'.DISP is the function code for the button in menu bar.
lv_bukrs = w_output-cusno.
SET PARAMETER ID 'XXX' FIELD lv_bukrs.
CALL TRANSACTION c_transaction_call_ AND SKIP FIRST SCREEN .
WHEN OTHERS.
ENDCASE.
Clear: lv_bukrs.
Thanks & Regards,
Judith.
‎2005 May 18 8:10 PM
YOu can achive this by populating the field I_CALLBACK_USER_COMMAND in the final function module, used to display the list. This field should be assigned a FORM name. THis form will be executed when the user clicks a field on the screen.
THis form imports two parameters namely sy-ucomm and SELFIELD of type SLIS_SELFIELD. this field contains the details of the list selected. check the below code for your reference... the below code will navigate to Sales Order display.
report test.
type-pools : slis.
data : itab_events type slis_t_Event with header line,
it_output like vbak occurs 0 with header line,
itab_fldcat type SLIS_T_FIELDCAT_ALV.
data : v_Repid type sy-repid,
WA_FLDCAT TYPE SLIS_FIELDCAT_ALV .
start-of-selection.
v_repid = sy-repid.
select * from vbak into table it_output.
if sy-subrc = 0.
sort it_output by vbeln.
endif.
Field the field catalog
WA_FLDCAT-TABNAME = 'IT_OUTPUT'.
wa_fldcat-fieldname = 'VBELN'.
WA_FLDCAT-SELTEXT_M = 'Sales Document' .
WA_FLDCAT-COL_POS = 1 .
WA_FLDCAT-DDICTXT = 'M'.
WA_FLDCAT-KEY = 'X'.
WA_FLDCAT-HOTSPOT = 'X'.
append wa_fldcat to itab_fldcat.
clear wa_fldcat.
wa_fldcat-fieldname = 'AUART'.
WA_FLDCAT-TABNAME = 'IT_OUTPUT'.
WA_FLDCAT-SELTEXT_M = 'Order Type' .
WA_FLDCAT-COL_POS = 2 .
WA_FLDCAT-DDICTXT = 'M'.
append wa_fldcat to itab_fldcat.
clear wa_fldcat.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'FRM_ALV_USER_COMMAND'* I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = ITAB_FLDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = ITAB_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = it_output
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.
form frm_alv_user_command USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
case ucomm.
when '&IC1'.
IF SELFIELD-TABNAME = 'IT_OUTPUT'.
IF SELFIELD-FIELDNAME = 'VBELN'.
read table it_output index SELFIELD-TABINDEX.
if sy-subrc = 0.
SET PARAMETER ID 'AUN' FIELD IT_OUTPUT-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
endif.
endif.
endif.
endcase.
endform.
The UCOMM will always contain '&IC1'.
Use this code, should help you.
Coutesy : SDN Forum
Manohar
‎2005 May 19 6:47 PM
Hi Mano Sri
But this code not working. Its not generating next screen. Just it is in first screen only. Plz rectify it and send me asap.
Thanks
Praveen Kumar
‎2005 May 20 4:28 AM
‎2005 May 19 4:33 AM
Hi,
If u want to call a transaction when the user double clicks on cust no and order no.
DATA: event_receiver TYPE REF TO lcl_event_receiver.
CLASS LCL_EVENT_RECEIVER DEFINITION.
Event receiver definitions for ALV actions
PUBLIC SECTION.
CLASS-METHODS:
Row Double click for dirll down.
HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW
E_COLUMN
ES_ROW_NO.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
----
GRID: HANDLE_HOTSPOT
----
Hotsport
----
METHOD handle_double_click.
PERFORM F9007_HANDLE_DOUBLE_CLICK USING E_ROW_ID
E_COLUMN_ID
ES_ROW_NO.
ENDMETHOD.
ENDCLASS.
FORM F9007_HANDLE_DOUBLE_CLICK USING P_ROW
P_COLUMN
P_ROW_NO.
DATA: lw_output LIKE LINE OF i_output. "Output table
CLEAR lw_output.
READ TABLE i_output INDEX p_row INTO lw_output.
CASE p_column .
WHEN 'custno'.
IF NOT lw_output-vbeln1 IS INITIAL .
SET PARAMETER ID 'XXX' FIELD lw_output-custno .
<b> CALL TRANSACTION c_transaction_call_nameoftrans AND SKIP FIRST SCREEN</b> .
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDFORM. " F9007_HANDLE_DOUBLE_CLICK
If this is ur requirement then no need to call the Function Module REUSE_ALV_GRID_DISPLAY again.
<b>If u want to call a transcation by pressing a button in the menu bar then do it as
In PAI.</b>
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
perform.............
LEAVE PROGRAM.
WHEN 'BACK'.
perform.............
SET SCREEN '0'.
WHEN 'DISP'.DISP is the function code for the button in menu bar.
lv_bukrs = w_output-cusno.
SET PARAMETER ID 'XXX' FIELD lv_bukrs.
CALL TRANSACTION c_transaction_call_ AND SKIP FIRST SCREEN .
WHEN OTHERS.
ENDCASE.
Clear: lv_bukrs.
Thanks & Regards,
Judith.
‎2005 May 19 7:50 AM