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: 

jump to three transaction

Former Member
0 Kudos

hello experts,

i am creating a interactive alv report

in which when i click on colum 1of report it should take me to diffrreent trannsaction like mb52 and if click on coulmn 2

it should take me on different transaction like mmbe.

in short i need a example which read cusor postion of coulme and take me to different screen.

4 REPLIES 4

Former Member
0 Kudos

Hi,

DATA : F(18), OFF TYPE I, VAL(18).

CLEAR T_BDCDATA.

REFRESH T_BDCDATA.

CLEAR V_VALUE.

GET CURSOR FIELD F OFFSET OFF

VALUE VAL.

V_VALUE = VAL.

CONDENSE V_VALUE.

T_BDCDATA-PROGRAM = RM07MLBS'.

T_BDCDATA-DYNPRO = '1000.

T_BDCDATA-DYNBEGIN = 'X'.

T_BDCDATA-FNAM = 'MATNR-LOW'.

T_BDCDATA-FVAL = V_VALUE.

APPEND T_BDCDATA.

CLEAR T_BDCDATA.

T_BDCDATA-FNAM = 'BDC_OKCODE'.

T_BDCDATA-FVAL = '/00'.

APPEND T_BDCDATA.

CLEAR T_BDCDATA.

CALL TRANSACTION 'MB52'.

CLEAR V_VALUE.

Thanks,

Pranav

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Mar 19, 2008 5:31 PM

Former Member
0 Kudos

This will do.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_callback_user_command = 'PROCESS_USER_COMMANDS'

is_layout = w_layout

it_fieldcat = i_fieldcat[]

it_sort = gt_sort[]

i_default = 'X'

i_save = 'A'

it_events = v_events

is_print = w_print

TABLES

t_outtab = i_final1

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM process_user_commands USING syst-ucomm LIKE syst-ucomm

selfield TYPE slis_selfield.

CASE syst-ucomm.

WHEN '&IC1'.

IF selfield-sel_tab_field = 'I_FINAL1-VBELN'.

w_vbeln = selfield-value.

SET PARAMETER ID: 'VL' FIELD w_vbeln.

CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.

ELSEIF selfield-sel_tab_field = 'I_FINAL1-ORDER'.

v_vbeln = selfield-value.

SET PARAMETER ID: 'AUN' FIELD v_vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

endif.

endform.

raymond_giuseppi
Active Contributor
0 Kudos

Assign a USER_COMMAND to your ALV grid/list.

And write the form using this sample

FORM  USER_COMMAND   USING    p_ucomm     LIKE sy-ucomm
                   selfield TYPE slis_selfield.

  CASE p_ucomm.
* If double-click
    WHEN  '&IC1'.
* - Read record selected
       READ TABLE T_ALV_TABLE  INDEX selfield-tabindex.
       IF sy-subrc EQ 0.
* - call transaction depending on field selected
         CASE selfield-fieldname.
         WHEN 'VBELN'.
           if t_alv_table-Vbeln ne ' '.
           SET PARAMETER ID 'AUN' FIELD t_alv_table-vbeln.
             CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
           else.
             MESSAGE e030.
           endif.
         WHEN <other field>
(...)
         ENDCASE.
      WHEN <other functions>
(...)
    endif.
  ENDCASE.

Regards