cancel
Showing results for 
Search instead for 
Did you mean: 

Sum of row level Field in Header level UDF

Former Member
0 Kudos
268

Dear All,

In A/R Invoice, can I take U_UnitPrice field's (udf at rowlevel of A/R Invoice) sum at header level udf i.e. U_SumLC

I like to do this by Formatted search.

Can any body help me.

Wtih Warm Regards,

Chintesh Soni

+91-94276 08674

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

You can do this only through the SBO_SP_TransactionNotification stored procedure.

The Code for the same is as below

IF @transaction_type = 'A' AND @object_type = '13'

BEGIN

UPDATE OINV SET U_SumLC = (SELECT SUM(U_UnitPrice) FROM INV1 WHERE DOCENTRY = @list_of_cols_val_tab_del) WHERE DOCENTRY = @list_of_cols_val_tab_del

END

Former Member
0 Kudos

Thanks Suda,

one more question, where to write this code..?

Create Stored Procedure in SQL Server or in SDK .net codeing.

Plz. Reply..

Thanks,

Chintesh Soni

former_member583013
Active Contributor
0 Kudos

Go to SQL Server Management Studio (SQL 2005), Click on your DB, expand

Click on Programmability > Stored Procedure...Right click on SBO_SP_TransactionNotification and paste the code I gave .. where it says

-- ADD YOUR CODE HERE

Suda

Former Member
0 Kudos

Thanks a lot..!!!

You have solved my biggest problem...

Its working...

Can i have your email address plz...

With warm regards.

Chintesh Soni

sonichintesh@yahoo.co.in

former_member583013
Active Contributor
0 Kudos

sudasampath.sapb1@gmail.com

Best wishes

Suda

Former Member
0 Kudos

Dear Suda,

From ur procedure i want to know,

is it possible to have a run time field's value into Stored Procedure for updation.

i.e in case of DocEntry we are entering the value as

DOCENTRY = @list_of_cols_val_tab_del

similarly is it possible to have for Row level fields value?

like the below,

If @transaction_type = 'A' AND @Object_type = '13'

BEGIN

UPDATE INV1 SET U_Sale = (SELECT T0.U_Dates FROM OITM T0 WHERE T0.ItemCode = ${$38.1.0])

END

Thk u,

ZEN.

Edited by: Zen M on Feb 25, 2008 10:13 AM

former_member583013
Active Contributor
0 Kudos

Zen,

Thats actually not possible. The stored procedure cannot accept field reference parameter like $\[$x.0.0] and also the stored procedure does not get triggered till the transction is submitted through the ADD or UPDATE event. (It does not fire when adding a row)

But this can be achieved through a simple formatted search?

Save the following SQL in SBO and attach it as a formatted search to the Invoice row level column U_Sale

The SQL would be

SELECT T0.U_Dates FROM OITM T0 WHERE T0.ItemCode = $\[$38.1.0]

Suda

Former Member
0 Kudos

Oh Suda! Tank Q for ur info!

Former Member
0 Kudos

Is there any UDF limitations in SAP B1.

I want to create UDF and i am getting an internal error.

Please answer my query.

Its urgent.

former_member583013
Active Contributor
0 Kudos

Please post this as a new question and provide complete details about where you are creating this Marketing document / Master data / ?

Name of UDF type SQL Server vrsion etc

Answers (0)