Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Drill Down ALV Report

Former Member
0 Likes
1,994

One of my columns in ALV Report has PO# Number. If I double click that I should go to ME22N and edit that particular ALV . How to do this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,259

You need to add a form name to the ALV function call for the "USER_COMMAND" event.

Then create that form in your program with the following parameters:

FORM process_user_command

USING

i_ucomm LIKE sy-ucomm

is_selfield TYPE slis_selfield.

ENDFORM.

is_selfield has values telling you which line and field of the report was clicked on. Simple way to see what is there is to put a BREAK-POINT command in the form and run it and try clicking on some fields.

This is documented in the function module documentation for REUSE_ALV_LIST_DISPLAY

Andrew

One of my columns in ALV Report has PO# Number. If I double click that I should go to ME22N and edit that particular ALV . How to do this

7 REPLIES 7
Read only

Former Member
0 Likes
1,260

You need to add a form name to the ALV function call for the "USER_COMMAND" event.

Then create that form in your program with the following parameters:

FORM process_user_command

USING

i_ucomm LIKE sy-ucomm

is_selfield TYPE slis_selfield.

ENDFORM.

is_selfield has values telling you which line and field of the report was clicked on. Simple way to see what is there is to put a BREAK-POINT command in the form and run it and try clicking on some fields.

This is documented in the function module documentation for REUSE_ALV_LIST_DISPLAY

Andrew

Read only

Former Member
0 Likes
1,259

Hi use the below code or for your requirement it should work .

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • Check function code

CASE r_ucomm.

WHEN '&IC1'.

  • Check field clicked on within ALVgrid report

IF rs_selfield-fieldname = 'EBELN'.

  • Read data table, using index of row user clicked on

READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.

  • Sxecute transaction ME22N, and skip initial data entry screen

CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

i_callback_user_command = 'USER_COMMAND'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

  • it_special_groups = gd_tabgroup

it_events = gt_events

is_print = gd_prntparams

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_ekko

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.

Regards,

Srinu reddy

Read only

Former Member
0 Likes
1,259

First you need to set the PO# field as a hotspot in the field catalog. You can do it by setting hotspot = 'X'. Then you need to define a USER_COMMAND routine which will trigger the user action of double clicking the PO# field. Define a fcode (e.g. FCD1) in the GUI status and in the user command routine:

  CASE R_UCOMM.
    WHEN  'FCD1.                      "menubutton
      READ TABLE GT_OUTTAB INDEX RS_SELFIELD-TABINDEX. "cursorposit.
      if sy-subrc = 0.
         CALL TRANSACTION 'ME22N'.
      endif.
  endcase.

Check out SAP sample program BCALV_GRID_02 which demo the double click event.

Reward point if hepful.

Minami

Read only

0 Likes
1,259

I am OOPS concepts in developing the ALV Report . How can i perform the drilldown activity. Thank you.

Read only

0 Likes
1,259

can someone help me the approach to be followed in this one...thank you.

Read only

Former Member
0 Likes
1,259

Hi,

I have gone through some links in sdn related to Drill down oo alv, but still not clear.

1. Can anyone please explain me the Drill down feature

2. Please explain how to implement drill down feature using

object oriented approach in a step by step manner.

Appreciate all the help.

Madan

Read only

0 Likes
1,259

hi..

check this.....

TYPE-POOLS : SLIS.

DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV,

G_EXIT_CAUSED_BY_CALLER,

GS_EXIT_CAUSED_BY_USER TYPE SLIS_EXIT_BY_USER,

G_REPID LIKE SY-REPID.

DATA : GS_VARIANT LIKE DISVARIANT,

G_SAVE.

DATA : GT_EVENTS TYPE SLIS_T_EVENT,

GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,

G_STATUS_SET TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',

G_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',

G_TOP_OF_LIST TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',

G_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST'.

DATA: W_EVENTS TYPE SLIS_ALV_EVENT.

DATA: T_EVENTS TYPE SLIS_T_EVENT.

after calucation i m storing my output in Jtab

PERFORM CREATE_FIELD_CATALOG CHANGING FC_DC.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_BACKGROUND_ID = 'ALV_BACKGROUND'

I_BUFFER_ACTIVE = 'X'

I_CALLBACK_PROGRAM = G_REPID

IS_LAYOUT = GS_LAYOUT

I_SAVE = G_SAVE

IS_VARIANT = GS_VARIANT

IT_EVENTS = GT_EVENTS[]

IT_FIELDCAT = FC_DC

IMPORTING

E_EXIT_CAUSED_BY_CALLER = G_EXIT_CAUSED_BY_CALLER

ES_EXIT_CAUSED_BY_USER = GS_EXIT_CAUSED_BY_USER

TABLES

T_OUTTAB = JTAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

FORM CREATE_FIELD_CATALOG CHANGING FC_DC TYPE SLIS_T_FIELDCAT_ALV.

DATA LS_CAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

LS_CAT-FIELDNAME = 'VBELN'.

LS_CAT-TABNAME = 'JTAB'.

LS_CAT-SELTEXT_M = 'Delivery No'.

LS_CAT-KEY = 'X'.

APPEND LS_CAT TO FC_DC.

CLEAR LS_CAT.

W_EVENTS-NAME = 'USER_COMMAND'.

W_EVENTS-FORM = 'SUB3'.

APPEND W_EVENTS TO gt_EVENTS.

ENDFORM.

FORM SUB3 USING UCOMM LIKE SY-UCOMM FIELDS1 TYPE SLIS_SELFIELD.

READ TABLE JTAB INTO KTAB INDEX FIELDS1-TABINDEX.

SET PARAMETER ID 'VL' FIELD KTAB-VBELN.

CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.

CLEAR KTAB-VBELN.

ENDFORM.

i m doing this for VL03N Transaction......& passed the parameter for delivery no,

same u hv to call me22n & pass the parameter

for PO parameter id is "BES".

Regards,

Arpit.

Edited by: Arpit Shah on Dec 18, 2007 10:24 AM