Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

need hepl in UDF

Hi...

Please help in user defined function

<?xml version="1.0" encoding="utf-8" ?>

- <ns1:mt_out xmlns:ns1="http://Block">

- <Material>

<Item>0</Item>

<ItemName />

<ReqQty>0</ReqQty>

<AvailQty>0</AvailQty>

<Cost>100</Cost>

<suppid />

<suppname />

<leadtime>0</leadtime>

<matname>Y-351</matname>

<plantloc>2222</plantloc>

<date>2008-09-30T00:00:00</date>

<orderqty />

<warehouseloc />

<unit>KG</unit>

</Material>

- <Material>

<Item />

<ItemName />

<ReqQty>0</ReqQty>

<AvailQty>0</AvailQty>

<Cost>200</Cost>

<suppid />

<suppname />

<leadtime>0</leadtime>

<matname>Y-355</matname>

<plantloc>1111</plantloc>

<date>2008-09-30T00:00:00</date>

<orderqty />

<warehouseloc />

<unit>KG</unit>

</Material>

- <Material>

<Item />

<ItemName />

<ReqQty>0</ReqQty>

<AvailQty>1000.000</AvailQty>

<Cost>0</Cost>

<suppid />

<suppname />

<leadtime>0</leadtime>

<matname>Y-352</matname>

<plantloc>1100</plantloc>

<date>2008-09-30T00:00:00</date>

<orderqty />

<warehouseloc />

<unit>KG</unit>

</Material>

</ns1:mt_out>

The output file is

<Material>

<ProcurementCost />

<OtherCost />

<TotalCost />

</Material>

The input file is having multiple records. If the AvailQty feild is "0", then, the corresponding record will be having the cost.

The Total cost should be the sum of all the costs in the input file. ( I should get 100 + 200 )

Could you please in defining user defined function for the above reqiurement..

Not what you were looking for? View more on this topic or Ask a question