Hello Gurus,
Could you please let me know how to code the below logic? I have created a APD, for which the input is a BEx query and Output is a (Direct Update) DSO. The output of this DSO contains Sales order, Line Item, Delivery Number, Plant, Ship Point, Ship Date, Order Quantity and Delivery Quantity columns (Screenshot attached).
The aim is to check whether for each line item of the sales order, if order quantity equals delivery quantity. Count the number of line items that satisfy this criteria. [Keep this output as Numr.]
Next is to get the total line item count of a sales order. This has to be obtained from Order DSO [/bic/AZSD11000], as the line items count present in the APD output DSO may not be complete, and the order DSO [[/bic/AZSD11000]] is the place to obtain the Line Item count of a sales Order. So, the count of no. of line items has to be obtained from this DSO [Keep this output as Denr.]
FINAL RESULT = [NUMR/DENR] *100.
So, in the attached screenshot, there are 5 line items. And, for all 5 line items, /bic/lord_qty = /bic/ldlv_qty. So, the Numr. value is 5.
From Order DSO, there are total 10 line items which is shown in second screenshot. So, the denr. value is 10.
So, result would be [5/10] * 100 = 50%.
Additional Information:
DOC_NUMBER (Sales order number), S_ORD_ITEM (Order Line Item) are the keys of Order DSO.
Data type definition of fields:
DOC_NUMBER TYPE /BI0/OIDOC_NUMBER,
PLANT TYPE /BI0/OIPLANT,
SHIP_POINT TYPE /BI0/OISHIP_POINT,
DELIV_NUMB TYPE /BI0/OIDELIV_NUMB,
S_ORD_ITEM TYPE /BI0/OIS_ORD_ITEM,
DSDEL_DATE TYPE /BI0/OIDSDEL_DATE,
ORDER_QTY TYPE /BI0/OIORDER_QTY,
DLV_QTY TYPE /BI0/OIDLV_QTY,
/BIC/ZLINFRATE TYPE /BIC/OIZLINFRATE, [Final Metric for Result]
Points will be awarded.
Thanks,
G.