on 07-08-2015 8:00 AM
Hi experts,
I want one stored procedure (sp) for GRPO .In that GRPO i created two user defined fields "Add" and "Sub" .when i raised GRPO i will
give some value in that U_Add or U_Sub according to depending on vendors . And these two fields must should be reflect to linetotal value and that
value not depending on Quantity.
For that one i written two sp query in sp_transaction notification that is executing and not working in GRPO.
1) IF @Object_type = '20' and @transaction_type in ( 'A' , 'u')
BEGIN
update PDN1 set PDN1.LineTotal = PDN1.Quantity * PDN1.Price + PDN1.U_add - PDN1.U_sub
From PDN1
Where PDN1.ItemCode = @list_of_cols_val_tab_del
2) IF @Object_type = '20' and @transaction_type in ( 'A' , 'u')
BEGIN
update PDN1 set PDN1.LineTotal = PDN1.Quantity*PDN1.Price + PDN1.U_add - PDN1.U_sub
From OPDN
Where PDN1.ItemCode = @list_of_cols_val_tab_del
Thanks & regards
--ram
hello ram teja
try fms , create 2 header level udf and apply following query as fms on linetotal ..this will give u the result (( quantity * price) + add value1 - value 2)
SELECT ($[$38.14.number] * $[$38.11.number]) + ($[OPDN.U_QQQ]) - ($[OPDN.U_WWW])
(www/qqq are my header level udf . dont apply auto update)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Update/Insert/Delete functions are not allowed by SAP. If any DB corruptions due to update, SAP will not support.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
Please don't update any SAP standard fields through TN which may leads to big Problem and SAP also will never support you.
If you plan for any update in standard field, take help of service partner and do it through Add-on.
Thanks
Unnikrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Ram,
Please try below sptn
===============
IF (@object_type = '18' AND @transaction_type IN ('A','U'))
BEGIN
Declare @minline3030 int
Declare @maxline3030 int
set @minline3030 = (select min(T0.Line_ID) from PDN1 T0 where T0.TransId=@list_of_cols_val_tab_del)
set @maxline3030 = (select max(T0.Line_ID) from PDN1 T0 where T0.TransId=@list_of_cols_val_tab_del)
while @minline3030 <= @maxline3030
BEGIN
update PDN1 set PDN1.LineTotal = PDN1.Quantity * PDN1.Price + PDN1.U_add - PDN1.U_sub
From PDN1
Where PDN1.Line_ID =@minline3030 and PDN1.DocEntry=@list_of_cols_val_tab_del
Set @minline3030 = @minline3030 + 1
END
END
================
Regd,
Chetan Vora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.