cpl gatp

43
 CPL GATP Technical Solution ocument  Author: Cliff Liu (Version 1.0 edit by Geng Ren) Version: 1.0

description

ATP

Transcript of cpl gatp

All-in-One

CPL GATPTechnical Solution Document

Author: Cliff Liu (Version 1.0 edit by Geng Ren)

Version: 1.0

1Overview31.1GATP Usage In SEMC CPL31.2Data Source of Delivery Plan41.3Data Source of Product Allocation Quantity42Configuration of Rule based ATP Check52.1Configuration in ERP52.1.1Rule based GATP Check for sales orders52.1.2CIF Setup for GATP function52.2Configuration in APO52.2.1Configuration of Rule Determination52.2.2Condition Table Technical Detail62.3Rule Master Data72.3.1Rule Determination72.3.2Rule Maintenance72.4APO Rule Attribute: Calculation Profile102.4.1Allowed Delay = SPACE102.4.2Allowed Delay = X113GATP Check for different material123.1MRP Profile in ERP123.1.1MRP Profile=CPL1123.1.2MRP Profile=CPL2133.1.3MRP Profile=CPL3133.2Customizing in ERP (only function when APO is down)133.2.1Checking Group in ERP133.2.2Strategy group in ERP153.3ATP Group in APO163.3.1ATP Group = ZSFor CPL1163.3.2ATP Group = ZT, For CPL2CPL3193.4Check Instructuion in APO213.4.1Check mode 050213.4.2Check mode 041213.5CPL3: Product Allocation Setup in APO223.5.1Product Master data in APO223.5.2Allocation Procedure223.5.3Allocation Group223.5.4Connection between Allocation Group and Planning Area234MOQ Requirement in GATP Check234.1Original MOQ Solution234.2New MOQ Solution Requirement in R0811244.2.1Example of CPL MOQ caculation254.3Solution to the new requirement265Vendor Quota Data Flow: ERP BW APO275.1Data Flow275.1.1ERP275.1.2BW275.1.3APO285.2Program Z2GATP_UPDATE_LOC_W_QA315.2.1Special Fields315.2.2Info Spoke table /BIC/OHZ2QACONSU315.2.3Program Logic325.3Using Program Z2GATP_UPDATE_LOC_W_QA345.3.1Process Chain CPL_GATP_MD346Delivery Plan Data Flow396.1About 4A5 Message Receiving396.1.1Message Type= PBAPS_CHANGEKEYFIGUREVALUE396.1.2Partner Profile Definition396.1.3Result of Receiving 4A5 message406.2From 4A5 message to delivery Plan407Product Allocation Data Flow408Trouble Shooting by Debugging418.1Overview418.2APO GATP usage during Sales Order maintenance418.2.1Scheduling Calculation418.2.2ATP Check418.3R3 Delivery -> APO GATP428.3.1Call Stack in ERP, RFC Call428.3.2Call Stack in ERP, Check CIF428.3.3Call Stack in APO, EMC MOQ Enhancement428.4Rule Simulation in APO43

OverviewGATP Usage in SEMC CPLGATP Function is used in following document processing: CPL Sales Order Processing CPL Outbound Delivery Processing CPL Stock Transfer Order (Purchase Order) ProcessThe major usage is in CPL Sales Order Process, the usage in delivery and stock transfer order is relatively simple.For the CPL Sales Order Processing, GATP provides following functions: Scope Of Check: Compared with SAP standard ATP check, SEMCs CPL Sale Order contains a special logic, besides standard check scope (e.g. stock), we have to consider the so called Delivery Plan item, which is the confirmed replenishment plan from CPL component Supplier. This item can be regarded as a kind of supplier delivery schedule, but the source of item is out of SAP ERP. Technically, this delivery plan is the PIP 4A5 message, a response to SEMCs 4A3 message (Gross requirement). In the implementation, This Delivery Plan item is stored in the key figure = 9APPROD of Planning Area = SEMC_CPL_SNP01. Supplier Quota Management: In SAP Standard functionality, Supplier Quota Management is a function in purchase, but SEMC CPLs component purchase is merged into component sales (to EMS), we have to check quota in sales order processing. Since in SMEC CPL, we have a 1 to 1 mapping relationship between storage location and supplier, GATPs storage location determination is used to select the correct supplier considering quota information. Technically, in APO, Rule based GATP is used, the location substitution function will determine the correct storage location. There is some SEMC enhancements to SAP standard to realize this requirement. Product Allocation: When the supply of certain component can not meet all requirement of EMS, product allocation is used to avoid the component be consumed by some EMS, fair share principle is used to calculate the product allocation, so the percentage of product allocation is the same of the percentage of the component requirement of EMS. Technically, in APO planning area SEMC_CPL_GATP is used to control the product allocation.Data Source of Delivery Plan In GATP check scope definition, ATP Category=Z4 is the Delivery Plan Item, this data is coming from Planning Area=SEMC_CPL_SNP01, Key Figure=9APPROD.This Key Figure is calculated based on PIP 4A5 Message, which is the confirmed delivery plan from supplier. Suppliers 4A5 message is a response of SEMCs 4A3 message to suppliers, in 4A3 message, SEMC provide following information so supplier can arrange their delivery plan: Current consignment stock Weekly Gross requirement Min/Max Days of supply Min/Max StockProgram Z2PROACT01 is called by background job, following key figures of planning area SEMC_CPL_SNP01 is read and 4A3 message is composed. ZCPLSNP06Gross Requirement ZCPLSNP01Min Stock DOS ZCPLSNP02Max Stock DOS ZCPLSNP03Min Stock Qty ZCPLSNP04Max Stock QtyIn the lasted development, current week of GI quantity added into 4A3 message,that information is from ERP sales order report.Please refer to Planning process for more details.Data Source of Product Allocation QuantityProduct Allocation information is stored in Planning Area=SEMC_CPL_GATP, under two Key Figures: ZCPLATP01Allocation Quantity ZCPLATP02Consumed Allocation QuantityZCPLATP01 is from the fair share value of suppliers delivery plan (from 4A5 Message)ZCPLATP02 is updated by Sales Order [to be confirmed]. The planning hierarchy of Product Allocation is: 9AKONOBProd. Alloc. Object ZACUSTOMCustomer CPL ZATPMATNRAPO Product GATPConfiguration of Rule based ATP CheckConfiguration in ERP Rule based GATP Check for sales ordersBusiness Transaction=Z01 (CPL Availability Check - APO)This Z01 is linked with three sales order types ZCSO - CPL Component Order ZCSE - CPL Excess order (without MOQ rounding) ZCNP - CPL NPI sales orderCIF Setup for GATP functionIntegration Model = HUB:GATPTcode=CFM1 (Integration model definition), CFM2 (Integration model activation)Plant=CNHK or VIRT

