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: 

Calling the T code from the reprt

Former Member
0 Kudos

Hi,

I am displaying the list of materials.if the user clicks on the particular material. The material number shd copy in MM03 Tcode intial screen and the user can see full details of the material.

<<removed_by_moderator>>

Regards,

Rasheed.

Edited by: Vijay Babu Dudla on Jan 28, 2009 1:03 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can try this code,

Here wa_tab-matnr is the field you are displaying and w_cursor is a variable of type matnr.


AT LINE-SELECTION.
  GET CURSOR FIELD wa_tab-matnr VALUE w_cursor.
  SET PARAMETER ID 'MAT' FIELD w_cursor.
  CALL TRANSACTION 'MM03'.

Note that if you want to use skip first screen you have to choose views,

and if you want to make that also use a simple bdc.

Regards,

Manoj Kumar P

Edited by: Manoj Kumar on Jan 28, 2009 7:46 AM

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos

Use this.


SET PARAMETER ID 'MAT' FIELD itab-matnr .

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

Former Member
0 Kudos

Hi,

If u are using alv to display the materials, then the below piece of code will help u.

In FM, use user command.


**Calling the function module for ALV Grid
 call function 'REUSE_ALV_GRID_DISPLAY'
 exporting
   i_callback_program                = sy-repid
   is_layout                         =  it_layout
   i_callback_user_command           = 'USERCOMMAND'
   it_fieldcat                       =  it_fieldcat[]
   i_save                            = 'A'
   is_variant                        = v_variant
  tables
    t_outtab                          = it_final
 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.

In form usercommand,



**For navigating the screen.
form usercommand using ucomm type sy-ucomm
                    selfield type slis_selfield.
  case ucomm.

    when '&IC1'.
     if selfield-fieldname = 'MATNR'.
      set parameter id 'MAT'  field selfield-value.
      call transaction 'MM03' and skip first screen.
    endif.
  endcase.

endform.

Hope this helps u.

Thanks.

Former Member
0 Kudos

Hi,

Use TRANSACTION 'MM01'.

Thanks and Regards.

Former Member
0 Kudos

Hi,

You can try this code,

Here wa_tab-matnr is the field you are displaying and w_cursor is a variable of type matnr.


AT LINE-SELECTION.
  GET CURSOR FIELD wa_tab-matnr VALUE w_cursor.
  SET PARAMETER ID 'MAT' FIELD w_cursor.
  CALL TRANSACTION 'MM03'.

Note that if you want to use skip first screen you have to choose views,

and if you want to make that also use a simple bdc.

Regards,

Manoj Kumar P

Edited by: Manoj Kumar on Jan 28, 2009 7:46 AM

0 Kudos

Hi Manoj,

Can I use the same code for MM01 also.

If i am doing that its not working.

Regards

0 Kudos

Hi,

Yes you can, but make sure that the material number does not exist already.

Regards,

Manoj Kumar P

0 Kudos

Hi

We cant have same code for MM01 also.

we shd write small BDC to input the desired matnr in MM01.

Any have my problem was sloved thanks for all for the inputs

Regards