Skip to Content
author's profile photo Former Member
Former Member

alv hotspot event

Hi guys ,

I have created an ALV report using the CAll function " REUSE alv grid display "

I want the functionality that on double clicking the doc nr ( belnr of table bseg ) the doc should open .

I have found the folowing cod from sdn

FORM dis_data.

g_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'Interactive ALV'

it_fieldcat = fcat

it_events = eve

TABLES

t_outtab = itab

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.

ENDFORM. "dis_data

FORM user_command USING u_com LIKE sy-ucomm sel_field TYPE slis_selfield.

CLEAR fcat1.

CASE u_com.

WHEN '&IC1'.

READ TABLE itab INDEX sel_field-tabindex.

IF sy-subrc = 0.

t_doc = itab-vbeln.

SET PARAMETER ID 'AUN' FIELD t_doc.

CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM. "user_command

In the above code there is an event eve .. does someone kno what is this. also what is t_doc here .

Which parameter id should i set .

Thanks & Regards

Ashish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 07:36 AM

    Hi Ashish,

    let's go step by step:

    1. "eve" is an internal table that holds the list events you would like to handle. A typical example could be:

      DATA: eve         TYPE slis_t_event.
      DATA: le_events   TYPE slis_alv_event.
    
      le_events-name = 'TOP_OF_PAGE'.
      le_events-form = 'PRINT_TOP'.
      APPEND le_events TO eve.
    
      le_events-name = 'END_OF_LIST'.
      le_events-form = 'PRINT_SELECTIONS'.
      APPEND le_events TO eve.
    

    ...where PRINT_TOP and PRINT_SELECTIONS are FORMs that carry out some headers and some footers of the listing.

    2. "t_doc" seems to me to be a variable that stores a sales document number (VBELN), which is then passed to a SET/GET parameter 'AUN'.

    I strongly recommend you to have a llok at the documentation of the parameters of function module REUSE_ALV_GRID_DISPLAY, it is VERY complete and helpful.

    I hope this helps. Best regards,

    Alvaro

    Add a comment
    10|10000 characters needed characters exceeded

    • By default Double-click give r_ucomm = '&IC1'. in user_command form. You can change this value when calling REUSE_ALV_GRID_DISPLAY in field F2CODE of parameter IS_LAYOUT, if not don't forget to clear r_ucomm after your code. Double-click is so frequent that it is managed in Function Miodule parameter, you don't need to manage events for this one.

      To call FB03 (display accounting document) use parameter id BLN for BELNR doc. nr, BUK for BUKRS society and GJR for GJAHR year. (Call FB03 and press F1 then F9 on parameter fields to find the parameter id).

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 08:10 AM

    Parameter for BELNR is BLN

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 07:31 AM

    Hi,

    Please refer to the link below :

    http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm

    Thanks,

    Sri,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.