on 2024 Sep 19 7:26 PM
I would like the pass the input data from MD04 to the custom tcode which I am creating. How to do so.
Or how to see the material availability for the planned orders from MD04 screen
Request clarification before answering.
Hello @RaghavanKathamuthu
You don't need to set values for material number, plant, MRP area, MRP controller and planning scenario. These are preset dynamically based on the current values in MD04 - include MM61RF90_GLOBAL_PID_SET:
FORM GLOBAL_PID_SET USING MATNR LIKE MARC-MATNR
WERKS LIKE MARC-WERKS
BERID LIKE RM61R-BERID
PLSCN LIKE RM61R-PLSCN
DISPO LIKE MDKP-DISPO. "46c
*--> Material übergeben
IF NOT MATNR IS INITIAL.
SET PARAMETER ID 'MAT' FIELD MATNR.
ENDIF.
*--> Werk übergeben
IF NOT WERKS IS INITIAL.
SET PARAMETER ID 'WRK' FIELD WERKS.
ENDIF.
*--> Dispobereich übergeben
IF NOT BERID IS INITIAL.
* IF NOT T000MD-DISFG IS INITIAL.
SET PARAMETER ID 'BERID' FIELD BERID.
* ENDIF.
ENDIF.
*--> Szenario übergeben
IF NOT PLSCN IS INITIAL.
SET PARAMETER ID 'PLS' FIELD PLSCN.
ENDIF.
*--> Disponent übergeben new 46c
IF NOT DISPO IS INITIAL.
SET PARAMETER ID 'DGR' FIELD DISPO.
ENDIF.
ENDFORM.
Then a transaction defined in a navigation profile is called by CALL_TRANSACTION_ERP function. You can put a breakpoint there and see how PIDs are handled. Global PIDs are passed to the transaction as well as any additional PIDs defined in the navigation profile. Values of the additional PIDs can be static only, i.e. hard coded in the navigation profile configuration.
Unfortunately MDVP that you intend to call doesn't read PID WRK for production plant selection criterion. The PID is not defined for S_WERKS in MDVP - include RLD05TOP:
SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-bl2.
SELECT-OPTIONS:
s_plnum FOR plsv-plnum,
s_werks FOR plaf-plwrk, "<--- missing MEMORY ID wrk
s_dispo FOR plaf-dispo,
s_fevor FOR plaf-plgrp,
s_matnr FOR plsv-matnr MATCHCODE OBJECT mat1.
* Selektionskriterien für Serienaufträge
SELECT-OPTIONS so_verid FOR rm61e-verid.
sel_opt_mdv0x ra_mdv01 ra_mdv02.
SELECT-OPTIONS s_mdpbv FOR plaf-mdpbv.
PARAMETERS pa_kapfx LIKE iocsel-av_kapfx.
PARAMETERS pa_peonl LIKE rm61e-kzpeonly.
PARAMETERS pa_nmont LIKE iocsel-av_no_mont.
SELECTION-SCREEN END OF BLOCK bl2.
S_WERKS misses MEMORY ID wrk addition.
Therefore, you can't call MDVP from MD04 and pass plant value, unless you modify S_WERKS definition in MDVP and add the missing MEMORY ID addition.
Best regards
Dominik Tylczynski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.