Table it reads from: VBBE / VBBS
VBBE: Sales Requirements: Individual Records VBBS: Sales Requirement Totals Record
Example of how this entry gets created in table VBBE / VBBS:A sales document is created. This creates a sales requirement in VBBE. An outbound delivery is created; this should over-write the preceding VBBE entry (i.e. system will create a new VBBE where VBTYP = “J” and delete the VBBE entry where VBTYP = “C”)
Logic of the flag:Select on table VBBE or VBBS depending on OVZ2 customising.
n example in CO09:
– There is unrestricted stock = 10. A Sales order is created with a required quantity = 10. The sales order is fully delivered via VL01n.
Flag is set: Available quantity = 0 (10 in stock – quantity of 10 in deliveries)
Flag is not set: Available Quantity = 10 (10 in stock but deliveries not considered)
Code that implements this logic:
Include LATP2FV6: Macro VBBE_T441V_CHECK:
* check T441V
IF G_T441V-VBBDP <> XFLAG ” sales requirements AND G_T441V-VBBLP <> XFLAG. ” delivery notes EXIT.
ENDIF.
Table 31:Macro to ensure flag is set. If not set, then system will exit Include LATP2FV0 / Form VBBE_DB_READ:
Include LATP2FV0 / Form VBBE_DB_READ:
SELECT BERID LGORT CHARG VBTYP MBDAT
SUM( OMENG ) SUM( VMENG ) FROM ATP_VBBE
INTO (ATP_VBBE-BERID, ATP_VBBE-LGORT, ATP_VBBE-CHARG, ATP_VBBE-VBTYP, ATP_VBBE-MBDAT, ATP_VBBE-OMENG, ATP_VBBE-VMENG)
WHERE MATNR = ATPMAT-MATNR AND WERKS = ATPMAT-WERKS AND SOBKZ in (SPACE, sobkzk) AND MBDAT < ATPMAT-ENDWZ
Table 32:Select on the VBBE view
Tip: If you want to debug into the read / select of VBBE, then you can manually set the data object debug_macro via the debugger. This data object can be found in function STOCK_RECEIPT_ISSUE_READ (See
gure 17). This allows you to debug into the abap version of form vbbe_read rather than the macro being executed.
Figure 17: Setting “debug_macro” to “X” will allow you to debug into form VBBE_READ_ABAP
12) Incl. ship. noticat:
Table it reads from:EKES (Vendor Confirmaons)
Example of how this entry gets created in table EKES:EKES record is created when an inbound delivery is created from a purchase document.
Logic of the flag:The “Incl. Purchase Orders” also has an inuence on shipping notications. If the “Incl. Purchase Orders” ag is set but the
“Incl. ship.noticat.” ag is not set, then the system still attempts to select the data from EKES.
System calculates the available quantity of the shipping notication by subtracting the “MRP Reduced Quantity” from the total quantity.
n example in CO09:
– There is stock = 10. There is an inbound delivery with a quantity = 5. A goods receipt is posted for this inbound delivery in MIGO for a quantity = 3
Flag turned on: Shipping notication appears in CO09. The available stock will be 15 on the date of the shipping notication (10 + 3 + (5-3)).
Shipping Notication quantity will be 2: Quantity of 5 – GR of 3 = 2.
Flag turned o: Shipping notication is not displayed in CO09. Available quantity = 10.
Code that implements this logic:
Include LATP2TME: Macro: ekes_t441v_check:
Include LATP2TME: Macro: ekes_t441v_check:
DEFINE ekes_t441v_check.
* check T441V
if g_t441v-lavip <> xag ” shipping notication for
” purchase orders and scheduling
” agreements
and g_t441v-bestp <> xag ” purchase order and
” scheduling agreement
and g_t441v-bestp <> ‘A’. “1579745 exit.
endif.
END-OF-DEFINITION
Table 33:Checks if the flag is selected in OVZ9; note that the purchase order flag must also be set
Include LATP2FE2:
SELECT *
FROM atp_ekes
WHERE matnr = atpmat-matnr AND werks = atpmat-werks AND bstyp IN (bstypf, bstypl) AND ( loekz = space
OR loekz = chars ) AND elikz = space AND kzdis = xag AND pstyp <> pstyps
AND dabmg < atp_ekes~menge AND sobkz IN r_sobkz
AND estkz NE ‘4’.
Table 34: Select on EKES
Include LATP2TME: Macro ekes_check:
p_atpmex-mng01 = atp_ekes-menge – atp_ekes-dabmg.
Include LATP2TM0:Macro ATPMEX_CHECK_INT:
S_ATPK-MNG01 = P_ATPMEX-MNG01.
Table 36:Pass the available quantity of the shipping notication to the ATP structure
13) Incl. depen.reservat:
Table it reads from: RESB (Reservaon/dependent requirements)
Example of how this entry gets created in table RESB:A work order is created (for example a production order) that contains a component as part of a BOM. This is a requirement of the material in the order and an entry gets created in RESB.
Logic of the flag:When the flag is set, the system considers the dependent reservaons of work orders in the calculaon of the available quanty.
n example in CO09:The following example shows a quantity of 102 available for a component material (See gure 18)
Figure 18: 102 in stock
i) If the ag is set to “X”, this means that the reservation is displayed in CO09 and there will be 101 (102 – 1) available (See gure 19).
Figure 19: Reservation included so taken into account when calculating available quantity
Code that implements this logic:
Include LATP2TMR: Macro resb_t441v_check:
if atpgd-anwdg <> c_appl_forcast
and g_t441v-resbp <> xag ” material reservation and g_t441v-skbdp <> xag ” dependent requirements and g_t441v-olbpr = xag ” without subcontracting and g_t441v-arrep <> xag ” all dependent reservations and g_t441v-arrep <> chara. ” dep. reservations that can be
” withdrawn exit.
endif.
Table 37:Macro that contains the code to exit if the flag is not set (to X or A)
Include LATP2FR1:
SELECT * FROM atp_resb
INTO TABLE lt_atpresb
WHERE matnr = atpmat-matnr AND werks = atpmat-werks AND xloek = space
AND kzear = space
AND bdter < atpmat-endwz AND bdart <> skbed
AND sobkz IN (space, sobkzk) AND bdmng > atp_resb~enmng AND txtps = space
AND schgt = space AND dbskz = space AND ( vorab IS NULL
OR vorab = space ).
Table 38: Selects the relevant entries from the RESB table (this select ensures that system does not select deleted reservations, or
reservations that have been nally issued etc.)
ii) When the ag is set to “A”, the element is displayed in CO09 if the RESB-XWAOK (Goods Movement for Reservation Allowed) eld is set.
Consider the following example:
– Available stock is 102. A production order is created with the component material for a quantity of 1. Initially, this component requirement is not appearing in CO09 (See gure 20):
Figure 20: Flag is set to “A” but reservation not appearing.
– The reason that it is not appearing is that RESB-XWAOK is not set. You can see this in the component details of the component overview in the production order (gure 21):
Figure 21: “Movement Allowed” (RESB-XWAOK) is initial
– However, after you release the order, the RESB-XWAOK ag can get set (See gure 22):
Figure 22: “Movement Allowed” (RESB-XWAOK) is agged
– Now, CO09 can display the “withdrawable” material (gure 23):
Figure 23: Flag is set to “A” so the reservation appears in CO09 only after RESB-XWAOK is set
Code that implements this logic:
Include LATP2FR0 / Form resb_arbed_mrbed_check p_atpmex-sobkz = p_atp_resb-sobkz.
p_atpmex-lgort = p_atp_resb-lgort.
p_atpmex-charg = p_atp_resb-charg.
p_atpmex-delkz = p_atp_resb-bdart.
p_atpmex-atpif(1) = p_atp_resb-xwaok. <<<<<<<<<<<<<<
p_atpmex-atpif+2(1) = p_atp_resb-dumps.
Table 39: Passing the “Movement allowed” indicator to the ATPMEX internal table.
Include LATP2TMR: Macro resb_delkz_atpif_check:
* evaluation of T441V case &1.
when arbed.
if g_t441v-arrep is initial ” without any order reservations or ( g_t441v-arrep = chara
and &2(1) is initial ).
continue.
endif.
Table 40:Macro that checks if the “Incl.depen.reservat” = ‘A’ in the scope of check