If the Integration Model is not activated, during sales order ATP processing, ATP check of ERP will be used instead of APO.

Configuration in APOSale Order Type=ZCSO in normal case, the system (GATP functionality) will determine the storage location by the giving material and plant (CNHK for HK hub) combination. But end user can specify the storage location in the sales order process by changing the Delivery Priority attribute.Delivery priority by default is 2, which means normal CPL sales order process, however, end user can change it manually to one of following values: Delivery Priority=10, Storage Location has to be specified manually, ATP Check will not be performed, so the order item will be always confirmed. Delivery Priority=20, Storage Location has to be specified manually, ATP Check will be performed as normal. Sales Order Type=ZCNP, Storage Location should be always provided manually, and ATP Check will not be performed.Configuration of Rule DeterminationAssign Rule Strategy or Rule Strategy SequenceTech ScenarioBus TranAction TypeRule StrategyAAZ01A90000AAZ01B90000AAZ01C90000DDZ01A90000Action Type: Create: AChange:BCopy:CTech Scenario:Online dialog:AABatch input:BBEDI:DDBackorder processing:EERule StrategyStrategy=90000Rule Strat. Type=InclusiveShort text=CPLCType=9000

Condition TypeCType=9000 (CPL)AccSq=9000 (CPL)Access SequenceAccess Sequence=9000AcNoTableShort textExclusive0904Del. PrioX1903Order typeX2902ProductXTable 904Condition fieldDoc structure/field LabelLPRIO/SAPAPO/KOMGO-LPRIODelivery PriorityTable 903Condition fieldDoc structure/field LabelAUART/SAPAPO/KOMGO-AUARTOrder TypeTable 902Condition fieldDoc structure/field LabelMATNR/SAPAPO/KOMGO-MATNRProductCondition Table Technical DetailIn Condition Table we can find the Condition Number/SAPCND/KOTO904Kay field is Delivery PriorityTherer are two records, for Delivery Priority=10 and 20Condition TypeDeliv PriorityCond.record no

19000100000000050

29000200000000051

/SAPCND/KOTO903Key field is Order TypeThere is only one record, that is for Sales Order Type=ZCNP.Condition Type=9000Order Type=ZCNP

/SAPCND/KOTO902Key field is ProductThis is the most common case GATP used in SMEC CPL sales order, there is a rule per material without version.Rule Table /SAPAPO/RBA02This is the database table of Rule

Rule Master DataRule DeterminationMenu Path in APO: SAP menu->APO->Master Data->Rule Maintenance->Display Rule DeterminationRule MaintenanceMenu Path in APO: SAP menu->APO->Master Data->Rule Maintenance->Rule MaintenanceAn example of a normal ruleRule=0000000083Rule Type=I (inclusive)No of Substitutns=1Product + Loc. SubstLoc.Determin. Proced.=0000000083Rule Control=900 (CPL)Location=04 (Start from bootom of list)Qual.Prod.=SPACE (No Restribtion)Qual.Loc.=E (Input Location)CombSeq=2 (Comb. Qualified product w. locs, then qual. Loc. with products)Combination=SPACE (Union)Substit. Level=1 Calculation Profile=9000Allowed Delay Valid=SPACE (This means unlimit delay is allowed)

Loc Detemin Proced=0000000083Location=CNHKActivity=[SPACE]Location=C1038Activity=900 (CPL)Screen Shot Rule Attribute:

Location Determination Procedure:

Rule Control

