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: 

How to do BDC to update safety time in the MRP View

Former Member
0 Kudos

How will we update “Safety time/act.cov” (MARC-SHZET) from S976

Target Days’ supply (REICZ).

The program will join records from S976 version = “A00” and SPMON = current month +1 (default from selection screen) with MARC. The join will be on plant (WERKS) and material (MATNR).

Update the MARC-SHZET field with the value in S976-REICZ.

If REICZ > 99 make the value in MARC-SHZET = 99

2 REPLIES 2

Former Member
0 Kudos

hi praasad,

MRP Run Exception Description

pls go with this link.it may help you.

1 2 New, and opening date in the past SAP has created a new requisition and scheduled it appropriately based on the demand, however, given the lead time of the material the Purchase Order should have already been issued to the supplier. High potential that this order will need to be expedited! Critical

1 5 Opening date in the past

2 3 New, and start date in the past The order or requisition is scheduled to start in the past. High potential that this order will

need to be expedited or that the demand can not be supplied! Critical

2 6 Start date in the past

2 63 Production start before order start System configuration should not allow this situation. Review the order and ensure that the scheduled & basic dates are in line and notify the HelpDesk to report 'Inconsistent Scheduling Configuration". Critical

3 4 New, and finish date in the past The order or requisition is scheduled to finish in the past. High potential that this order will

need to be expedited or that the demand can not be supplied! Critical

3 7 Finish date in the past

3 64 Production finish after order finish System configuration should not allow this situation. Review the order and ensure that

the scheduled & basic dates are in line and notify the Helpdesk to report 'Inconsistent Scheduling Configuration". Error

4 1 Newly created order proposal New order created Informational

4 42 Order proposal has been changed Order rescheduled by SAP Informational

4 44 Order proposal re-exploded Order regenerated by SAP Informational

4 46 Order proposal has been manually changed Order rescheduled by planner Informational

4 61 scheduling: Customizing inconsistent System configuration should not allow this situation. Ensure that the order shows up

properly in CM25 and notify the Helpdesk to report 'Inconsistent Scheduling Configuration". Error

4 62 Scheduling: Master data inconsistent Check master data ! Remove "In House Processing Time" from the Material Master MRP2 view. Ensure that the Production Version & Routing are correct. Run MPS/MRP manually once corrected. Error

4 82 Item is blocked The requisition has been manually blocked and therefore cannot be converted. Remove the block from the requisition or delete the requisition and run MD02 for the material to regenerate. Critical

5 50 No BOM exists SAP was unable to find a valid Bill Of Material for the item. Check the BOM, Production Version & Selection Method. Error

5 52 No BOM selected SAP was unable to find a valid Bill Of Material for the item. Check the BOM, Production Version & Selection Method. Error

5 53 No BOM explosion due to missing config. Plant Set-Up incorrect. Contact the Helpdesk to report this error! Error

5 54 No valid run schedule header Material set for repetitive manufacturing on the Material Master MRP views. Correct Material Master or contact the Helpdesk for assistance with this error. Error

5 55 Phantom assembly not exploded SAP was unable to find a valid Bill Of Material for the phantom material. Check the BOM or contact the Helpdesk for assistance with this error. Error

5 69 Recursive BOM components possible Bill of material inaccurate (material consuming itself). Review and correct BOM and run MPS manually. Error

6 25 Excess stock Excess stock planned based on the "Range of Coverage" profile. Coverage profiles should not be in use. Remove the "Range Of Coverage Profile" from the MRP view of the Material Master and run MRP manually. Error

6 26 Shortage in individual segment There is material in the "Provided To Vendor" bucket in SAP. Remove the material using

transaction MB1B and run MRP manually. Critical

6 40 Coverage not provided by master plan Excess stock planned based on the "Range of Coverage" profile. Coverage profiles should not be in use. Remove the "Range Of Coverage Profile" from the MRP view of the Material Master and run MRP manually. Contact the HelpDesk for assistance if unable to resolve. Error

6 50 Shortage in the planning time fence SAP unable to automatically cover demand due to the time fence. Review and reschedule supply elements appropriately. Important

6 57 Disc. matl partly replaced by follow-up Order is planning to use remaining run-out material and the balance of the requirement using the replacement material. Adjust order quantities based on the run-out as appropriate. Important

6 58 Uncovered reqmt after effective-out date System unable to find replacement material. Review the run-out strategy and adjust master data appropriately. Run MRP manually once resolved. Critical

6 59 Receipt after effective-out date Receipt of discontinued material planned. Review the run-out strategy and adjust orders

appropriately. Run MRP manually once resolved. Critical

6 70 Max. release qty - quota exceeded System unable to determine source of supply. Check the effective dates of the Quota

Arrangements and adjust appropriately. If Quota Arrangements are not appropriate for the material remove the "Quota Arrangement" selection from the Material Master. Error

6 96 Stock fallen below safety stock level Supply plan insufficient to cover safety stock requirement. Review and adjust if appropriate. Important

7 10 Bring process forward Order or requisition is too late to cover requirements. Review and reschedule appropriately. Important

7 15 Postpone process Order or requisition is too early based on requirements. Review and reschedule appropriately. Important

7 20 Cancel process Supply is beyond total demand in the system. Stock Not Required! Review and re-plan appropriately. Critical

