Create Purchse order for external routing positions

fert_external_toorder_browse.psr
 
Property 
 | 
Description 
 | 
 
s_parm3 
 | 
Default filter 
Standard = ("BEAS_FTPOS"."MENGE_VERBRAUCH" + Coalesce("BEAS_FTPOS"."MENGE_VERSCHNITT",0))/(case when COALESCE(BEAS_FTAPL.RM_FAKTOR,0)=0 then 1 else BEAS_FTAPL.RM_FAKTOR end) >Coalesce((select sum("POR1"."Quantity") from "POR1" inner join "OPOR" on "OPOR"."DocEntry"="POR1"."DocEntry" and "OPOR"."CANCELED" <> 'Y'  
   where "POR1"."U_beas_belnrid"="BEAS_FTAPL"."BELNR_ID" and "POR1"."U_beas_belposid"="BEAS_FTAPL"."BELPOS_ID" and "POR1"."U_beas_posid"="BEAS_FTAPL"."POS_ID" and coalesce("POR1"."U_beas_basetype",'')<>'pr'),0) 
  
Alternative you can set only for one Routing position 
 | 
 
 
 
 | 
 
 
Follow special window events available 
  
Property 
 | 
Description 
 | 
 
checkbom 
 | 
Check if Material available 
The system check all lines with request quantity > 0 from current window and make first tests.  
The system set current row to the row, which current tested 
in this event you can check all fields in dw_1  
It is not possible to cancel the process in this place, but you can change the quantity to 0 and then the system will ignore the line 
  
Variable 
 | 
Description 
 | 
 
dw_1 
 | 
The datawindow with all values for current line 
 | 
 
 
 
  
 | 
 
purchaseorderline 
 | 
After adding a purchase order line 
Here you can change all properties from current document line 
  
Variable 
 | 
Description 
 | 
 
porder 
 | 
The SAP Purchase order Object from ue_api_sbo 
 | 
 
dw_1 
 | 
The datawindow with all values for current line 
 | 
 
 
 
<dw_1.getrow> = the line, which current added 
  
Example: Save a value in an own udf 
  
  
windowevent purchaseorderline 
if <dw_1.item.itemcode.value> = 'FP' then 
   porder.line.u_myUdf='myValue' 
end if 
end event 
 | 
 
prepurchaseorderadd 
 | 
After definition of all details BEFORE Adding this document 
Here you can change / add informations on header level 
(note: you can change header information in purchaseline event too) 
  
Variable 
 | 
Description 
 | 
 
ls_cardcode 
 | 
Business Partner 
 | 
 
ls_address 
 | 
Address 
 | 
 
is_whscode 
 | 
Warehouse Code 
 | 
 
is_po_whs 
 | 
Purchase order Warehouse code 
 | 
 
 
 
  
  
// Example: set pointofissuecode (Argentina location) 
windowevent prepurchaseorderadd 
porder.pointofissuecode="1"; 
end event 
  
Note:  
Property "pointofissuecode" and this event is available in Beas 2021.06.00.01 
Alternative you can define this in the purchaseorderline level with property name porder.pticode 
 | 
 
purchaseorderadd 
 | 
called after adding purchase order 
you can check created document entry with getnewobjectkey 
  
Variable 
 | 
Description 
 | 
 
porder.getnewobjectkey 
 | 
created document 
 | 
 
 
 
  
  
  
windowevent purchaseorderadd 
setvar=ll_docentry=<porder.getnewobjectkey> 
// print document 
end event 
 | 
 
 
 
 |