Special Rule=MAN_NO_ATPRule=MAN_NO_ATPRule Type=I (inclusive)No of Substitutns=1Product + Loc. SubstLoc.Determin. Proced.=ALL_SUPPRule Control=MAN (Manual selection)Location=02 (work forward from input, then backward from input)Qual.Prod.=SPACE (No Restribtion)Qual.Loc.=E (Input Location)CombSeq=2 (Comb. Qualified product w. locs, then qual. Loc. with products)Combination=SPACE (Union)Substit. Level=1 Loc Detemin Proced=ALL_SUPPLocation=CNHKActivity=[SPACE]Location=C1001Activity=901 (No ATP or sales allocation)Location=Location= C1110Activity =901 (No ATP or sales allocation)Special Rule=MAN_ATPRule=MAN_ATPRule Type=I (inclusive)No of Substitutns=1Product + Loc. SubstLoc.Determin. Proced.=ALL_SUPP2Rule Control=MAN (Manual selection)Location=02 (work forward from input, then backward from input)CombSeq=2 (Comb. Qualified product w. locs, then qual. Loc. with products)Combination=SPACE (Union)Substit. Level=1 Loc Detemin Proced=ALL_SUPP2Location=CNHKActivity=[SPACE]Location=C1001Activity= 900 (CPL)Location=Location= C1110Activity = 900 (CPL)Activity = 901 (No ATP or sales allocation)This activity is used in Rule=MAN_NO_ATP, in Location SubstitutionMeans of Transp.=SPACEBusiness Event=ACheck Mode=100StartProduction=0 (Availability Check Only, No Production)Production Time=0 (After Executing all Basic Methods)Start Source Determination=0 Only Availability Check, No Source DeterminationSource Determination Method=0 No Check Against Contracts or Scheduling AgreementActivity = 900 (CPL)This activity is used in normal Rule and Rule=MAN_ATP, in Location SubstitutionMeans of Transp.= 0001 (Truck)Business Event=SPACECheck Mode=SAPCEStartProduction=0 (Availability Check Only, No Production)Production Time=0 (After Executing all Basic Methods)Start Source Determination=0 Only Availability Check, No Source DeterminationSource Determination Method=0 No Check Against Contracts or Scheduling AgreementCalculation Profile 9000Calculation Profile is an attribute of Rule, location substitution function. Because this attribute is the most important point in the new MOQ requirement in R0811 release, a detailed description of calculation will be listed later in this chapter.APO Rule Attribute: Calculation ProfileCalculation Profile is an attribute of Rule, location substitution function. Because this attribute is the most important point in the new MOQ requirement in R0811 release, a detailed description of calculation profile is listed here.The key Calculation Profile attribute is field Allowed Delay Flag (DTOLL_FLG)Allowed Delay = SPACEWhen Allowed Delay is SPACE (see following screen shot), it means the system will always allow delay, whatever how long the delay is.

This is also the configuration before R0811, it means, even there are several possible storage location can be selected, the system will try to arrange the delivery from the first location, the system dont care how longer delay is. Since the sequence of storage location is determined by quota management, this setting can be see as a quota management priority strategy.In theory, if the first storage location can not meet the required quantity even we consider all future delivery plan, the second or third storage might be picked up, but this can never happen in practice, because suppliers delivery plan will cover more than half a year in the further and EMS will never order such big amount of quantity. As a result, when this Allowed Delay flag is set to SPACE, the first quota ranked storage location (in the rule location substitution list, it is the last one) will be always be pickedThe GATP check result will be something like following screen shot:

Allowed Delay = XWhen Allow Delay is enabled, it means if the delay is larger than specified time length; the system will try to look to other locations. If you set the Allowed Delay = 0 day, it means the system will not allow delay at all, it put the delivery time as first priority.

If we would like to put the delivery on time as the most important thing, this setting is suitable. This setting need to be used together with the number of days of allowed delay. A side effect of this setting is: the order will get unconfirmed if no storage location can meet the required delivery date since no unlimited push out is acceptable.The GATP check result will be something like following screen shot:

GATP Check for different materialFor different material, SEMC use different MRP profile (CPL1,CPL2,CPL3) to define different ATP check.MRP Profile in ERPCPL1,CPL2,CPL3 are special SEMC MRP Profile value of material master data, it is used to control ATP Check attributeIn transaction code MM03, MRP Profile attribute can be found via menu Environment->MRP Profile->Display.MRP Profile=CPL1Short text=RLT ATPMRP Profile: CPL1 -> strategy group: 40, Availability check: ZSCheck mode: 050Scope of check: ZSCPL1 is to just check SEMC stock and SEMC Consignment stock, no Suppliers Delivery Plan is considered, but the check horizon is checked, which means after the replenishment lead time, all requirement will be confirmed, there will not be a case that the sales item is unconfirmed.This setup is for End of Life components, the selling of this kind of product just happen occasionally.In this case, location substitution is used, but the 1st quota ranked storage location (the last storage location in rule location substitution list) will be always picked.MRP Profile=CPL2Short text=gATPMRP Profile: CPL2 -> strategy group: 40, Availability check: ZTCheck mode: 050Scope of check: ZTThis is the normal case, most CPL components material is setup this way. The system will check as well as Suppliers Delivery Plan.MRP Profile=CPL3Short text=gATP with sales allocationMRP Profile: CPL3 -> strategy group: Z2, Availability check: ZTCheck mode: 041Scope of check: ZTThis CPL3 is a complete ATP Check, originally designed for normal CPL components materials, compared with CPL2, sales allocation check is performed additionally. However, the sales allocation check logic is not accepted by the business yet, so this CPL3 is not really used nowadays.Customizing in ERP (only function when APO is down)Checking Group in ERPDefinition of Checking GroupIMG->SD->Basic Function->Availability Check->Availability Check with ATP Logic or Against Planning->Define Checking Groups

MTVFPChecking Group for Availability CheckZSZT

BEZEIDescriptionSell from stockCPL ATP

SUMAUTotal sales order requirementsAA

SUMLFTotal delivery requirementsAA

ACENQMaterial block in availability check with transfer of qtiesXX

VERPNNo availability checkSPACESPACE

ONVBAAvailability check with cumulative, confirmed quantities33

RELREAvailability with cum. quantities: Response to shortfall11

KZRVPIndicator for relevance during check against planning11

Availability Check Control of ZT

Strategy group in ERPStrategy Group = 40 (Planning with final assembly) Main strategy = 40 (Planning with final assembly) Reqmt type of customer reqmt = 050 (Sales order with consumption) Requirement class = 050 (Warehouse consumpt.) Availability = X Req. transfer = X Allocation ind. = 1 Prod. Allocation = XStrategy Group = Z2 (Planning without final assembly CPL) Main strategy = Z2 (Planning without final assembly CPL) Reqmt type of customer reqmt = 041 (Order/delivery requirement) Requirement class = 041 Availability = X Req. transfer = X Allocation ind. = X Prod. Allocation = SPACEATP Group in APOATP Group is equivalent to MRP Profiles Check Scope, it defines the Inbound and Outbound Item during ATP Check.ATP Group = ZSFor CPL1ATP Group AttributeIMG->APO->GATP->Product Availability CheckATP Group=ZS (Sell from stock)Cumulation=3 (Reqmt Quantity When Creating, Confirmed Qty When Changing)Response=1 (Output of information)Bucket Logic= (Conservative)ATP Check Control for ZSIMG->APO->GATP->Product Availability Check->Maintain Check Control

