S2L allows 4 modes of planning, defined and used during jit calls creation. These four modes are described as a type s2l_planning_mode (type c):
- initial – s2l_no_planning
- 1 – s2l_plan_by_wish_qty – use replenishment quantity entered at segment level
- 2 – s2l_plan_suggest_keep_firmed – automatically create plan but keep firmed quantities
- 3 – s2l_plan_suggest_all – automatically create plan.
Selecting „Change mode with Replenishment Proposals“ will set planning mode to „3“ (s2l_plan_suggest_all):
The task is to mark the created jitcalls depends on the used planning mode („auto/manual“), so it means to save the mode value into the JITOIT table (JITOCO struture appendix) additional z-field.
S2L has few enhancements:
- S2P_PLNG_SEG_EXTEN (transaction S_KA5_12001164)
- S2P_PLNG_ITEM_EXTEN (transaction S_KA5_12001165)
- S2P_GROUP_PLNG_ITEMS (transaction S_KA5_12001166)
- S2P_PLN_CALC_FACTORY (transaction S_KA5_12001167)
- S2P_PROPOSAL_CREATOR (transaction S_KA5_12001168)
- S2P_PSEG_CTR_FACTORY (transaction S_KA5_12001169)
So, after adding the appends YYS2LMODE into JITOCO and PKHD we implementing classic BAdI Interface IF_EX_S2L_PLN_CALC_FACTORY:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
method IF_EX_S2L_PLN_CALC_FACTORY~CREATE_PLNG_CALCULATION. * type s2l_planning_mode type c: * s2l_no_planning - initial * use replenishment quantity entered at segment level * s2l_plan_by_wish_qty - '1', * automatically create plan but keep firmed quantities * s2l_plan_suggest_keep_firmed - '2', * automatically create plan * s2l_plan_suggest_all - '3'. select * from zparam into corresponding fields of table lt_params where paramid = 'YS2L_PLAN' and paramval = 'X'. if sy-subrc eq 0. data ccy_ctrl type ref to cl_ccy_pseg_control_s2l. ccy_ctrl ?= segment->control. if segment->planning_mode is not initial. call method ccy_ctrl->pkhd_ref->yset_plan exporting y_plmod = segment->planning_mode. endif. endif. endmethod. |
Because of ccy_ctrl->pkhd_ref is declared as RO (read only) attribute and can be changed only within the class – I’ve enhanced class interface CL_PKHD_DB_PK with metod
1 |
YSet_Plan (Y_PLMOD type C) |
which called above.
1 2 3 |
method yset_plan. me->val-s-yys2lmode = y_plmod. endmethod. |
The field pkhd-yys2lmode will be move corresponding into JITOCO (JITOIT).