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 mm01 tcode

Former Member
0 Kudos
446

Dear Abapers,

I developed a screen in dialog programming in that i have stored material number in one text.My requirement is when i click its corresponding create button it should call mm01 and the material number should be dispalyed in mm01 screen.

I tried the below code but the material number not displayed in matnr field.

case sy-ucomm.

when 'CREATE'.

SET PARAMETER ID 'MAT' FIELD MATNR.

CALL TRANSACTION 'MM01'.

endcase.

I have declared matnr like

data: matnr like mara-matnr.

can anyone pl help me out in this issue.

Thanks in Advance!!!

Edited by: Ranganayahi Chandirasekaran on May 27, 2008 11:05 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
230

Hi,

declare as

data : matnr like mara-MATNR MEMORY ID MAT.

CHECK WHETHER THE DATA MATNR IS filled before calling the transaction.......

17 REPLIES 17

Former Member
0 Kudos
230

Hi

You need to do it with BDC

Aditya

0 Kudos
230

Hi Aditya,

Thanks for ur reply.

No, i am not doing BDC,I just want to call mm01 screen.

The mm01 screen should be displayed with the material number which i have mentioned in my own designed screen.

0 Kudos
230

check this example

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 ME23N, and skip initial data entry screen

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

http://www.sapdev.co.uk/reporting/alv/alvgrid_enhanced.htm

0 Kudos
230

Hi Ranganayahi,

Is the MATNR getting picked up properly from the table control.

You can check this by debuging the PAI part of your code.

You can also put a break-point at the place where you setting the parameter and check the desired MATNR is getting set.

Hope this helps you.

Thanks,

Arun

0 Kudos
230

Hi Ranganayahi,

Use this code instead of SET PARAMETER ID.

The SET PARAMETER is not working incase of MM01.

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

bdcdata-fnam = 'RMMG1-MATNR'.

bdcdata-PROGRAM = 'SAPLMGMM'.

bdcdata-dynpro = '0060'.

bdcdata-DYNBEGIN = 'X'.

bdcdata-fval = MATNR.

APPEND bdcdata.

CALL TRANSACTION 'MM01' USING bdcdata.

Hope this helps you.

Thanks,

Arun

Former Member
0 Kudos
230

is the screen field value assigned to the variable matnr before setting the parameter id??

Rgds,

stck

Former Member
0 Kudos
231

Hi,

declare as

data : matnr like mara-MATNR MEMORY ID MAT.

CHECK WHETHER THE DATA MATNR IS filled before calling the transaction.......

0 Kudos
230

Hi,

i am not able declare matnr field as u said.It gives the following error.

Include MZ_MMTTOP

",", "VALUE ...", "LENGTH ...", "DECIMALS ...", or "VALUE IS INITIAL"

expected after "MARA-MATNR".

Former Member
0 Kudos
230

Hi,

In MM01 material number is not displayed before it is created so you cannot call MM01 setting parameter you have to call MM02 for a particular material with the same syntax.You cannot call MM01 because matetial number is only generated at the end of the process of creation of matrerial in MM01 but you can try to call MM02 with the same syntax

SET PARAMETER ID 'MAT' FIELD MATNR.

CALL TRANSACTION 'MM02'.

where field MATNR will have some valid material number.

Regards,

Himanshu Verma

0 Kudos
230

Hi,

yes.u r correct! My code is working for mm02 and mm03.

but it is not working for mm01.

but my requirement is: i need to create material number which shows in the screen.so when user click create button it should call mm01 with material number displayed in screen.

Is it possible to call mm01 screen for this suituation?

Former Member
0 Kudos
230

HI,

In your code , add this also:

case sy-ucomm.

when 'CREATE'.

SET PARAMETER ID 'MAT' FIELD MATNR.

CALL TRANSACTION 'MM01' AND SKIP FIRST SCREEN.

endcase.

Hope this helps.

Reward if helpful.

Regards,

Sipra

0 Kudos
230

Hi,

I tried as u said.but the matnrial number is not displayed.

but it shows error msg like 'enter mateial type'.(in mm01 screen)

Former Member
0 Kudos
230

Hi Ranganayahi,

Try CALL TRANSACTION 'MM01' AND SKIP FIRST SCREEN.

At the same time check field MATNR has some value.

Hope this helps you.

Thanks,

Arun

Former Member
0 Kudos
230

Hi,

Your code will not work for MM01, but it works for MM02 and MM03.

former_member156446
Active Contributor
0 Kudos
230

check this [link |;

Former Member
0 Kudos
230

hi!

INITIALIZATION.

IMPORT wk_noteno FROM MEMORY ID 'NOTIFNO'.

CASE sscrfields-ucomm.

Former Member
0 Kudos
230

Closing this thread.