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

calling mm03 from program

Former Member
0 Likes
1,258

hi gurus,

there is a program for displaying material details

when even click on one material number.it should show the mm03 transaction with that matnr

i used interactive, hide, and cal transaction mm03.

i wrote like this

..................

tables : mara.

data : co type sy-tcode value 'mm01'.

types : begin of wa_mara1,

matnr type matnr,

mtart type mtart,

end of wa_mara1,

it_mara1 type standard table of wa_mara1.

data : wa_mara type wa_mara1,

it_mara type it_mara1.

select-options : so_matnr for mara-matnr.

select matnr mtart into table it_mara from mara where matnr in so_matnr.

loop at it_mara into wa_mara.

write 😕 wa_mara-matnr,

Wa_mara-mtart.

hide wa_mara-matnr.

endloop.

at line-selection.

case sy-lsind.

when 1.

leave to transaction co.

endcase.

...........................

but i won't work

please any body help me

thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
851

inplace of

leave to transaction co.

use

SET PARAMETER ID 'MAT' FIELD wa_mara-matnr .
      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

Read only

Former Member
0 Likes
851

Hello


when 1.
  SET PARAMETER ID 'MAT' FIELD wa_mara-matnr.
  CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

Read only

Former Member
0 Likes
851

Hi Dear,

There was a small mistake.

use this.

TABLES : mara.

DATA : co TYPE sy-tcode VALUE 'MM03'.

TYPES : BEGIN OF wa_mara1,

matnr TYPE matnr,

mtart TYPE mtart,

END OF wa_mara1,

it_mara1 TYPE STANDARD TABLE OF wa_mara1.

DATA : wa_mara TYPE wa_mara1,

it_mara TYPE it_mara1.

SELECT-OPTIONS : so_matnr FOR mara-matnr.

SELECT matnr mtart INTO TABLE it_mara FROM mara WHERE matnr IN so_matnr.

LOOP AT it_mara INTO wa_mara.

WRITE 😕 wa_mara-matnr,

wa_mara-mtart.

HIDE wa_mara-matnr.

ENDLOOP.

AT LINE-SELECTION.

CASE sy-lsind.

WHEN 1.

LEAVE TO TRANSACTION co.

ENDCASE.

Regards,

Vijay

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
851

parameters:pa_matnr type mara-matnr.

data:it_param type table of RFC_SPAGPA.
data:wa like line of it_param.

wa-parid = 'MAT'.
wa-parval = pa_matnr.
append wa to it_param.



CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
  EXPORTING
    tcode                         = 'MM03'
    SKIP_SCREEN                   = 'X'
 TABLES
   SPAGPA_TAB                    = it_param
 EXCEPTIONS
   CALL_TRANSACTION_DENIED       = 1
   TCODE_INVALID                 = 2
   OTHERS                        = 3
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

There are some other signatures in the Function module.make use of it if you are handling any messages,updates etc