Try the below
IF :object_type = '156' AND :transaction_type = 'U' THEN
select max("PickEntry")as cnt from "PKL1" where "AbsEntry" = :list_of_cols_val_tab_del;
i :=0;
while i<cnt
Do
i:=i+1;
select "OrderEntry" into orderentry from "PKL1" where "AbsEntry"=:list_of_cols_val_tab_del and "PickEntry"=i;
select "OrderLine" into orderline from "PKL1" where "AbsEntry"=:list_of_cols_val_tab_del and "PickEntry"=i;
END While;
cnt1:=0;
if :cnt1=0 then
SELECT count(*)into cnt1 FROM "OPKL" "T0" INNER JOIN "PKL1" T1 ON T0."AbsEntry" = T1."AbsEntry"
WHERE T1."PickQtty" <> T1."PrevReleas" AND T0."AbsEntry" = :list_of_cols_val_tab_del;
END IF;
--val:=cnt;
if :cnt1 > 0 then
update "RDR1" set T0."U_DispQty"=P."PickQtty" from "RDR1" T0
join ( select DISTINCT T1."PickQtty",T1."OrderEntry",T1."OrderLine" from "PKL1" T1 WHERE T1."AbsEntry" = :list_of_cols_val_tab_del
GROUP BY T1."PickQtty",T1."OrderEntry",T1."OrderLine" ) AS P
on T0."DocEntry" =P."OrderEntry" and T0."LineNum" =P."OrderLine"
WHERE RDR1."DocEntry"=P."OrderEntry" AND RDR1."LineNum" =P."OrderLine" ;
END IF;
End IF;
and let me know the result
--Manish