zsdr101-Run finished MRP

Source: Internet
Author: User

*&---------------------------------------------------------------------*
*& Report ZSDR101
*&
*&---------------------------------------------------------------------*
*& Run finished MRP
*&
*&---------------------------------------------------------------------*

Report zsdr101.

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.

Data:begin of I_mara occurs 0,
Matnr like Mara-matnr,
Werks like Marc-werks,
END of I_mara.

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 = ' Fert '
and a~lvorm = ' '
and b~lvorm = ' '
and (B~werks = ' 3110 ' or b~werks = ' 3120 ' or b~werks = ' 3220 ' or b~werks = ' 3130 ')
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 = I_mara-werks.
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 = I_mara-werks
* 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

zsdr101-Run finished MRP

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.