SAP Help of class
ATP Availability check
user exit to change Order Availability Check used to calculate atp value
FM 'AVAILABILITY_CHECK'
tables
p_atpcsx
form AVAILABILITY_CHECK_R3
FM 'AVAILABILITY_CHECK_SERVER'
importing
p_atpgc = s_atpgc
atp val = s_atpgc-atpm1
FM 'AVAILABILITY_CHECK_EXECUTE'
Program: MV45AFZZ
FORM: userexit_move_field_to_vbap
change VBAP-MTVFP to set Availability Check
"check customer children in hierachy
BAPI_CUSTOMER_GET_CHILDREN
Tcode
OVZ9 - checking group and checking rule
MM02 - Change material
VA01 / VA02 - create order for material and qty required
"get existing sales orders based on customer hierachy
SELECT vbpa~vbeln vbpa~kunnr vbpa~parvw vbap~WERKS
FROM vbak AS vbak INNER JOIN vbpa AS vbpa
ON vbak~vbeln = vbpa~vbeln
INNER JOIN vbap AS vbap
ON vbak~vbeln = vbap~vbeln
INTO CORRESPONDING FIELDS OF TABLE it_vbpa
WHERE vbak~audat GE ld_weekstart AND vbak~vkorg EQ
AND vbpa~parvw EQ '1C' AND vbpa~kunnr EQ ls_hpath-kunnr" OR vbpa~parvw = 'SH' "WE AND vbap~matnr EQ
* Get confirmed qty
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
EXPORTING
salesdocument = wa_vbpa-vbeln "wa_sales_orders-sd_doc
* IMPORTING
* RETURN =
TABLES
statusinfo = lt_statusinfo.
LOOP AT lt_statusinfo INTO wa_statusinfo where material eq
ld_confirmed = ld_confirmed + wa_statusinfo-cum_cf_qty. "weekly total
ENDLOOP.