Please notice the attribute Consider Check Horizon, the system will use the Check Horizon attribute in product master to calculate the ATP check result.

For sales orderATP Group=ZSBusiness Event=A (SD Order)No subloc.check=XNo version ck=SPACENo Char. Check=SPACEConsider CH=X Confirmation at Checking HorizonRcpts fr. Past=Consider past receiptsChking.hor.:GR=SPACESegment:Inexact=SPACEConsider Pegging=Neither Manually nor Automatically Fixed PeggingEnhdConfrmLogic=SPACEATP Check Control: Scope of Check: CategoryAAProcess Order (Created)ABProcess Order (Released)ACProduction Order (Created)ADProduction order (released)AEProject Order (Created)AFProject Order (Released)AHAdvanced Shipping NotificationAVOrder reservation withdrawableAXOrder reservation withdrawableBIStock transport orderBJSuppliers' SchdlngAgrmtRqmtBKCustomer inquiryBLCustomer quotationBMSales orderBNSD scheduling agreementBOScheduling agreement w/external servicesBPContractBQDelivery w/o chargeBRDeliveryBSIndependent requirementsBTReturns deliveryCAStock in transfer (location to location)CCValuated, unrestricted-use stockCDValuated, unrestr.-use consignment stockCNStock in transfer (subloc. to subloc.)COMaintenance order (created)CPMaintenance order (released)For delivery orderATP Group=ZSBusiness Event=B (SD delivery)No subloc.check=SPACENo version ck=SPACENo Char. Check=SPACEConsider CH=No Checking HorizonRcpts fr. Past=Consider past receiptsChking.hor.:GR=SPACESegment:Inexact=SPACEConsider Pegging=Neither Manually nor Automatically Fixed PeggingEnhdConfrmLogic=SPACEATP Check Control: Scope of Check: CategoryAAProcess Order (Created)ABProcess Order (Released)ACProduction Order (Created)ADProduction order (released)AEProject Order (Created)AFProject Order (Released)AHAdvanced Shipping NotificationAUOrder reservation not withdrawableAVOrder reservation withdrawableAWOrder reservation not withdrawableAXOrder reservation withdrawableBHStock transport requisitionBIStock transport orderBJSuppliers' SchdlngAgrmtRqmtBRDeliveryBTReturns deliveryCAStock in transfer (location to location)CCValuated, unrestricted-use stockCDValuated, unrestr.-use consignment stockCNStock in transfer (subloc. to subloc.)COMaintenance order (created)CPMaintenance order (released)ATP Group = ZT, For CPL2CPL3ATP Group AttributeIMG->APO->GATP->Product Availability CheckATP Group=ZT (CPL ATP)Cumulation=3 (Reqmt Quantity When Creating, Confirmed Qty When Changing)Response=1 (Output of information)Bucket Logic= (Conservative)ATP Check Control for ZTIMG->APO->GATP->Product Availability Check->Maintain Check Control

For sales orderATP Group=ZTBusiness Event=A (SD Order)No subloc.check=XNo version ck=SPACENo Char. Check=SPACEConsider CH=No Checking HorizonRcpts fr. Past=Consider past receiptsChking.hor.:GR=SPACESegment:Inexact=SPACEConsider Pegging=Neither Manually nor Automatically Fixed PeggingEnhdConfrmLogic=SPACEATP Check Control: Scope of Check: CategoryBMSales orderBRDeliveryCCValuated, unrestricted-use stockCDValuated, unrestr.-use consigment stockSRSafety Stock as RequirementZ4CPL: Delivery-production planFor Delivery ATP Group=ZTBusiness Event=B (SD delivery)No subloc.check=SPACENo version ck=SPACENo Char. Check=SPACEConsider CH=No Checking HorizonRcpts fr. Past=Consider past receiptsChking.hor.:GR=SPACESegment:Inexact=SPACEConsider Pegging=Neither Manually nor Automatically Fixed PeggingEnhdConfrmLogic=SPACEATP Check Control: Scope of Check: CategoryBMSales orderBTReturns deliveryCCValuated, unrestricted-use stockCDValuated, unrestr.-use consigment stockSRSafety Stock as RequirementPlease notice, in delivery process, no Delivery Plan is considerred.Check Category Z4Z4 is a special ATP Category, it is for suppliers delivery plan. Category=Z4Category Text=SupplyCat Description=CPL: Delivery-production planSort String=23Category Type=1 (Receipts)Relevnt Subloc.=SPACEThis category is linked with Planning Area=SEMC_CPL_SNP01, so this item can be changed by process the planning book of the planning area.

Check Instruction in APOCheck mode 050Used in CPL1 and CPL2, only Product Check is includedCheck mode=050 (Warehouse consumption)Business event = A (SD order)Product Check = 1 First stepProduct allocation= 0 No CheckForecast= 0 No CheckCheck mode 041Used in CPL3, Product Check and Product Allocation Check are includedCheck mode=041 (Order/delivery reqmt)Business event = A (SD order)Product Check = 2 Second stepProduct allocation= 1 First stepForecast= 0 No CheckCPL3: Product Allocation Setup in APOProduct Master data in APOThe Allocation Procedure is 9000

