Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM: TO get production in future

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

Do a st05 on the transaction md04 to get the tables involved.

Check tables starting with MD* in se11.

Regards,

Ravi

Former Member
0 Kudos

Go to SE93 and click on Display object list button..

See the tables and function modules.

hope this helps you.

Former Member
0 Kudos

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

Former Member
0 Kudos

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 .

0 Kudos

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