on 11-04-2016 10:02 AM
Hi Sap Experts
I have the below query for a UDV in sales order which plus through is an item is set only for a specific customer set in a UDF.
When I run it as a UDV in out test system it does not always return the desired results e.g when (t1.U_ITEM_VALUE is not null and t1.U_ITEM_VALUE <> $[$4.0.0]) it only occasionally returns the desired result.
I have linked the reports using the udf fields so I am not sure it is an issue with the database updating.
My Query for the UDV is as per the below where t1.U_ITEM_VALUE is the BP Ref No when an item is set for a specific customer.
Any ideas?
BTW this new sap forum is horrible to use. 😞
SELECT distinct
case
when t1.U_ITEM_VALUE = $[$4.0.0]
then concat(T2.CARDNAME,' ','Only Product')
when (t1.U_ITEM_VALUE is not null and t1.U_ITEM_VALUE <> $[$4.0.0])
then concat('**','Supply Only To',' ',t2.CARDNAME,'**')
end AS 'Supply Only To'
FROM RDR1 T0 INNER JOIN OITM T1 ON T0.ITEMCODE=T1.ITEMCODE LEFT JOIN OCRD T2 ON t1.U_ITEM_VALUE =T2.CARDCODE
WHERE $[$38.1.0] = t1.itemcode
Many Thanks
Chris
Thanks Nayrayani
I have found the solution. It was an issue with the tables which were linked. As I needed to filter by all items OITM left Join to RDR1 was correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Instead of comparing with NULL, assign a default value and then try.
Also try listing the values of that field in the existing rows. Especially when it gives you the incorrect result.
There is a possibility that user has interacted with that field erroneously and NULL is getting replaced by empty spaces.
Regards
Narayani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.