Allocation ProcedureAllocation Procedure=9000 Step Sequence: Step 10Product Allocation Group = 9000, Wild char = 9 Control: Object = 9000, Object Description = CPLIn APO product master, this Allocation Procedure attribute is maintained under ATP ViewAllocation GroupProd. Alloc. Grp=9000Check planning area = XUse config. Char= SPACECheck DateComm.structure = MCVBEPCheck Date = LFDATTime bkts prfl= W (Week)CharacteristicKONOBProduct allocation objKUNNRSold to partyMATNRProductConnection between Allocation Group and Planning AreaProduct Allocation Group = 9000Planning Area= SEMC_CPL_GATPPlanning version= 000Time bucket profile= WCharacteristicsCharInfoObjectKONOB9AKONOBKUNNRZACUSTOMMATNRZATPMATNRKey FigureKey figureInfoObjectAEMENGEZCPLATP02KCQTYZCPLATP01MOQ Requirement in GATP CheckOriginal MOQ SolutionFor Sales Order Type=ZCSO, when the Delivery Priority is the default value (02), the system will pick the last Storage Location from the location substitution list. Because there is a one to one mapping relationship between the storage location and supplier, the determination of the storage location means the source determination by quota management.For each material and supplier combination, there is a minimum purchase quantity (MPQ) maintained in the vendor material info-record. Since CPL sales order also implies a purchase from supplier, this MPQ should be used as minimum order quantity (MOQ) in the sales order. Therefore, the order quantity of the sales order will be adjusted to multiple times of MOQ.Figure: MPQ information in product master data:

Please notice, for a material, different supplier will have different MPQ, so the MOQ of the sales order can not be fixed until the supplier is determined. In another words, MOQ can only be decided after the storage location determination.In the original MOQ solution, because we put the fair supplier quota as the first priority, storage location is determined before MOQ calculation.New MOQ Solution Requirement in R0811The new MOQ requirement is a revise of original requirement. Our business wants to put delivery time as a higher priority. In the new requirement, the system should try to avoid push out, in ATP check, storage location will be checked according to the quota management sequence, if a storage location can meet the required delivery date, it will be picked, otherwise the system checks next storage. So this requirement can be considered as delivery first priority, quota management second priority.The biggest challenge of this requirement is MOQ calculation. Technically, we can only check if a storage can meet request delivery date or not after the rounded required quantity is determined. Rounded quantity is based on MOQ calculation, so knowing MOQ is a precondition of storage location determination, but MOQ is storage location specific, MOQ can not be decided before storage location can be determined. To break above dead loop, we can try to use the least common multiple (LCM) of all MPQs of different suppliers (regardless availability situation) as the MOQ of CPL sales order. We call this LCM value as CPL MOQ. In this case, MOQ is decided first, so required quantity is known, with this value, the system can do storage location determination.The negative impact of above CPL MOQ method is, in some special case, the CPL MOQ value can be very large, it will make the sales not reasonable. To avoid this problem, our business adjusted the MOQ requirement as following:If the original ordered quantity is a multiple of CPL MOQ, this required quantity will be used to check the storage locations in the right sequence, the first one that meet the required delivery date is picked.If the original ordered quantity is NOT a multiple of CPL MOQ, storage location will be fixed to the right one by quota based location selection. The required quantity will be rounded to a multiple of MPQ of this selected storage location. In another words, in this case, original MOQ solution logic is used.Notice, the new requirement only apply for CPL2 and CPL3 materials, for CPL1 material, our business don't want to see unconfirmed sales items, so the storage location is selected only by quota information.Example of CPL MOQ calculation

Figure: Location determination procedure for the matierial 1200-1097.1

Figure: MPQ of location C1036 is 15000

Figure: MPQ of location C1014 is 5000

Figure: MPQ of location C1061 is 2000From above screen shots, we can get CPL MOQ by least common multiple caculation:CPL MOQ= LCM(15000,5000,2000) =30000Solution to the new requirementThe solution to the new requirement is not complex in logic. As described in previous chapter of this document, the Calculation Profile used in rule mater data plays an important role in GATP check.The flag "Allow delay flag" controls if push out is allowed or not, basically, if we set it to SPCAE, that is the original solution of MOQ: fix the storage location by quota information. If we set it to X, it is the delivery first priority strategy.So the solution is to set this "Allow delay flag" dynamically via user exit, by doing this, we can decide delivery priority is used or quota priority is used by checking order quantity. The logic: 1, Evaluate the ordered quantity and suppliers MPQ, decide which strategy is used. This is done in BADI method IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN 2, Set calculation profile attribute dynamically according to the strategy. This is done in user exit EXIT_/SAPAPO/SAPLATPR_002 Activate R/3 SD UE user exit USEREXIT_CATALOG_VALUE in program SAPFV45V and append MRP profile to the KOMGO structure and use this in the BADI method IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN to decide the global class attribute used in UE EXIT_/SAPAPO/SAPLATPR_002

CPL sales order (QA consumption) data Flow: ERP BW APOData FlowERPReport ZSR0068RTable ZBW001Extract structure ZOXTTC0076Data Source ZBW_001BWData Source ZBW_001Info Source ZLOGINF01DSO ZLOODS1

Update Rule from InfoSource= ZLOGINF01 to DSO= ZLOODS1:ZSO_K01SO Received IF COMM_STRUCTURE-/bic/zprclvl = 400. RESULT = COMM_STRUCTURE-/bic/zgr_qty. ELSE. RESULT = ''. ENDIF.

InfoSource=ZLOGINF01 fields in Communication StructureInfoObjectDescriptionFieldZPRCLVLProcessing status/bic/zprclvlZREQ_QTYRequested Quantity/bic/zreq_qty0CONF_QTYConfirmed qty.conf_qtyZGR_QTYGoods Reciept Qty/bic/zgr_qtyDataSource=ZBW_001 fieldsInfoObjectData Source FieldZPRCLVLZZTTCLVLZREQ_QTYWMENGZGR_QTYWEMNG 0CONF_QTYBMENGInfoSource Field vs. DataSourceFieldInfoSource FieldDataSource Field/bic/zprclvlZZTTCLVL/bic/zreq_qtyWMENGconf_qtyWEMNG/bic/zgr_qtyBMENGData Source 8ZLOODS1APODataSource 8ZLOODS1Source System=P26CLNT800InfoSource ZLOODS1Info Cube ZCPL_SO01

