I need to call 2 transactions from my dril down list,
and 3 transactions from the tool bar by adding 3 buttons.
Here I am using dynamic calls from the reuse alv list display function module.
but I am not getting the parameter id for ME38.
and not populating MMBE transaction. please help me..
Here I have given code for that...
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE rs_selfield-fieldname.
WHEN 'EBELN'.
IF rs_selfield-fieldname = 'EBELN'.
rs_selfield-fieldname = 'EVRTN'.
SET PARAMETER ID 'BES' FIELD rs_selfield-value.
CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
CLEAR rs_selfield.
ENDIF.
WHEN 'MATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
----
FORM SET_PF_STATUS *
----
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZNEWSTATUS'.
data:l_ucomm like sy-ucomm.
case l_ucomm.
when 'MD04'.
READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD l_selfield-value.
SET PARAMETER ID 'WRK' FIELD l_selfield-value.
CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
when 'MMBE'.
READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD l_selfield-value.
SET PARAMETER ID 'WRK' FIELD l_selfield-value.
CALL TRANSACTION 'MMBE' AND SKIP FIRST SCREEN.
when 'MD51'.
READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD l_selfield-value.
SET PARAMETER ID 'WRK' FIELD l_selfield-value.
CALL TRANSACTION 'MD51' AND SKIP FIRST SCREEN.
when 'EXIT'.
leave program.
when 'BACK'.
leave to screen 0.
endcase.
For ME38 the parameter ID is <b>VRT</b>. Aggrement number is of type EVRTN. You can see the parameter ID by pressing F1 on that field and press technical information.
Change the code like this:
SET PARAMETER ID 'VRT' FIELD rs_selfield-value.
CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
Regards,
Prakash.
Hi,
Parameter Id for ME38 is VRT but not BES. Change the code as below and try.
SET PARAMETER ID 'VRT' FIELD rs_selfield-value.
CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
Also,for Transactions MD04, MMBE,MD51, You are reading table it_rep_tab using index but i think you are wrongly setting the parameter id values, i.e, you have used the below lines
SET PARAMETER ID 'MAT' FIELD l_selfield-value.
SET PARAMETER ID 'WRK' FIELD l_selfield-value.
I think You may have to use wa_rep_tab for Material Value and for Plant Value but not l_selfield-value.
please check.
thanks,
sksingh
Add a comment