2006 Oct 13 2:03 PM
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.
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.
2006 Oct 13 2:59 PM
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.
2006 Oct 13 4:16 PM
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
2006 Oct 13 8:02 PM
The functionality for MD04, MMBE, MD51 is:
If I select the a row in the list, the plant and material needs pass to the above transactions from that record or line.
I have created 3 buttons for these transaction next to ALV tool bar.
Please help me
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |