2008 May 27 10:04 AM
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
2008 May 27 10:15 AM
Hi,
declare as
data : matnr like mara-MATNR MEMORY ID MAT.
CHECK WHETHER THE DATA MATNR IS filled before calling the transaction.......
2008 May 27 10:08 AM
2008 May 27 10:22 AM
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.
2008 May 27 10:25 AM
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.
2008 May 27 10:27 AM
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
2008 May 27 10:40 AM
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
2008 May 27 10:09 AM
is the screen field value assigned to the variable matnr before setting the parameter id??
Rgds,
stck
2008 May 27 10:15 AM
Hi,
declare as
data : matnr like mara-MATNR MEMORY ID MAT.
CHECK WHETHER THE DATA MATNR IS filled before calling the transaction.......
2008 May 27 10:43 AM
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".
2008 May 27 10:17 AM
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
2008 May 27 10:57 AM
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?
2008 May 27 10:20 AM
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
2008 May 27 10:49 AM
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)
2008 May 27 10:20 AM
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
2008 May 27 10:21 AM
Hi,
Your code will not work for MM01, but it works for MM02 and MM03.
2008 May 27 10:21 AM
2008 May 27 10:22 AM
hi!
INITIALIZATION.
IMPORT wk_noteno FROM MEMORY ID 'NOTIFNO'.
CASE sscrfields-ucomm.
2009 Aug 11 7:25 AM