Info Spoke Z2QACONSUMPTION

Data Source=ZCPL_S001Destination=Z2QACONSUExtraction Mode=FullDB Table=/BIC/OHZ2QACONSUQuota Arrangement in APOTcode=/SAPAPO/SCC_TQ1 (Menu Path=APO->Master Data->Quota Arrangement), can display Quota Arrangement dataTo checked the details, do the following selection: Model = 000 Location= [EMS] Version-Dependent =X Plng Version=000 Inbound Quota Arrangement=X

Table /BIC/OHZ2QACONSUProgram Z2GATP_UPDATE_LOC_W_QAThis program is called by the background job periodically (every 6 hours) to update the location sequence in GATP rule, location substitution area. The new sequence is caculated based on the supplier quota rank, so the result of the program execution is to do the source dertermination according to quota management result.Special Fields /SAPAPO/LOCIn location master data in APO, there are some special SEMC fields.Fields\Location TypeEMS PlantComponent Supplier (MRP Area)VendorHub Plant (CNHK)Customer

ATTLO04Customer NumberVendor Number

ATTLO05

/SAPAPO/MATLOCIn APO, location specific product master, there are some fields with special usage in SEMC CPL logic: AT101AT102AT103AT104Indicate if it is CPL Component AT105BESKZProcurement TypeLVORMDeletion flagInfo Spoke table /BIC/OHZ2QACONSUTable for Open Hub Destination Z2QACONSU, this table contains the sales order statistical information that can be used to do the quota rank caculation, the data is orginated in Sales order report in the ERP system. Sales order report in ERP gets the data, pass it to BW system, then pass it to this table in APO system.OHREQUID

DATAPAKID

RECORD

SALES_UNIT/BI0/OISALES_UNITSales unit

/BI0/9ALOCFROM/BI0/9AOILOCFROMAPO Start Location

/BI0/9ALOCTO/BI0/9AOILOCTOAPO Destination Location

/BI0/9AMATNR/BI0/9AOIMATNRAPO Product

/BI0/9AVERSION/BI0/9AOIVERSIONAPO - Planning Version

CALDAY/BI0/OICALDAYCalendar Day

CALWEEK/BI0/OICALWEEKCalendar Year/Week

/BIC/ZSO_K01/BIC/OIZSO_K01S.O. Received

/BIC/ZSO_K02/BIC/OIZSO_K02S.O. In Process

/BIC/ZSO_K03/BIC/OIZSO_K03S.O. Shipped

Program LogicHere is the simplified program logic about Rule updating. Get_md_td Sum_target_skus Get_qa Get_current_quota Check_td_md Qa_sum_table Calculation_table At104_filter Global_md_create Create_allocate_rule Gatp_update BAPI_LSPSRVAPS_SAVEMUJLTI BAPI_RULESRVAPS_SAVEMULTI Create_condition_global Calculate_global_deviation Update_gatp_md_global Get_condition_global Gatp_updateSelection Screen

P_ACTIVLocation determin. activityP_CALCCalculation profileP_CR_MDCreate master data gATPP_FORCEForce header rule updateP_GLOBALGlobal EMS QAs (collective)P_LOGSYSLogical systemP_LONGForce long material 2 seq numbP_REPORTReportP_RULERule controlS_DATESDate range for actual QA consS_LOCNOTarget EMS location rangeS_MATNRMaterial range(* w/ select)S_SELESelectionImportant modulesGet_condition_globalGatp_updateUpdate_gatp_md_globalGet_qaImportant variablesIT_Z2QACONSUIT_CONSUMPTIONIT_CONSUMPTION_GLOBALIT_SUM_ACTIT_SUM_REQIT_QAHIT_QAPIT_EMSUsing Program Z2GATP_UPDATE_LOC_W_QAProcess Chain CPL_GATP_MD

Process Chain CPL_GATP_MD StepsStepProgramVariant

Z2GATP_UPDATE_LOC_W_QACPL 01

Z2GATP_UPDATE_LOC_W_QACPL 02

Z2GATP_UPDATE_LOC_W_QACPL 03

Z2GATP_UPDATE_LOC_W_QACPL 04

Z2GATP_UPDATE_LOC_W_QACPL 05

Z2GATP_UPDATE_LOC_W_QACPL 06

Z2GATP_UPDATE_LOC_W_QACPL 01_LONG

Z2GATP_UPDATE_LOC_W_QACPL 02_LONG

Z2GATP_UPDATE_LOC_W_QACPL 03_LONG

Z2GATP_UPDATE_LOC_W_QACPL 04_LONG

Z2GATP_UPDATE_LOC_W_QACPL 05_LONG

Z2GATP_UPDATE_LOC_W_QACPL 06_LONG

Z2GATP_UPDATE_LOC_W_QACPL 07_LONG

Z2GATP_UPDATE_LOC_W_QACPL 08_LONG

Z2GATP_UPDATE_LOC_W_QACPL 09

Z2GATP_UPDATE_LOC_W_QACPL 10

Z2GATP_UPDATE_LOC_W_QACPL 11

Z2GATP_UPDATE_LOC_W_QACPL 12

Z2GATP_UPDATE_LOC_W_QACPL 13

Z2GATP_UPDATE_LOC_W_QACPL 14

Z2GATP_UPDATE_LOC_W_QACPL 15

Z2GATP_UPDATE_LOC_W_QACPL 16

Z2GATP_UPDATE_LOC_W_QACPL 17

Z2GATP_UPDATE_LOC_W_QACPL 18

Z2GATP_UPDATE_LOC_W_QACPL 19