7 30 Plan process according to schedule Order or requisition early or late and within close proximity to the Time Fence, Hard Order, or Current Date. Review and reschedule appropriately. Important

8 98 Abnormal end of requirements planning System unable to process the material - Major Data or Configuration problem! Check Material Status and seek assistance if unable to resolve. Materials flagged for deletion should be set to the "DIS" MRP controller to remove them from the list. Error

regards

karthik

0 Kudos

Hai Karthik ,

I am very thankful for your reply.

But i want clear coding. First iam sending my coding but it is not working only one material is updating and

the program is in that loop only.

&----


*& Report ZR_PP_DRP_SFTYTIMEUPD *

*& *

&----


*& *

*& *

&----


REPORT ZR_PP_DRP_SFTYTIMEUPD .

tables: s976,

marc.

data : begin of it_s976 occurs 0,

vrsio type s976-vrsio, "Version number in the information

"structure

spmon type s976-spmon, "Period to analyze - month

werks type s976-werks, "Plant

matnr type s976-matnr, "Material Number

reicz type s976-reicz, "Target range of coverage (target

"days'supply)

end of it_s976.

*data : begin of it_marc occurs 0,

  • matnr type marc-matnr, "Material Number

  • werks type marc-werks, "Plant

  • shzet type marc-shzet, "Safety time (in workdays)

  • end of it_marc.

DATA: BEGIN OF it_marc OCCURS 0.

INCLUDE STRUCTURE marc.

DATA: END OF it_marc.

data: lv_date1 type sy-datum,

lv_date2 type sy-datum,

lv_month(2) type n,

lv_year(4) type n.

data:it_bdcdata like bdcdata occurs 0 with header line.

data: it_messtab like bdcmsgcoll occurs 0 with header line.

data: v_mode.

selection-screen: begin of block b1 with frame title text-000.

select-options: s_spmon for s976-spmon,

s_werks for s976-werks,

s_matnr for s976-matnr.

selection-screen: end of block b1.

initialization.

concatenate sy-datum0(4) sy-datum4(2) into lv_date1.

lv_month = sy-datum+4(2).

lv_year = sy-datum+0(4).

do 1 times.

lv_month = lv_month + 1.

if lv_month gt 12.

lv_month = 1.

lv_year = lv_year + 1.

endif.

enddo.

concatenate lv_year lv_month into lv_date2.

s_spmon-low = lv_date1.

s_spmon-high = lv_date2.

s_spmon-option = 'BT'.

s_spmon-sign = 'I'.

append s_spmon.

clear s_spmon.

start-of-selection.

select vrsio

spmon

werks

matnr

reicz

into table it_s976 from s976

where vrsio = 'A00'

and spmon in s_spmon

and werks in s_werks.

if sy-subrc = 0.

SORT it_s976 by spmon werks matnr.

endif.

  • if it_s976[] is not initial.

*

  • select matnr

  • werks

  • shzet

  • into table it_marc from marc

  • for all entries in it_s976

  • where matnr = it_s976-matnr

  • and werks in s_werks.

*

  • endif.

if it_s976[] is not initial.

select *

into table it_marc from marc

for all entries in it_s976

where matnr = it_s976-matnr

and werks = it_s976-werks.

endif.

if sy-subrc = 0.

SORT it_marc BY werks matnr.

endif.

loop at it_s976.

read table it_marc with key werks = it_s976-werks

matnr = it_s976-matnr.

if sy-subrc = 0.

if it_s976-reicz > 99.

it_marc-shzet = 99.

else.

it_marc-shzet = it_s976-reicz .

endif.

**-- Initial Screen

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RMMG1-MATNR'

it_marc-MATNR.

**-- Pop up materials view

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(13)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(13)'

'X'.

**-- Pop Plant entry screen

perform bdc_dynpro using 'SAPLMGMM' '0080'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-WERKS'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'RMMG1-WERKS'

it_marc-WERKS.

perform bdc_dynpro using 'SAPLMGMM' '3000'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

**-- Second screen

*perform bdc_field using 'MAKT-MAKTX'

  • record-MAKTX_004.

*perform bdc_field using 'MARC-BESKZ'

  • record-BESKZ_005.

*perform bdc_field using 'MARC-LGPRO'

  • record-LGPRO_006.

*perform bdc_field using 'MARC-LGFSB'

  • record-LGFSB_007.

*perform bdc_field using 'MARC-FHORI'

  • record-FHORI_008.

perform bdc_field using 'MARC-SHZET'

it_marc-SHZET.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=yes'.

endif.

call transaction 'MM02' using it_bdcdata

mode 'A'

messages into it_messtab.

endloop.

&----


*& Form BDC_DYNPRO

&----


  • BDC screens information

----


form bdc_dynpro using program dynpro.

clear it_bdcdata.

it_bdcdata-program = program.

it_bdcdata-dynpro = dynpro.

it_bdcdata-dynbegin = 'X'.

append it_bdcdata.

clear it_bdcdata.

endform. " BDC_DYNPRO

&----


*& Form BDC_FIELD

&----


  • BDC fields information

----


form bdc_field using fnam fval.

clear it_bdcdata.

it_bdcdata-fnam = fnam.

it_bdcdata-fval = fval.

append it_bdcdata.

clear it_bdcdata.

endform. " BDC_FIELD

Thanks & Regards,

Prasad.Tallapudi.