Application Development 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: 

Dubble click and go to transaction.

Former Member
0 Kudos

Hello experts,

When i make dubble click on field 'VBEln' in my alv , i want to go the vl02n transaction with this delivery and skip first screen.

How can i do this ?

Thanks for the help.

Avi.

9 REPLIES 9

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you using the function module, or a class for the ALV grid?

Regards,

Rich Heilman

0 Kudos

Hello,

I use F.M to alv.

Thanks,

Avi.

0 Kudos

So if using the FM, you will want to do something like this. You need to declare the handling form routine when calling the REUSE function, and then have a form named the same, with the code which will fire the CALL TRANSACTION.

data: ifc type slis_t_fieldcat_alv.
  data: xfc type slis_fieldcat_alv.
  data: repid type sy-repid.

  repid = sy-repid.

  clear xfc. refresh ifc.

  clear xfc.
  xfc-reptext_ddic = 'Material Number'.
  xfc-fieldname    = 'MATNR'.
  xfc-tabname      = 'ITAB'.
  xfc-outputlen    = '18'.
  append xfc to ifc.

  clear xfc.
  xfc-reptext_ddic = 'Material Description'.
  xfc-fieldname    = 'MAKTX'.
  xfc-tabname      = 'ITAB'.
  xfc-outputlen    = '40'.
  append xfc to ifc.

* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = repid
            i_callback_user_command = 'HANDLE_USER_COMMAND'
            it_fieldcat             = ifc
       tables
            t_outtab                = itab.


***********************************************************************
*       FORM handle_User_Command                                      *
***********************************************************************
form handle_user_command using r_ucomm     like sy-ucomm
                               rs_selfield type slis_selfield.

  case r_ucomm.
    when '&IC1'.

    case rs_selfield-FIELDNAME.
      when 'MATNR'.
         set parameter id 'MAT' field rs_selfield-value.
         call transaction 'MD04' and skip first screen.


      endcase.


  endcase.

endform.

Regards,

Rich Heilman

0 Kudos

Thanks for yhe help,

What is paramater ID for 'VBELN' and 'MBLNR' ?

Thanks,

Avi.

0 Kudos

Do F1 help on the field while in the transaction, it will tell you.

REgards,

Rich Heilman

0 Kudos

hi,

its a simple question and u must search it but for ur assistant press F1 on any field and u can get the parameter id

here the parameter for vbeln its AUN and for MBLNR its MBN .

thanks

shivraj

Edited by: ShivrajSinha on Feb 10, 2010 10:17 AM

Former Member
0 Kudos

hi,

you can capture the double click event and the value on that field.

set parameter id.

then call transaction 'VL02' and skip first screen.

regards,

sakshi

former_member226519
Active Contributor
0 Kudos

create a form routine UCOMM_CHECK using VAR1(user command) VAR2 type SLIS_SELFIELD.

user commanddouble click is &IC1

VAR 2 contains row and col

CALL TRANSACTION xyz and skip first screen

And you will have to pass the name of your form routine to the ALV function module in parameter I_CALLBACK_USER_COMMAND = 'MY_FORM'

0 Kudos

it works for us with purchase orders like this if this sample code will help you...

*&----


*

*& Form user_command

*&----


*

  • text

*----


*

  • -->R_UCOMM text

  • -->RS_SELFIELD text

*----


*

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

SAV_INDEX = RS_SELFIELD-TABINDEX.

READ TABLE INT INDEX SAV_INDEX.

  • get cursor field fieldname value fieldvalue.

FIELDNAME = RS_SELFIELD-SEL_TAB_FIELD.

FIELDVALUE = RS_SELFIELD-VALUE.

IF SAV_INDEX >= 1.

IF FIELDNAME CS 'EBELN'.

SET PARAMETER ID 'BES' FIELD int-ebeln.

SET PARAMETER ID 'BSP' FIELD int-ebelp.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

  • PERFORM BDC_SCREEN USING 'SAPMM06E' '0105'.

      • to je izbral

  • PERFORM BDC_FIELD USING 'RM06E-BSTNR' FIELDVALUE.

      • pa ¹e druge parametre

    • PERFORM bdc_field USING 'RF02D-VKORG' int-vkorg.

    • PERFORM bdc_field USING 'RF02D-VTWEG' int-vtweg.

    • PERFORM bdc_field USING 'RF02D-SPART' int-spart.

      • ¹e zalon

    • PERFORM bdc_field USING 'RF02D-D0110' 'X'.

*

      • pritisni enter

  • PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.

*

  • CALL TRANSACTION 'ME23' USING BDC_DATA MODE 'E'.

REFRESH BDC_DATA.

ENDIF.

ENDIF.

ENDFORM. "user_command