Z2GATP_UPDATE_LOC_W_QACPL 20

Z2GATP_UPDATE_LOC_W_QACPL 21

Z2GATP_UPDATE_LOC_W_QACPL 22

Z2GATP_UPDATE_LOC_W_QACPL 23

Z2GATP_UPDATE_LOC_W_QACPL 24

Z2GATP_UPDATE_LOC_W_QACPL 25

Z2GATP_UPDATE_LOC_W_QACPL 26

Z2GATP_UPDATE_LOC_W_QACPL 28

Z2GATP_UPDATE_LOC_W_QACPL 29

Z2GATP_UPDATE_LOC_W_QACPL 30

Z2GATP_UPDATE_LOC_W_QACPL 31

Z2GATP_UPDATE_LOC_W_QACPL 32

Z2GATP_UPDATE_LOC_W_QACPL 33

Z2GATP_UPDATE_LOC_W_QACPL 34

Z2GATP_UPDATE_LOC_W_QACPL 27

AQZZAPO_REPORTS=Z2GATP_MD=====MONITOR_1025

Program Variant CPL 01

CPL 02

CPL 01_LONG

CPL 09

CPL 27

Delivery Plan Data FlowAbout 4A5 Message ReceivingPIP 4A5 message is the supplier delivery plan, APO system receives this message via inbound IDOC with message type PBAPS_CHANGEKEYFIGUREVALUE. It will update key figure ZCPLSNP08 of planning area SEMC_CPL_SNP01, which is the baseline of the item Delivery Plan in GATP check scope.Message Type= PBAPS_CHANGEKEYFIGUREVALUEPlanning Book=CPL_TH_EX Data View=925Characterisitic=9AMATNRCharacterisitic=9ALOCNOKey Fig=ZCPLSNP08 Partner Profile Definition

Message Function=T1 is the one for 4A5 inbound message.Result of Receiving 4A5 messageThe result of receiving this message is: Key figure ZCPLSNP08 (Delivery Plan) is updated in planning area SEMC_CPL_SNP01. The result can be verified by checking planning book CPL_TH_EX, data view 925.

From 4A5 message to delivery PlanOn every Satursday, the process chain CPL_RNET_4A5_IB is performed.The step RELEASE DELIVERY PALN TO LC ORD will run the Macro DELIVERY PLAN TO DEPLOY.This logic of Macro can be simplified asLC Delivery plan = Delivery Plan + Delivery Plan adjustment + Delivery Plan / 100 * Delivery plang % adjustment

9APPROD= ZCPLSNP08 + ZCPL_DP14 + ZCPLSNP08 / 100 * ZCPL_DP18

This key Figure 9APPROD is just the element of ATP Category Z4, which is Delivery Plan, it will be used in GATP check during sales order process.Product Allocation Data FlowThe generation of Product allocation information is also done in Satursdays process chain CPL_RNET_4A5_IB. In CPL_RNET_4A5_IB, there are following related steps: 1. Key figure LC Delivery Plan (9APPROD) is caculated based on inbound supplier 4A5 message and adjustment value. 2. Above result is released to planning area=SEMC_CPL_DP01, key figure=ZCPL_DP15. 3. Planning area SEMC_CPL_SNP01s key figure 9APSHIP (Distr. Receipt (Plnd)) is also released to planning area=SEMC_CPL_DP01, key figure=ZCPL_DP13, this is the EMS demand value for the component material. key figure=ZCPL_DP16 is caculated in planning area=SEMC_CPL_DP01, it is ZCPL_DP13 plus adjustment value. Key figure ZCPL_DP17 in planning area=SEMC_CPL_DP01 is caculated, the system first aggregate key figure value of ZCPL_DP15 into material Level, then disaggregate it to ZCPL_DP17 using the same disaggregation proportion as key figure ZCPL_DP16. This means, the system uses fair share principle to allocate delivery plan to each EMS according to their requirement quantity. Key figure ZCPL_DP17 in planning area=SEMC_CPL_DP01 is copied to planning area= SEMC_CLP_GATP, key figure=ZCPL_DP13. Key figure ZCPL_ATP01 in planning area SEMC_CPL_GATP is caculated based on ZCPL_DP13 plus adjustement value.In the end, key figure ZCPL_ATP01 is caculated, that value is used in product allocation check for CPL3 material during CPL Sales order process.Trouble Shooting by DebuggingOverviewThe GATP functional in APO is used by following order process: Sales Order Outbound Delivery Stock Transfer OrderThe sales order scheduling and ATP check is the most complex usage, sometimes we have to use debug tool to analyze problems.Two typical problems may happened during sales order scheduling and ATP check: The scheduling result seems not correct The MOQ result or the storage location determination result seems not correct.APO GATP usage during Sales Order maintenance ERP calls APO two times, according the the time sequence: The first RFC call is to do Scheduling Calcuation, that is to perform Backward and/or Forward Scheduling, derives delivery date/time, loading date/time, good issue date/time, material availability date/time. The second RFC call is to perform Availability Check by GATP functionality, SEMC MOQ Solution and storage location determination will be used here.Scheduling CalculationCall Stack in ERP, RFC call10RFCAPO_SCHEDULINGSAPLV03C_APOINT

9FUNCTIONAPO_SCHEDULINGSAPLV03C_APOINT

8FORMVERSANDTERMINIERUNG_NEUSAPFV45V

7FORMMVERF_AUFBAUEN_WMENGSAPFV45V

6FORMMVERF_AUFBAUENSAPFV45V

5FORMVERFUEGBARKEIT_PRUEFENSAPFV45V

4FORMBESTAND_BEDARF_ABGLEICHENSAPFV45V

3FORMVBAP_BEARBEITEN_ENDE_VERFUEGBSAPFV45P

2FORMVBAP_BEARBEITEN_ENDESAPFV45P

