HOTSPOT in ALV?
Moderators: Snowy, thx4allthefish, YuriT, Gothmog
HOTSPOT in ALV?
Hi,
Is it possible to use 'HOTSPOT' in ALV reports? I would like to go to a particular transaction from the ALV report when I click on a particular field.
Thanks for the help.
Naveen
Is it possible to use 'HOTSPOT' in ALV reports? I would like to go to a particular transaction from the ALV report when I click on a particular field.
Thanks for the help.
Naveen
Thomas,
I'm also currently trying to use hotspot in my ALV report. And I tried the solution you gave in your earlier post, but I keep getting syntax error.
I already have a variable w_grid declared earlier for the grid title, and I have put together the function REUSE_ALV_FIELDCATALOG_MERGE and REUSE_ALV_GRID_DISPLAY in a customer function.
I also do not see the PBO in my program? Do I need to create it?
Basically, here's what i did in the program:
----
End-of-selection.
perform display_report.
form display_report.
call function 'Z_ALV_DISPLAY'
(parameters/tables for 2 std func above)
endform.
----
Thanks for your help.
Nixter
I'm also currently trying to use hotspot in my ALV report. And I tried the solution you gave in your earlier post, but I keep getting syntax error.
I already have a variable w_grid declared earlier for the grid title, and I have put together the function REUSE_ALV_FIELDCATALOG_MERGE and REUSE_ALV_GRID_DISPLAY in a customer function.
I also do not see the PBO in my program? Do I need to create it?
Basically, here's what i did in the program:
----
End-of-selection.
perform display_report.
form display_report.
call function 'Z_ALV_DISPLAY'
(parameters/tables for 2 std func above)
endform.
----
Thanks for your help.
Nixter
Currently, there are two approachs for displaying an ALV grid.
You can use OO methodology using a screen, PBO, PAI and create and object of type cl_gui_alv_grid.
The other way is just using classic ABAP with a call function 'REUSE_ALV_GRID_DISPLAY' that do not need a screen.
I can't tell you for the moment which method is the best or if there are some restrictions for one method.
I'll try to have a look at hotspot in classic ABAP and tell you more.
Regards,
Thomas.
You can use OO methodology using a screen, PBO, PAI and create and object of type cl_gui_alv_grid.
The other way is just using classic ABAP with a call function 'REUSE_ALV_GRID_DISPLAY' that do not need a screen.
I can't tell you for the moment which method is the best or if there are some restrictions for one method.
I'll try to have a look at hotspot in classic ABAP and tell you more.
Regards,
Thomas.
I found the way to manage hotspot with function 'REUSE_ALV_GRID_DISPLAY' :
1) If not yet done, declare type group :
2) Declare callback program and callback subroutine. SAP must know which subroutine of which program must be executed when clicking on a hotspot of an ALV grid :
3) Assign value to those two variables before calling ALV grid :
(or any other subroutine name but in upper case)
4) Define subroutine handling double-click :
5) Call ALV grid function :
N.B. : don't forget in your catalog to set field 'hotspot' to 'X' for the desired field.
Regards,
Thomas.
1) If not yet done, declare type group :
Code: Select all
TYPE-POOLS: slis.
Code: Select all
data : w_callback_subroutine TYPE slis_formname,
w_callback_program LIKE sy-repid.
Code: Select all
w_callback_program = sy-repid.
w_callback_subroutine = 'USER_COMMAND'.
4) Define subroutine handling double-click :
Code: Select all
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN '&IC1'. " SAP standard code for double-clicking
SET PARAMETER ID 'XXX' FIELD p_selfield-value.
CALL TRANSACTION 'YYYY'.
ENDCASE.
ENDFORM.
Code: Select all
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_callback_program
it_fieldcat = it_fieldcat
i_callback_user_command = w_callback_subroutine
TABLES
t_outtab = it_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
Regards,
Thomas.
HotSpot in ALV Report using Class-method
Hello,
Can anybody tell me how to code for getting Hotspot in ALV Report, if the Code for ALV is done in Class-Method concept ?
If possible let me know the sample code....
Thanks in Advance...
Regards
Arun Prasath
Can anybody tell me how to code for getting Hotspot in ALV Report, if the Code for ALV is done in Class-Method concept ?
If possible let me know the sample code....
Thanks in Advance...
Regards
Arun Prasath
-
- Posts: 6955
- Joined: Thu Mar 25, 2004 11:29 am
- Location: Airstrip One
Hot-spot in ALV with 2 tables
Hi
I am using classic ABAP to display 2 internal tables in an ALV report. Previously I had only 1 table in this report and I was able to use hotspots no problem.
Now with the 2 tables, I get a short dump error (GETWA_NOT_ASSIGNED) when clicking on a hotspot.
The error occurs in program "SAPLSALV" in the "USER_COMMAND" form at line 1292 (see extract below). It does not even get as far as the "USER_COMMAND" form in my Z-program.
I have had this error before and the problem was with my field catalog, but I resolved the issue. Could the error this time also have something to do with the field catalog?
At the very least, could someone please provide me with an example of a simple ALV program displaying 2 tables with hot-spot functionality on both tables? I can try and work out what I am doing wrong if I have a working example to refer to.
Thanks
ES
Source Code Extract from short dump.
1262 if sy-subrc ne 0.
1263 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
1264 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
1265 endif.
1266
1267 IF GS_STATUS-FLG_CHECKBOXES_ACTIVE = 'X'.
1268 *
1269 CALL FUNCTION 'K_KKB_MARK_INFO_GET'
1270 IMPORTING
1271 ET_ROWMARK = LT_ROWMARK.
1272 DO GS_STATUS-COUNTER_OF_LISTS_ADDED TIMES.
1273 L_INDEX = SY-INDEX.
1274 READ TABLE GT_STACK INDEX L_INDEX.
1275 IF SY-SUBRC NE 0. MESSAGE X000(0K). ENDIF.
1276 *
1277 CASE L_INDEX.
1278 WHEN 1.
1279 IF GT_STACK-ITEM_TABNAME IS INITIAL.
1280 ASSIGN GT_DUMMY[] TO <ITEM_TABLE01>.
1281 ASSIGN GT_DUMMY TO <ITEM_TABLE01_WA>.
1282 ENDIF.
1283 PERFORM E10_CHECKBOX_FILL
1284 TABLES
1285 <HEADER_TABLE01>
1286 <ITEM_TABLE01>
1287 USING
1288 GT_STACK
1289 LT_ROWMARK[]
1290 <HEADER_TABLE01_WA>
1291 <ITEM_TABLE01_WA>.
>>>> WHEN 2.
1293 IF GT_STACK-ITEM_TABNAME IS INITIAL.
1294 ASSIGN GT_DUMMY[] TO <ITEM_TABLE02>.
I am using classic ABAP to display 2 internal tables in an ALV report. Previously I had only 1 table in this report and I was able to use hotspots no problem.
Now with the 2 tables, I get a short dump error (GETWA_NOT_ASSIGNED) when clicking on a hotspot.
The error occurs in program "SAPLSALV" in the "USER_COMMAND" form at line 1292 (see extract below). It does not even get as far as the "USER_COMMAND" form in my Z-program.
I have had this error before and the problem was with my field catalog, but I resolved the issue. Could the error this time also have something to do with the field catalog?
At the very least, could someone please provide me with an example of a simple ALV program displaying 2 tables with hot-spot functionality on both tables? I can try and work out what I am doing wrong if I have a working example to refer to.
Thanks
ES
Source Code Extract from short dump.
1262 if sy-subrc ne 0.
1263 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
1264 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
1265 endif.
1266
1267 IF GS_STATUS-FLG_CHECKBOXES_ACTIVE = 'X'.
1268 *
1269 CALL FUNCTION 'K_KKB_MARK_INFO_GET'
1270 IMPORTING
1271 ET_ROWMARK = LT_ROWMARK.
1272 DO GS_STATUS-COUNTER_OF_LISTS_ADDED TIMES.
1273 L_INDEX = SY-INDEX.
1274 READ TABLE GT_STACK INDEX L_INDEX.
1275 IF SY-SUBRC NE 0. MESSAGE X000(0K). ENDIF.
1276 *
1277 CASE L_INDEX.
1278 WHEN 1.
1279 IF GT_STACK-ITEM_TABNAME IS INITIAL.
1280 ASSIGN GT_DUMMY[] TO <ITEM_TABLE01>.
1281 ASSIGN GT_DUMMY TO <ITEM_TABLE01_WA>.
1282 ENDIF.
1283 PERFORM E10_CHECKBOX_FILL
1284 TABLES
1285 <HEADER_TABLE01>
1286 <ITEM_TABLE01>
1287 USING
1288 GT_STACK
1289 LT_ROWMARK[]
1290 <HEADER_TABLE01_WA>
1291 <ITEM_TABLE01_WA>.
>>>> WHEN 2.
1293 IF GT_STACK-ITEM_TABNAME IS INITIAL.
1294 ASSIGN GT_DUMMY[] TO <ITEM_TABLE02>.