Author: Cliff Liu (Version 1.0 edit by Geng Ren) Version: 1.0
Page 2 of 43 1 Overview ....................................................................................... 3 1.1 GATP Usage In SEMC CPL ................................................................... 3 1.2 Data Source of Delivery Plan ................................................................. 4 1.3 Data Source of Product Allocation Quantity ............................................ 4 2 Configuration of Rule based ATP Check ................................... 5 2.1 Configuration in ERP .............................................................................. 5 2.1.1 Rule based GATP Check for sales orders .............................................. 5 2.1.2 CIF Setup for GATP function .................................................................. 5 2.2 Configuration in APO ............................................................................. 5 2.2.1 Configuration of Rule Determination ....................................................... 5 2.2.2 Condition Table Technical Detail ............................................................ 6 2.3 Rule Master Data ................................................................................... 7 2.3.1 Rule Determination ................................................................................ 7 2.3.2 Rule Maintenance .................................................................................. 7 2.4 APO Rule Attribute: Calculation Profile ................................................ 10 2.4.1 Allowed Delay = SPACE ...................................................................... 10 2.4.2 Allowed Delay = X ................................................................................ 11 3 GATP Check for different material ........................................... 12 3.1 MRP Profile in ERP .............................................................................. 12 3.1.1 MRP Profile=CPL1 ............................................................................... 12 3.1.2 MRP Profile=CPL2 ............................................................................... 13 3.1.3 MRP Profile=CPL3 ............................................................................... 13 3.2 Customizing in ERP (only function when APO is down) ....................... 13 3.2.1 Checking Group in ERP ....................................................................... 13 3.2.2 Strategy group in ERP.......................................................................... 15 3.3 ATP Group in APO ............................................................................... 16 3.3.1 ATP Group = ZSFor CPL1 ................................................................ 16 3.3.2 ATP Group = ZT, For CPL2CPL3 ..................................................... 19 3.4 Check Instructuion in APO ................................................................... 21 3.4.1 Check mode 050 .................................................................................. 21 3.4.2 Check mode 041 .................................................................................. 21 3.5 CPL3: Product Allocation Setup in APO ............................................... 22 3.5.1 Product Master data in APO ................................................................. 22 3.5.2 Allocation Procedure ............................................................................ 22 3.5.3 Allocation Group................................................................................... 22 3.5.4 Connection between Allocation Group and Planning Area ................... 23 4 MOQ Requirement in GATP Check .......................................... 23 4.1 Original MOQ Solution ......................................................................... 23 4.2 New MOQ Solution Requirement in R0811 .......................................... 24 4.2.1 Example of CPL MOQ caculation ......................................................... 25 4.3 Solution to the new requirement ........................................................... 26 5 Vendor Quota Data Flow: ERP BW APO ............................ 27 5.1 Data Flow ............................................................................................. 27 5.1.1 ERP ..................................................................................................... 27 5.1.2 BW ....................................................................................................... 27 Page 3 of 43 5.1.3 APO ..................................................................................................... 28 5.2 Program Z2GATP_UPDATE_LOC_W_QA ........................................... 31 5.2.1 Special Fields ....................................................................................... 31 5.2.2 Info Spoke table /BIC/OHZ2QACONSU ............................................... 31 5.2.3 Program Logic ...................................................................................... 32 5.3 Using Program Z2GATP_UPDATE_LOC_W_QA ................................. 34 5.3.1 Process Chain CPL_GATP_MD ........................................................... 34 6 Delivery Plan Data Flow ............................................................ 39 6.1 About 4A5 Message Receiving ........................................................... 39 6.1.1 Message Type= PBAPS_CHANGEKEYFIGUREVALUE ...................... 39 6.1.2 Partner Profile Definition ...................................................................... 39 6.1.3 Result of Receiving 4A5 message ........................................................ 40 6.2 From 4A5 message to delivery Plan ..................................................... 40 7 Product Allocation Data Flow ................................................... 40 8 Trouble Shooting by Debugging .............................................. 41 8.1 Overview .............................................................................................. 41 8.2 APO GATP usage during Sales Order maintenance .......................... 41 8.2.1 Scheduling Calculation ......................................................................... 41 8.2.2 ATP Check ........................................................................................... 41 8.3 R3 Delivery -> APO GATP ................................................................... 42 8.3.1 Call Stack in ERP, RFC Call................................................................. 42 8.3.2 Call Stack in ERP, Check CIF .............................................................. 42 8.3.3 Call Stack in APO, EMC MOQ Enhancement ....................................... 42 8.4 Rule Simulation in APO ........................................................................ 43
1 Overview 1.1 GATP Usage in SEMC CPL GATP Function is used in following document processing: CPL Sales Order Processing CPL Outbound Delivery Processing CPL Stock Transfer Order (Purchase Order) Process The major usage is in CPL Sales Order Process, the usage in delivery and stock transfer order is relative- ly 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. Tech- nically, this delivery plan is the PIP 4A5 message, a response to SEMCs 4A3 message (Gross re- quirement). 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 func- tion 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 re- Page 4 of 43 lationship 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. 1.2 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 sup- plier. 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 Stock Program Z2PROACT01 is called by background job, following key figures of planning area SEMC_CPL_SNP01 is read and 4A3 message is composed. ZCPLSNP06 Gross Requirement ZCPLSNP01 Min Stock DOS ZCPLSNP02 Max Stock DOS ZCPLSNP03 Min Stock Qty ZCPLSNP04 Max Stock Qty In 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. 1.3 Data Source of Product Allocation Quantity Product Allocation information is stored in Planning Area=SEMC_CPL_GATP, under two Key Figures: ZCPLATP01 Allocation Quantity ZCPLATP02 Consumed Allocation Quantity ZCPLATP01 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: 9AKONOB Prod. Alloc. Object ZACUSTOM Customer CPL ZATPMATNR APO Product GATP Page 5 of 43 2 Configuration of Rule based ATP Check 2.1 Configuration in ERP 2.1.1 Rule based GATP Check for sales orders Business 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 order 2.1.2 CIF Setup for GATP function Integration Model = HUB:GATP Tcode=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.
2.2 Configuration in APO Sale Order Type=ZCSO in normal case, the system (GATP functionality) will determine the storage loca- tion 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. 2.2.1 Configuration of Rule Determination 2.2.1.1 Assign Rule Strategy or Rule Strategy Sequence Tech Scenario Bus Tran Action Type Rule Strategy AA Z01 A 90000 AA Z01 B 90000 Page 6 of 43 AA Z01 C 90000 DD Z01 A 90000 Action Type: Create: AChange:BCopy:C Tech Scenario: Online dialog:AABatch input:BBEDI:DDBackorder processing:EE 2.2.1.2 Rule Strategy Strategy =90000 Rule Strat. Type =Inclusive Short text =CPL CType =9000
2.2.1.3 Condition Type CType =9000 (CPL) AccSq =9000 (CPL) 2.2.1.4 Access Sequence Access Sequence =9000 AcNo Table Short text Exclusive 0 904 Del. Prio X 1 903 Order type X 2 902 Product X 2.2.1.5 Table 904 Condition field Doc structure/field Label LPRIO /SAPAPO/KOMGO-LPRIO Delivery Priority 2.2.1.6 Table 903 Condition field Doc structure/field Label AUART /SAPAPO/KOMGO-AUART Order Type 2.2.1.7 Table 902 Condition field Doc structure/field Label MATNR /SAPAPO/KOMGO-MATNR Product 2.2.2 Condition Table Technical Detail In Condition Table we can find the Condition Number 2.2.2.1 /SAPCND/KOTO904 Kay field is Delivery Priority Therer are two records, for Delivery Priority=10 and 20 Condition Type Deliv Priority Cond.record no 1 9000 10 0000000050 2 9000 20 0000000051 2.2.2.2 /SAPCND/KOTO903 Key field is Order Type There is only one record, that is for Sales Order Type=ZCNP. Condition Type =9000 Order Type =ZCNP
2.2.2.3 /SAPCND/KOTO902 Key field is Product Page 7 of 43 This is the most common case GATP used in SMEC CPL sales order, there is a rule per material without version. 2.2.2.4 Rule Table /SAPAPO/RBA02 This is the database table of Rule 2.3 Rule Master Data 2.3.1 Rule Determination Menu Path in APO: SAP menu->APO->Master Data->Rule Maintenance->Display Rule Determination 2.3.2 Rule Maintenance Menu Path in APO: SAP menu->APO->Master Data->Rule Maintenance->Rule Maintenance 2.3.2.1 An example of a normal rule Rule=0000000083 Rule Type =I (inclusive) No of Substitutns =1 Product + Loc. Subst Loc.Determin. Proced. =0000000083 Rule 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 =9000 Allowed Delay Valid =SPACE (This means unlimit delay is allowed)
2.3.2.2 Special Rule=MAN_NO_ATP Rule=MAN_NO_ATP Rule Type =I (inclusive) No of Substitutns =1 Product + Loc. Subst Loc.Determin. Proced. =ALL_SUPP Rule 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_SUPP Location =CNHK Activity =[SPACE] Location =C1001 Activity =901 (No ATP or sales allocation) Location = Location = C1110 Activity =901 (No ATP or sales allocation) 2.3.2.3 Special Rule=MAN_ATP Rule=MAN_ATP Rule Type =I (inclusive) No of Substitutns =1 Product + Loc. Subst Loc.Determin. Proced. =ALL_SUPP2 Rule 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_SUPP2 Page 10 of 43 Location =CNHK Activity =[SPACE] Location =C1001 Activity = 900 (CPL) Location = Location = C1110 Activity = 900 (CPL) 2.3.2.4 Activity = 901 (No ATP or sales allocation) This activity is used in Rule=MAN_NO_ATP, in Location Substitution Means of Transp. =SPACE Business Event =A Check Mode =100 StartProduction =0 (Availability Check Only, No Production) Production Time =0 (After Executing all Basic Methods) Start Source Determination =0 Only Availability Check, No Source Determination Source Determination Method =0 No Check Against Contracts or Scheduling Agreement 2.3.2.5 Activity = 900 (CPL) This activity is used in normal Rule and Rule=MAN_ATP, in Location Substitution Means of Transp. = 0001 (Truck) Business Event =SPACE Check Mode =SAPCE StartProduction =0 (Availability Check Only, No Production) Production Time =0 (After Executing all Basic Methods) Start Source Determination =0 Only Availability Check, No Source Determination Source Determination Method =0 No Check Against Contracts or Scheduling Agreement 2.3.2.6 Calculation Profile 9000 Calculation 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. 2.4 APO Rule Attribute: Calculation Profile Calculation 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) 2.4.1 Allowed Delay = SPACE When Allowed Delay is SPACE (see following screen shot), it means the system will always allow delay, whatever how long the delay is. Page 11 of 43
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 deliv- ery 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 picked The GATP check result will be something like following screen shot:
2.4.2 Allowed Delay = X When 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. Page 12 of 43
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 or- der 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:
3 GATP Check for different material For different material, SEMC use different MRP profile (CPL1,CPL2,CPL3) to define different ATP check. 3.1 MRP Profile in ERP CPL1,CPL2,CPL3 are special SEMC MRP Profile value of material master data, it is used to control ATP Check attribute In transaction code MM03, MRP Profile attribute can be found via menu Environment->MRP Profile- >Display. 3.1.1 MRP Profile=CPL1 Short text =RLT ATP MRP Profile: CPL1 -> strategy group: 40, Availability check: ZS Check mode: 050 Scope of check: ZS Page 13 of 43 CPL1 is to just check SEMC stock and SEMC Consignment stock, no Suppliers Delivery Plan is consid- ered, 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 1 st quota ranked storage location (the last storage loca- tion in rule location substitution list) will be always picked. 3.1.2 MRP Profile=CPL2 Short text =gATP MRP Profile: CPL2 -> strategy group: 40, Availability check: ZT Check mode: 050 Scope of check: ZT This is the normal case, most CPL components material is setup this way. The system will check as well as Suppliers Delivery Plan. 3.1.3 MRP Profile=CPL3 Short text =gATP with sales allocation MRP Profile: CPL3 -> strategy group: Z2, Availability check: ZT Check mode: 041 Scope of check: ZT This CPL3 is a complete ATP Check, originally designed for normal CPL components materials, com- pared 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. 3.2 Customizing in ERP (only function when APO is down) 3.2.1 Checking Group in ERP Definition of Checking Group IMG->SD->Basic Function->Availability Check->Availability Check with ATP Logic or Against Planning- >Define Checking Groups
MTVFP Checking Group for Availability Check ZS ZT BEZEI Description Sell from stock CPL ATP SUMAU Total sales order requirements A A SUMLF Total delivery requirements A A ACENQ Material block in availability check with transfer of qties X X VERPN No availability check SPACE SPACE ONVBA Availability check with cumulative, confirmed quantities 3 3 RELRE Availability with cum. quantities: Response to shortfall 1 1 KZRVP Indicator for relevance during check against planning 1 1 Availability Check Control of ZT Page 14 of 43
Page 15 of 43
3.2.2 Strategy group in ERP Strategy 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 = X Strategy 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 = SPACE Page 16 of 43 3.3 ATP Group in APO ATP Group is equivalent to MRP Profiles Check Scope, it defines the Inbound and Outbound Item during ATP Check. 3.3.1 ATP Group = ZSFor CPL1 3.3.1.1 ATP Group Attribute IMG->APO->GATP->Product Availability Check ATP Group =ZS (Sell from stock) Cumulation =3 (Reqmt Quantity When Creating, Confirmed Qty When Changing) Response =1 (Output of information) Bucket Logic = (Conservative) 3.3.1.2 ATP Check Control for ZS IMG->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. Page 17 of 43
3.3.1.2.1 For sales order ATP Group =ZS Business Event =A (SD Order) No subloc.check =X No version ck =SPACE No Char. Check =SPACE Consider CH =X Confirmation at Checking Horizon Rcpts fr. Past =Consider past receipts Chking.hor.:GR =SPACE Segment:Inexact =SPACE Consider Pegging =Neither Manually nor Automatically Fixed Pegging EnhdConfrmLogic =SPACE ATP Check Control: Scope of Check: Category AA Process Order (Created) AB Process Order (Released) AC Production Order (Created) AD Production order (released) AE Project Order (Created) AF Project Order (Released) AH Advanced Shipping Notification AV Order reservation withdrawable AX Order reservation withdrawable BI Stock transport order Page 18 of 43 BJ Suppliers' SchdlngAgrmtRqmt BK Customer inquiry BL Customer quotation BM Sales order BN SD scheduling agreement BO Scheduling agreement w/external services BP Contract BQ Delivery w/o charge BR Delivery BS Independent requirements BT Returns delivery CA Stock in transfer (location to location) CC Valuated, unrestricted-use stock CD Valuated, unrestr.-use consignment stock CN Stock in transfer (subloc. to subloc.) CO Maintenance order (created) CP Maintenance order (released) 3.3.1.2.2 For delivery order ATP Group =ZS Business Event =B (SD delivery) No subloc.check =SPACE No version ck =SPACE No Char. Check =SPACE Consider CH =No Checking Horizon Rcpts fr. Past =Consider past receipts Chking.hor.:GR =SPACE Segment:Inexact =SPACE Consider Pegging =Neither Manually nor Automatically Fixed Pegging EnhdConfrmLogic =SPACE ATP Check Control: Scope of Check: Category AA Process Order (Created) AB Process Order (Released) AC Production Order (Created) AD Production order (released) AE Project Order (Created) AF Project Order (Released) AH Advanced Shipping Notification AU Order reservation not withdrawable AV Order reservation withdrawable AW Order reservation not withdrawable AX Order reservation withdrawable Page 19 of 43 BH Stock transport requisition BI Stock transport order BJ Suppliers' SchdlngAgrmtRqmt BR Delivery BT Returns delivery CA Stock in transfer (location to location) CC Valuated, unrestricted-use stock CD Valuated, unrestr.-use consignment stock CN Stock in transfer (subloc. to subloc.) CO Maintenance order (created) CP Maintenance order (released) 3.3.2 ATP Group = ZT, For CPL2CPL3 3.3.2.1 ATP Group Attribute IMG->APO->GATP->Product Availability Check ATP Group =ZT (CPL ATP) Cumulation =3 (Reqmt Quantity When Creating, Confirmed Qty When Changing) Response =1 (Output of information) Bucket Logic = (Conservative) 3.3.2.2 ATP Check Control for ZT IMG->APO->GATP->Product Availability Check->Maintain Check Control
3.3.2.2.1 For sales order ATP Group =ZT Business Event =A (SD Order) No subloc.check =X No version ck =SPACE No Char. Check =SPACE Consider CH =No Checking Horizon Page 20 of 43 Rcpts fr. Past =Consider past receipts Chking.hor.:GR =SPACE Segment:Inexact =SPACE Consider Pegging =Neither Manually nor Automatically Fixed Pegging EnhdConfrmLogic =SPACE ATP Check Control: Scope of Check: Category BM Sales order BR Delivery CC Valuated, unrestricted-use stock CD Valuated, unrestr.-use consigment stock SR Safety Stock as Requirement Z4 CPL: Delivery-production plan 3.3.2.2.2 For Delivery ATP Group =ZT Business Event =B (SD delivery) No subloc.check =SPACE No version ck =SPACE No Char. Check =SPACE Consider CH =No Checking Horizon Rcpts fr. Past =Consider past receipts Chking.hor.:GR =SPACE Segment:Inexact =SPACE Consider Pegging =Neither Manually nor Automatically Fixed Pegging EnhdConfrmLogic =SPACE ATP Check Control: Scope of Check: Category BM Sales order BT Returns delivery CC Valuated, unrestricted-use stock CD Valuated, unrestr.-use consigment stock SR Safety Stock as Requirement Please notice, in delivery process, no Delivery Plan is considerred. 3.3.2.3 Check Category Z4 Z4 is a special ATP Category, it is for suppliers delivery plan. Category =Z4 Category Text =Supply Cat Description =CPL: Delivery-production plan Sort String =23 Category Type =1 (Receipts) Relevnt Subloc. =SPACE This category is linked with Planning Area=SEMC_CPL_SNP01, so this item can be changed by process the planning book of the planning area. Page 21 of 43
3.4 Check Instruction in APO 3.4.1 Check mode 050 Used in CPL1 and CPL2, only Product Check is included Check mode=050 (Warehouse consumption) Business event = A (SD order) Product Check = 1 First step Product allocation = 0 No Check Forecast = 0 No Check 3.4.2 Check mode 041 Used in CPL3, Product Check and Product Allocation Check are included Check mode=041 (Order/delivery reqmt) Business event = A (SD order) Product Check = 2 Second step Product allocation = 1 First step Forecast = 0 No Check Page 22 of 43 3.5 CPL3: Product Allocation Setup in APO 3.5.1 Product Master data in APO The Allocation Procedure is 9000
3.5.2 Allocation Procedure Allocation Procedure =9000 Step Sequence: Step 10Product Allocation Group = 9000, Wild char = 9 Control: Object = 9000, Object Description = CPL In APO product master, this Allocation Procedure attribute is maintained under ATP View 3.5.3 Allocation Group Prod. Alloc. Grp =9000 Check planning area = X Use config. Char = SPACE Check Date Comm.structure = MCVBEP Check Date = LFDAT Time bkts prfl = W (Week) Characteristic KONOB Product allocation obj Page 23 of 43 KUNNR Sold to party MATNR Product 3.5.4 Connection between Allocation Group and Planning Area Product Allocation Group = 9000 Planning Area = SEMC_CPL_GATP Planning version = 000 Time bucket profile = W Characteristics Char InfoObject KONOB 9AKONOB KUNNR ZACUSTOM MATNR ZATPMATNR Key Figure Key figure InfoObject AEMENGE ZCPLATP02 KCQTY ZCPLATP01 4 MOQ Requirement in GATP Check 4.1 Original MOQ Solution For 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 relation- ship 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: Page 24 of 43
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. 4.2 New MOQ Solution Requirement in R0811 The 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. Page 25 of 43 4.2.1 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
Page 26 of 43
Figure: MPQ of location C1061 is 2000 From above screen shots, we can get CPL MOQ by least common multiple caculation: CPL MOQ= LCM(15000,5000,2000) =30000 4.3 Solution to the new requirement The solution to the new requirement is not complex in logic. As described in previous chapter of this doc- ument, 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 de- livery 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 attrib- ute used in UE EXIT_/SAPAPO/SAPLATPR_002
Page 27 of 43 5 CPL sales order (QA consumption) data Flow: ERP BW APO 5.1 Data Flow 5.1.1 ERP 5.1.1.1 Report ZSR0068R 5.1.1.2 Table ZBW001 5.1.1.3 Extract structure ZOXTTC0076 5.1.1.4 Data Source ZBW_001 5.1.2 BW 5.1.2.1 Data Source ZBW_001 5.1.2.2 Info Source ZLOGINF01 5.1.2.3 DSO ZLOODS1
Update Rule from InfoSource= ZLOGINF01 to DSO= ZLOODS1: ZSO_K01 SO Received IF COMM_STRUCTURE-/bic/zprclvl <= 100. RESULT = COMM_STRUCTURE-/bic/zreq_qty. ELSE. RESULT = ''. ENDIF. ZSO_K02 SO In Process * PO Unconfirmed (in 3P flow) IF COMM_STRUCTURE-/bic/zprclvl = 200. RESULT = COMM_STRUCTURE-/bic/zreq_qty. * Unconfirmed (all flows) ELSEIF COMM_STRUCTURE-/bic/zprclvl BETWEEN 300 AND 390. RESULT = COMM_STRUCTURE-conf_qty. ELSE. RESULT = ''. ENDIF. ZSO_K03 SO Shipped * In Transit and Delivered IF COMM_STRUCTURE-/bic/zprclvl >= 400. RESULT = COMM_STRUCTURE-/bic/zgr_qty. ELSE. RESULT = ''. ENDIF. Page 28 of 43 InfoSource=ZLOGINF01 fields in Communication Structure InfoObject Description Field ZPRCLVL Processing status /bic/zprclvl ZREQ_QTY Requested Quantity /bic/zreq_qty 0CONF_QTY Confirmed qty. conf_qty ZGR_QTY Goods Reciept Qty /bic/zgr_qty DataSource=ZBW_001 fields InfoObject Data Source Field ZPRCLVL ZZTTCLVL ZREQ_QTY WMENG ZGR_QTY WEMNG 0CONF_QTY BMENG InfoSource Field vs. DataSource Field InfoSource Field DataSource Field /bic/zprclvl ZZTTCLVL /bic/zreq_qty WMENG conf_qty WEMNG /bic/zgr_qty BMENG 5.1.2.4 Data Source 8ZLOODS1 5.1.3 APO 5.1.3.1 DataSource 8ZLOODS1 Source System =P26CLNT800 5.1.3.2 InfoSource ZLOODS1 5.1.3.3 Info Cube ZCPL_SO01
Page 29 of 43 5.1.3.4 Info Spoke Z2QACONSUMPTION
Data Source =ZCPL_S001 Destination =Z2QACONSU Extraction Mode =Full DB Table =/BIC/OHZ2QACONSU 5.1.3.5 Quota Arrangement in APO Tcode=/SAPAPO/SCC_TQ1 (Menu Path=APO->Master Data->Quota Arrangement), can display Quota Arrangement data To checked the details, do the following selection: Model = 000 Location = [EMS] Version-Dependent =X Plng Version =000 Inbound Quota Arrangement =X Page 30 of 43
Page 31 of 43 5.1.3.6 Table /BIC/OHZ2QACONSU 5.2 Program Z2GATP_UPDATE_LOC_W_QA This 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. 5.2.1 Special Fields 5.2.1.1 /SAPAPO/LOC In location master data in APO, there are some special SEMC fields. Fields\Location Type EMS Plant Component Supplier (MRP Area) Vendor Hub Plant (CNHK) Customer ATTLO04 Customer Number Vendor Number ATTLO05
5.2.1.2 /SAPAPO/MATLOC In APO, location specific product master, there are some fields with special usage in SEMC CPL logic: AT101 AT102 AT103 AT104 Indicate if it is CPL Component AT105 BESKZ Procurement Type LVORM Deletion flag 5.2.2 Info Spoke table /BIC/OHZ2QACONSU Table 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_UNIT Sales unit Page 32 of 43 /BI0/9ALOCFROM /BI0/9AOILOCFROM APO Start Location /BI0/9ALOCTO /BI0/9AOILOCTO APO Destination Location /BI0/9AMATNR /BI0/9AOIMATNR APO Product /BI0/9AVERSION /BI0/9AOIVERSION APO - Planning Version CALDAY /BI0/OICALDAY Calendar Day CALWEEK /BI0/OICALWEEK Calendar Year/Week /BIC/ZSO_K01 /BIC/OIZSO_K01 S.O. Received /BIC/ZSO_K02 /BIC/OIZSO_K02 S.O. In Process /BIC/ZSO_K03 /BIC/OIZSO_K03 S.O. Shipped 5.2.3 Program Logic Here 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_update Page 33 of 43 5.2.3.1 Selection Screen
P_ACTIV Location determin. activity P_CALC Calculation profile P_CR_MD Create master data gATP P_FORCE Force header rule update P_GLOBAL Global EMS QAs (collective) P_LOGSYS Logical system P_LONG Force long material 2 seq numb P_REPORT Report P_RULE Rule control S_DATES Date range for actual QA cons S_LOCNO Target EMS location range S_MATNR Material range(* w/ select) S_SELE Selection 5.2.3.2 Important modules GET_CONDITION_GLOBAL GATP_UPDATE UPDATE_GATP_MD_GLOBAL GET_QA 5.2.3.3 Important variables IT_Z2QACONSU IT_CONSUMPTION IT_CONSUMPTION_GLOBAL Page 34 of 43 IT_SUM_ACT IT_SUM_REQ IT_QAH IT_QAP IT_EMS 5.3 Using Program Z2GATP_UPDATE_LOC_W_QA 5.3.1 Process Chain CPL_GATP_MD
Page 39 of 43 6 Delivery Plan Data Flow 6.1 About 4A5 Message Receiving PIP 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. 6.1.1 Message Type= PBAPS_CHANGEKEYFIGUREVALUE Planning Book =CPL_TH_EX Data View =925 Characterisitic =9AMATNR Characterisitic =9ALOCNO Key Fig =ZCPLSNP08 6.1.2 Partner Profile Definition
Message Function=T1 is the one for 4A5 inbound message. Page 40 of 43 6.1.3 Result of Receiving 4A5 message The 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.
6.2 From 4A5 message to delivery Plan On 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 as LC 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. 7 Product Allocation Data Flow The 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. Page 41 of 43 8 Trouble Shooting by Debugging 8.1 Overview The GATP functional in APO is used by following order process: Sales Order Outbound Delivery Stock Transfer Order The 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. 8.2 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. 8.2.1 Scheduling Calculation 8.2.1.1 Call Stack in ERP, RFC call 10 RFC APO_SCHEDULING SAPLV03C_APOINT 9 FUNCTION APO_SCHEDULING SAPLV03C_APOINT 8 FORM VERSANDTERMINIERUNG_NEU SAPFV45V 7 FORM MVERF_AUFBAUEN_WMENG SAPFV45V 6 FORM MVERF_AUFBAUEN SAPFV45V 5 FORM VERFUEGBARKEIT_PRUEFEN SAPFV45V 4 FORM BESTAND_BEDARF_ABGLEICHEN SAPFV45V 3 FORM VBAP_BEARBEITEN_ENDE_VERFUEGB SAPFV45P 2 FORM VBAP_BEARBEITEN_ENDE SAPFV45P 1 MODULE (PAI) VBAP_BEARBEITEN_ENDE SAPMV45A 8.2.2 ATP Check 8.2.2.1 Call Stack in ERP, RFC call 11 FORM AVAILABILITY_CHECK_APO SAPLATPC 10 FUNCTION AVAILABILITY_CHECK SAPLATPC 9 FUNCTION AVAILABILITY_CHECK_CONTROLLER SAPLATPC 8 FORM MVERF_PRUEFEN SAPLV03V 7 FUNCTION RV_AVAILABILITY_CHECK SAPLV03V 6 FORM MVERF_PRUEFEN SAPFV45V 5 FORM VERFUEGBARKEIT_PRUEFEN SAPFV45V 4 FORM BESTAND_BEDARF_ABGLEICHEN SAPFV45V 3 FORM VBAP_BEARBEITEN_ENDE_VERFUEGB SAPFV45P 2 FORM VBAP_BEARBEITEN_ENDE SAPFV45P 1 MODULE (PAI) VBAP_BEARBEITEN_ENDE SAPMV45A 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. Page 42 of 43 In FORM=VERFUEGBARKEIT_PRUEFEN, subroutine MVERF_AUFBAUEN is performed before MVERF_PRUEFEN, that is, Scheduling caculation is performed before GATP Check. 8.2.2.2 Call Stack In APO, MOQ Enhancement
6 ZCL_IM_2GATP METHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN 5 CL_EX_APO_BAPI_BUS10400 METHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN 4 SAPL10400 FUNCTION BAPI_APOATP_CHECK 3 SAPL10400 FORM BAPI_APOATP_CHECK 2 SAPMSSY1 FORM REMOTE_FUNCTION_CALL 1 SAPMSSY1 MODULE (PBO) %_RFC_START 8.2.2.3 Call Stack In APORule Execution 12 /SAPAPO/SAPLATPR FUNCTION /SAPAPO/ATP_RULES_EVALUATE 11 /SAPAPO/CL_ATPT_CONTROLLER====CP METHOD RULES_GET 10 /SAPAPO/CL_ATPT_REQ===========CP METHOD PROCESS_RULES_IMMEDIATELY 9 /SAPAPO/CL_ATPT_REQ_GRP=======CP METHOD PROCESS_RULES_IMMEDIATELY 8 /SAPAPO/CL_ATPT_REQ_GRP=======CP METHOD SET_FROM_INTERFACE 7 /SAPAPO/SAPLATPT FORM TREE_ANCHORS_CREATE 6 /SAPAPO/SAPLATPT FUNCTION /SAPAPO/CHECK_AVAILABILITY 5 /SAPAPO/SAPLATPT FUNCTION /SAPAPO/AVAIL_CHECK_CONTROLLER 4 SAPL10400 FUNCTION BAPI_APOATP_CHECK 3 SAPL10400 FORM BAPI_APOATP_CHECK 2 SAPMSSY1 FORM REMOTE_FUNCTION_CALL 1 SAPMSSY1 MODULE (PBO) %_RFC_START 8.3 R3 Delivery -> APO GATP 8.3.1 Call Stack in ERP, RFC Call 13 SAPLATPC FUNCTION AVAILABILITY_CHECK 12 SAPLATPC FUNCTION AVAILABILITY_CHECK_CONTROLLER 11 SAPLV03V FORM MVERF_PRUEFEN 10 SAPLV03V FUNCTION RV_AVAILABILITY_CHECK 9 SAPLLE_ATP_CHECK FORM VERFUEGBARKEIT_PRUEFEN 8 SAPLLE_ATP_CHECK FUNCTION LE_ATP_CHECK_SINGLE 7 SAPFV50P FORM VERFUEGBARKEIT_PRUEFEN_NEU 6 SAPFV50P FORM LIPS_PRUEFEN 5 SAPFV50P FORM LIPS_BEARBEITEN 4 SAPFV50C FORM LIPS_KOPIEREN 3 SAPFV50C FORM VORLAGE_KOPIEREN 2 SAPMV50A FORM AUFTRAG_REFERIEREN 1 SAPMV50A MODULE (PAI) AUFTRAG_REFERIEREN 8.3.2 Call Stack in ERP, Check CIF 16 SAPLATPC FORM CIF_IMOD_DESTINATIONS_ATPCHECK 15 SAPLATPC FORM DATA_COLLECT_APO 14 SAPLATPC FUNCTION AVAILABILITY_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 mod- el existed for the material/plant combination, APO will be used, otherwise ATP check in ERP will be used. 8.3.3 Call Stack in APO, EMC MOQ Enhancement 6 ZCL_IM_2GATP METHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN 5 CL_EX_APO_BAPI_BUS10400 METHOD IF_EX_APO_BAPI_BUS10400~CHANGE_INPUTPARAMEXTERN 4 SAPL10400 FUNCTION BAPI_APOATP_CHECK 3 SAPL10400 FORM BAPI_APOATP_CHECK 2 SAPMSSY1 FORM REMOTE_FUNCTION_CALL 1 SAPMSSY1 MODULE (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 , Page 43 of 43 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. 8.4 Rule Simulation in APO There 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.