1MODULE (PAI)VBAP_BEARBEITEN_ENDESAPMV45A

ATP CheckCall Stack in ERP, RFC call 11FORMAVAILABILITY_CHECK_APOSAPLATPC

10FUNCTIONAVAILABILITY_CHECKSAPLATPC

9FUNCTIONAVAILABILITY_CHECK_CONTROLLERSAPLATPC

8FORMMVERF_PRUEFENSAPLV03V

7FUNCTIONRV_AVAILABILITY_CHECKSAPLV03V

6FORMMVERF_PRUEFENSAPFV45V

5FORMVERFUEGBARKEIT_PRUEFENSAPFV45V

4FORMBESTAND_BEDARF_ABGLEICHENSAPFV45V

3FORMVBAP_BEARBEITEN_ENDE_VERFUEGBSAPFV45P

2FORMVBAP_BEARBEITEN_ENDESAPFV45P

1MODULE (PAI)VBAP_BEARBEITEN_ENDESAPMV45A

Notice: The RFC to do ATP check in APO is AVAILABILITY_CHECK_APO, the RFC to do Scheduling caculation in APO is APO_SCHEDULING, they are called seperately by ERP, the form SAPFV45V-VERFUEGBARKEIT_PRUEFEN initiates both checks.In FORM=VERFUEGBARKEIT_PRUEFEN, subroutine MVERF_AUFBAUEN is performed before MVERF_PRUEFEN, that is, Scheduling caculation is performed before GATP Check.Call Stack In APO, MOQ Enhancement

6ZCL_IM_2GATPMETHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN

5CL_EX_APO_BAPI_BUS10400METHODIF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN

4SAPL10400FUNCTION BAPI_APOATP_CHECK

3SAPL10400FORMBAPI_APOATP_CHECK

2SAPMSSY1FORMREMOTE_FUNCTION_CALL

1SAPMSSY1MODULE (PBO)%_RFC_START

Call Stack In APORule Execution12/SAPAPO/SAPLATPRFUNCTION/SAPAPO/ATP_RULES_EVALUATE

11/SAPAPO/CL_ATPT_CONTROLLER====CPMETHODRULES_GET

10/SAPAPO/CL_ATPT_REQ===========CPMETHODPROCESS_RULES_IMMEDIATELY

9/SAPAPO/CL_ATPT_REQ_GRP=======CPMETHODPROCESS_RULES_IMMEDIATELY

8/SAPAPO/CL_ATPT_REQ_GRP=======CPMETHODSET_FROM_INTERFACE

7/SAPAPO/SAPLATPTFORMTREE_ANCHORS_CREATE

6/SAPAPO/SAPLATPTFUNCTION/SAPAPO/CHECK_AVAILABILITY

5/SAPAPO/SAPLATPTFUNCTION/SAPAPO/AVAIL_CHECK_CONTROLLER

4SAPL10400FUNCTIONBAPI_APOATP_CHECK

3SAPL10400FORMBAPI_APOATP_CHECK

2SAPMSSY1FORMREMOTE_FUNCTION_CALL

1SAPMSSY1MODULE (PBO)%_RFC_START

R3 Delivery -> APO GATPCall Stack in ERP, RFC Call13SAPLATPCFUNCTIONAVAILABILITY_CHECK

12SAPLATPCFUNCTIONAVAILABILITY_CHECK_CONTROLLER

11SAPLV03VFORMMVERF_PRUEFEN

10SAPLV03VFUNCTIONRV_AVAILABILITY_CHECK

9SAPLLE_ATP_CHECKFORMVERFUEGBARKEIT_PRUEFEN

8SAPLLE_ATP_CHECKFUNCTIONLE_ATP_CHECK_SINGLE

7SAPFV50PFORMVERFUEGBARKEIT_PRUEFEN_NEU

6SAPFV50PFORMLIPS_PRUEFEN

5SAPFV50PFORMLIPS_BEARBEITEN

4SAPFV50CFORMLIPS_KOPIEREN

3SAPFV50CFORMVORLAGE_KOPIEREN

2SAPMV50AFORMAUFTRAG_REFERIEREN

1SAPMV50AMODULE (PAI)AUFTRAG_REFERIEREN

Call Stack in ERP, Check CIF16SAPLATPCFORMCIF_IMOD_DESTINATIONS_ATPCHECK

15SAPLATPCFORMDATA_COLLECT_APO

14SAPLATPCFUNCTIONAVAILABILITY_CHECK

In Form CIF_IMOD_DESTINATIONS_ATPCHECK, Func= OUTBOUND_CALL_01000803_P is called to get if APOGATP should be used.Using APO or ERP to do ATP check is determined by the CIF integration model, if active integration model existed for the material/plant combination, APO will be used, otherwise ATP check in ERP will be used.Call Stack in APO, EMC MOQ Enhancement6ZCL_IM_2GATPMETHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN

5CL_EX_APO_BAPI_BUS10400METHODIF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN

4SAPL10400FUNCTION BAPI_APOATP_CHECK

3SAPL10400FORMBAPI_APOATP_CHECK

2SAPMSSY1FORMREMOTE_FUNCTION_CALL

1SAPMSSY1MODULE (PBO)%_RFC_START

Compared with sales order processing, the same function is called during delivery ATP check. However, in class method ZCL_IM_2GATP->IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN , the MOQ logic only works for Business Event=A (Sales Order), so MOQ enhancement has not impact to delivery ATP check.Notice, in delivery ATP check, suppliers delivery plan is not considered, so if there is no enough Stock in the hub, the delivery may not be confirmed.Rule Simulation in APOThere is a very useful function in APO rule maintenance, we can use the simulation function to check if the location substitution data is maintained correctly.We can also set a break point in Func=/SAPAPO/ATP_RULES_EVALUATE, to do trouble shooting if problem occurs.

Page 43 of 43