05-23-2006 11:42 AM
Hi.
I have a requirement wherein I want to get the forecast of production for given no of weeks in future.
We get this type of data in T.Code MD04 which gives forecasted production figures in days,weeks and months.
Can any one know which function module I need to use or Database table name for this data
05-23-2006 12:14 PM
Hi,
You can use the function module 'MD_STOCK_REQUIREMENTS_LIST_API' for getting the MD04 data. If you go inside the function you can see the tables parameters MDPSX, MDEZX, MDSUX. You need to declare the internal tables like this eg.
data: I_STCK TYPE STANDARD TABLE OF MDEZ WITH HEADER LINE,
I_STCK1 TYPE STANDARD TABLE OF MDPS WITH HEADER LINE,
I_STCK2 TYPE STANDARD TABLE OF MDSU WITH HEADER LINE.
When u execute the function module the importing parameters matnr and werks has to be filled. After execution for the particular matnr and werks the internal tables declared above, gets filled with the data which you see in the screen MD04. You can use any of the above 3 internal tables for your manipulation.
Hope this solves your issue.
Please reward points for suitable answers.
Lakshminarayanan
05-23-2006 11:46 AM
Do a st05 on the transaction md04 to get the tables involved.
Check tables starting with MD* in se11.
Regards,
Ravi
05-23-2006 11:53 AM
Go to SE93 and click on Display object list button..
See the tables and function modules.
hope this helps you.
05-23-2006 12:14 PM
Hi,
You can use the function module 'MD_STOCK_REQUIREMENTS_LIST_API' for getting the MD04 data. If you go inside the function you can see the tables parameters MDPSX, MDEZX, MDSUX. You need to declare the internal tables like this eg.
data: I_STCK TYPE STANDARD TABLE OF MDEZ WITH HEADER LINE,
I_STCK1 TYPE STANDARD TABLE OF MDPS WITH HEADER LINE,
I_STCK2 TYPE STANDARD TABLE OF MDSU WITH HEADER LINE.
When u execute the function module the importing parameters matnr and werks has to be filled. After execution for the particular matnr and werks the internal tables declared above, gets filled with the data which you see in the screen MD04. You can use any of the above 3 internal tables for your manipulation.
Hope this solves your issue.
Please reward points for suitable answers.
Lakshminarayanan
05-23-2006 12:47 PM
Hi Lakshminarayanan.
Thanks for your reply.It seems the FM will work out.But can u tell me how can I get a production figures for next 3 weeks .
05-23-2006 12:55 PM
Hi,
This function module will give you results for whatever material and plant you enter as a parameter. Getting figures for 3 weeks depends upon your data which you get inside the internal table. If the MD04 screen has data for 10 weeks say e.g, then your internal table will also have data for 10 weeks. You may need to filter your required data for required no.of.weeks accordingly.
Hope this solves your issue.
Please reward points for good feedback.
Lakshminarayanan