HOTSPOT in ALV?

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Guest

HOTSPOT in ALV?

Post by Guest » Sun Feb 16, 2003 7:01 pm

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

sat

Post by sat » Mon Feb 17, 2003 12:37 am

Hi,

Its possible. In field cat put HOTSPOT = 'X' on that particular field.

bye

sat...

Thomas C.
Posts: 83
Joined: Wed Jan 22, 2003 5:26 am
Location: Belgium
Contact:

Post by Thomas C. » Mon Feb 17, 2003 6:16 am

There's a wonderful tool in this forum called Search.

You enter in 'Search for Keywords' : 'alv AND hospot' and it returns you a number of messages.

Try the one called "alv hotpost". I've given a detailled way for handling hotspot in ALV grid.

Regards,
Thomas

Nixter
Posts: 19
Joined: Thu Feb 06, 2003 10:10 pm
Location: Malaysia
Contact:

Post by Nixter » Tue Feb 18, 2003 11:23 am

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

Thomas C.
Posts: 83
Joined: Wed Jan 22, 2003 5:26 am
Location: Belgium
Contact:

Post by Thomas C. » Wed Feb 19, 2003 2:00 am

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.

Thomas C.
Posts: 83
Joined: Wed Jan 22, 2003 5:26 am
Location: Belgium
Contact:

Post by Thomas C. » Wed Feb 19, 2003 3:41 am

I found the way to manage hotspot with function 'REUSE_ALV_GRID_DISPLAY' :

1) If not yet done, declare type group :

Code: Select all

TYPE-POOLS: slis.
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 :

Code: Select all

data : w_callback_subroutine TYPE slis_formname,
       w_callback_program LIKE sy-repid.
3) Assign value to those two variables before calling ALV grid :

Code: Select all

w_callback_program    = sy-repid.
w_callback_subroutine = 'USER_COMMAND'. 
(or any other subroutine name but in upper case)

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.
5) Call ALV grid function :

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.
N.B. : don't forget in your catalog to set field 'hotspot' to 'X' for the desired field.

Regards,
Thomas.

Nixter
Posts: 19
Joined: Thu Feb 06, 2003 10:10 pm
Location: Malaysia
Contact:

Post by Nixter » Thu Feb 20, 2003 12:07 am

I'm using the classic abap with func call, and your codes works perfectly. I'm now able to proceed after clicking the hotspot. Appreciate the help.

Thanks.
Nixter

arundgr8
Posts: 4
Joined: Mon Feb 26, 2007 5:23 am
Location: Bangalore, India
Contact:

HotSpot in ALV Report using Class-method

Post by arundgr8 » Wed May 02, 2007 4:11 pm

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

abap_doctor
Posts: 6955
Joined: Thu Mar 25, 2004 11:29 am
Location: Airstrip One

Post by abap_doctor » Thu May 03, 2007 2:04 am

1. Take a look at BCALV* ABAPs for hints and tips...
2. Search SAPFans for previous answers
3. Take a look at the ABAP FAQ
The Doc
Tuly Idiot Magna Grand Docot Image

bender442
Posts: 7
Joined: Tue May 03, 2005 6:28 am
Location: South Africa

Hot-spot in ALV with 2 tables

Post by bender442 » Tue Sep 11, 2007 5:14 am

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>.

Post Reply