Repair production orders are created to correct the defects. Such orders will be without the reference to material so that labor cost will capture only. Currently DMC, supports the order with valid material number but to capture labor hours on repair Order, material may not be needed. So, such order without the material will get failed in DMC. In this blog, you will see a way to handle repair orders in DMC.
<Material>
<!---Added for rework order|Header Material-->
<xsl:choose>
<xsl:when test="MATNR">
<xsl:value-of select="MATNR"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="material" select="'NULL_ECC'"/>
<xsl:value-of select="$material"/>
</xsl:otherwise>
</xsl:choose>
</Material>
<BillOfMaterial>
<!-- Added for Rework Order | Bill of material Number-->
<xsl:choose>
<xsl:when test="MATNR">
<xsl:value-of select="STLNR"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="BillofMaterial" select="'02110817'"/>
<xsl:value-of select="$BillofMaterial"/>
</xsl:otherwise>
</xsl:choose>
</BillOfMaterial>
<BillOfMaterialVariant>
<!-- Added for Rework Order | Bill of material Variant-->
<xsl:choose>
<xsl:when test="MATNR">
<xsl:value-of select="STLAL"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="BillofMaterial" select="'1'"/>
<xsl:value-of select="$BillofMaterial"/>
</xsl:otherwise>
</xsl:choose>
</BillOfMaterialVariant>
<BillOfMaterialVariantUsage>
<!-- Added for Rework Order | Bill of material Variant usage-->
<xsl:choose>
<xsl:when test="MATNR">
<xsl:value-of select="STLAN"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="BillofMaterial" select="'1'"/>
<xsl:value-of select="$BillofMaterial"/>
</xsl:otherwise>
</xsl:choose>
</BillOfMaterialVariantUsage>
<MfgOrdPlndTotQtyInBaseUnit pp:unitCode="{BMEINS}">
<!-- Added for Rework Order | Planned Quantity-->
<xsl:choose>
<xsl:when test="MATNR">
<xsl:value-of select="BMENGE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="GAMNG"/>
</xsl:otherwise>
</xsl:choose>
</MfgOrdPlndTotQtyInBaseUnit>
<!--Added for Rework Order | Generating Bill of material payload with hardcoded values -->
<xsl:if test="not(E1RESBL) and not(string(/LOIPRO05/IDOC/E1AFKOL/MATNR))">
<pp:ManufacturingOrderComponent>
<RequirementType>AR</RequirementType>
<Material>NULL_ECC</Material>
<Reservation>0102637848</Reservation>
<ReservationItem>10</ReservationItem>
<GoodsMovementType>261</GoodsMovementType>
<BillOfMaterialItemNumber>10</BillOfMaterialItemNumber>
<BillOfMaterialItemCategory>L</BillOfMaterialItemCategory>
<ManufacturingOrderItem>0000</ManufacturingOrderItem>
<BillOfMaterial>02038353</BillOfMaterial>
<SupplyArea>
<xsl:value-of select="PRVBE"/>
</SupplyArea>
<StorageLocation>0001</StorageLocation>
<RequiredQuantityInBaseUnit pp:unitCode="GLL">1</RequiredQuantityInBaseUnit>
<Warehouse>
<xsl:value-of select="LGNUM"/>
</Warehouse>
<MatlCompIsMarkedForBackflush>
<xsl:call-template name="convertToBool">
<xsl:with-param name="bool" select="BACKFLUSH"/>
</xsl:call-template>
</MatlCompIsMarkedForBackflush>
<MaterialIsCoProduct>
<xsl:call-template name="convertToBool">
<xsl:with-param name="bool" select="KZKUP"/>
</xsl:call-template>
</MaterialIsCoProduct>
<DebitCreditCode>H</DebitCreditCode>
<InventorySpecialStockType>
<xsl:value-of select="SOBKZ"/>
</InventorySpecialStockType>
<MaterialCompIsAlternativeItem>
<xsl:call-template name="convertToBool">
<xsl:with-param name="bool" select="ALPOS"/>
</xsl:call-template>
</MaterialCompIsAlternativeItem>
<AlternativeItemGroup>
<xsl:value-of select="ALPGR"/>
</AlternativeItemGroup>
<AlternativeItemPriority>00</AlternativeItemPriority>
<AlternativeItemStrategy>
<xsl:value-of select="ALPST"/>
</AlternativeItemStrategy>
<UsageProbabilityPercent>0</UsageProbabilityPercent>
</pp:ManufacturingOrderComponent>
<!--</xsl:otherwise></xsl:choose>-->
</xsl:if>
Thanks,
yadavpooja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.