ZSDR100 Running RAW Material MRP

Source: Internet
Author: User

*&---------------------------------------------------------------------*
*& Report ZSDR100
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

Report ZSDR100.


Data:i_mrp_plan_param like Bapi_mrp_plan_param occurs 0 with header line,
I_mrp_statistic like bapi_mrp_statistic occurs 0 with header line,
I_return like BAPIRET2 occurs 0 with header line,
I_mara like MARA occurs 0 with header line.
DATA:I_DISMM like MARC-DISMM,
I_mmsta like Marc-mmsta.

Initialization.

Start-of-selection.

Perform GETDATA.

*&---------------------------------------------------------------------*
*& Form GetData
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
Form GETDATA.

SELECT * into corresponding fields of table I_mara
From MARA as a join Marc as B
On a~matnr = B~matnr
WHERE (A~mtart = ' ROH ' or A~mtart = ' HALB ' or A~mtart = ' fert ')
and B~werks = ' 1000 '
and B~DISGR = ' 0001 '. " and Mstae = ". "Cross-plant material status freeze removed, in material master base data 1 view

Refresh:i_mrp_plan_param.
I_mrp_plan_param-proc_type = ' Netch '.
I_mrp_plan_param-create_purreq = ' 2 '.

I_mrp_plan_param-create_sched_lines = ' 3 '.
i_mrp_plan_param-create_mrp_list = ' 1 '.
I_mrp_plan_param-planning_mode = ' 1 '.
Append I_mrp_plan_param.

Loop at I_mara.

* Select Single dismm mmsta from MARC to (I_dismm,i_mmsta)
* Where Matnr = I_mara-matnr and Werks = ' 1000 '.

Select Single dismm from MARC to (I_DISMM)
where Matnr = I_mara-matnr and Werks = ' 1000 '.
If SY-SUBRC = 4.
Continue.
ElseIf SY-SUBRC = 0.
If i_dismm = ' ND '.
Continue.
endif.
* IF i_mmsta ne '. "Specific plant material status removed, in MRP view
* CONTINUE.
* ENDIF.
endif.

Call function ' bapi_material_planning '
Exporting
MATERIAL = I_mara-matnr
PLANT = ' 1000 '
* Mrp_area =
* Plan_scenario =
Mrp_plan_param = I_mrp_plan_param
* MATERIAL_EVG =
Importing
Mrp_statistic = i_mrp_statistic
RETURN = I_return.
* TABLES
* Mrp_lists =
* Extensionout =

Write at:/2 (I_MARA-MATNR), I_return-message.
CLEAR:I_DISMM, I_mmsta.
Clear:i_mara.
Endloop.

EndForm. "GetData

ZSDR100 Running RAW Material MRP

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.