Column ID of a UDF

Does anyone know how to reference a column id of a UDF in a formatted search?
Say you have a UDF called "netprice" on the marketing document line level. You could reference this new field as 'rdr1.u_netprice' in a formatted search on a sales order no problem. However, this implies having multiple queries for the same formatted search if you want to use it on Quotes and Deliveries, etc.
Is there any way you can reference the screen column of a udf, like in '$38.1.0', where the latter is the itemcode? I have tried with '$38.u_netprice.0' but that doesn't work. What is the correct syntax?
Is there any other ways of doing this?
PS I have omitted the dollar square brackets above because they translate into http:// on this forum
Thanks
Steven
Edited by: Steven Delombaerde on Sep 4, 2008 2:43 PM

Hi Steven,
Where do you get those netprice for these UDF?
It your U_netprice is on the item master,  then it will be very easy.  You can use something like:
where itemcode = $[$38.1.0]
from oitm table.
Otherwise, you may have to refer to different tables by different FMS.
Thanks,
Gordon

Similar Messages

  • After 8.8 Upgrade Invalid Column Name error on UDF in Sales Order

    I have upgraded a dtaabase from 2005A to 8.8 SP00 PL15.
    I encountered a UDF/UDT warning (Note 1360832) in the Pre-Upgrade CHeck but proceeded in any case.
    After the upgrade as soon as I enter the BP in a Sales Order, I get the following error.
    [Microsoft] [SQL Server Native Client 10.0] [SQL Server] [Invalid Column Name U_CampPB1.2)
    [Microsoft] [SQL Server Native Client 10.0] [SQL Server] Statement 'Withholding Tax'  (OWHT) could not be prepared.
    This UDF was one of many reported in the Upgrade Wizard Log File as having an incorrect Type.
    " Type is different; Should be A, Is M".
    There are hundreds of instances of this message in the log.
    I don't know whether the error is related to the Type is different warning.
    I don't get the error when I add an AR Invoice.
    In addition I cannot find any documentation on the different UDF Type codes.

    Hi,
    should you have any errors before or after upgrade, log a message to a support. That's the best solution.
    JimM

  • Text UDF Disappear in CRYSTAL Layout

    Hi all,
    I built a SBO layout for sales quotation in crystal 2008.
    When i display the layout in the crystal editor every thing works fine, but when i open the layout in SBO all the text UDF disappears (including their column headers).
    Numeric UDF are displayed fine.
    Does anyone have a clue for the source of this problem.
    Thanks, Udi

    hi,
    are you using Stored Procedure or direct to tables?
    i will recommend you use Stored Procedure and use the SQL CAST to achieve the desired output.
    regards,
    Fidel

  • Parse column with csv string into table with one row per item

    I have a table (which has less than 100 rows) - ifs_tables that has two columns: localtable and Fields. Localtable is a table name and Fields contains a subset of columns from that table. Fields is a comma delimited list:  'Fname,Lname'. It looks like
    this:
    localtable         fields
    =========  =============
    customertable   fname,lname
    accounttable     type,accountnumber
    Want to end up with a new table that has one row per column. It should look like this:
    TableName             ColumnName
    ============ ==========
    CustomerTable        Fname
    CustomerTable        Lname
    AccountTable          Type
    AccountTable          AccountNumber
    Tried this code but have two issues (1) My query using the Splitfields functions gets "Subquery returned more than 1 value" (2) some of my Fields has hundreds of collumns in the commas delimited list. It will returns "Msg 530, Level 16, State
    1, Line 8. The statement terminated. The maximum recursion 100 has been exhausted before statement completion.maxrecursion greater than 100." Tried adding OPTION (maxrecursion 0) in the Split function on the SELECT statment that calls the CTE, but
    the syntax is not correct.
    Can someone help me to get this sorted out? Thanks
    DROP FUNCTION [dbo].[SplitFields]
    go
    CREATE FUNCTION [dbo].[SplitFields]
    @String NVARCHAR(4000),
    @Delimiter NCHAR(1)
    RETURNS TABLE
    AS
    RETURN
    WITH Split(stpos,endpos)
    AS(
    SELECT 0 AS stpos, CHARINDEX(@Delimiter,@String) AS endpos
    UNION ALL
    SELECT endpos+1, CHARINDEX(@Delimiter,@String,endpos+1)
    FROM Split
    WHERE endpos > 0
    SELECT 'Id' = ROW_NUMBER() OVER (ORDER BY (SELECT 1)),
    'Data' = SUBSTRING(@String,stpos,COALESCE(NULLIF(endpos,0),LEN(@String)+1)-stpos)
    FROM Split --OPTION ( maxrecursion 0);
    GO
    IF OBJECT_ID('tempdb..#ifs_tables') IS NOT NULL DROP TABLE #ifs_tables
    SELECT *
    INTO #ifs_tables
    FROM (
    SELECT 'CustomerTable' , 'Lname,Fname' UNION ALL
    SELECT 'AccountTable' , 'Type,AccountNumber'
    ) d (dLocalTable,dFields)
    IF OBJECT_ID('tempdb..#tempFieldsCheck') IS NOT NULL DROP TABLE #tempFieldsCheck
    SELECT * INTO #tempFieldsCheck
    FROM
    ( --SELECT dLocaltable, dFields from #ifs_tables
    SELECT dLocaltable, (SELECT [Data] FROM dbo.SplitFields(dFields, ',') ) from #ifs_tables
    ) t (tLocalTable, tfields) -- as Data FROM #ifs_tables
    SELECT * FROM #tempFieldsCheck

    Try this
    DECLARE @DemoTable table
    localtable char(100),
    fields varchar(200)
    INSERT INTO @DemoTable values('customertable','fname,lname')
    INSERT INTO @DemoTable values('accounttable','type,accountnumber')
    select * from @DemoTable
    SELECT A.localtable ,
    Split.a.value('.', 'VARCHAR(100)') AS Dept
    FROM (SELECT localtable,
    CAST ('<M>' + REPLACE(fields, ',', '</M><M>') + '</M>' AS XML) AS String
    FROM @DemoTable) AS A CROSS APPLY String.nodes ('/M') AS Split(a);
    Refer:-https://sqlpowershell.wordpress.com/2015/01/09/sql-split-delimited-columns-using-xml-or-udf-function/
    CREATE FUNCTION ParseValues
    (@String varchar(8000), @Delimiter varchar(10) )
    RETURNS @RESULTS TABLE (ID int identity(1,1), Val varchar(8000))
    AS
    BEGIN
    DECLARE @Value varchar(100)
    WHILE @String is not null
    BEGIN
    SELECT @Value=CASE WHEN PATINDEX('%'+@Delimiter+'%',@String) >0 THEN LEFT(@String,PATINDEX('%'+@Delimiter+'%',@String)-1) ELSE @String END, @String=CASE WHEN PATINDEX('%'+@Delimiter+'%',@String) >0 THEN SUBSTRING(@String,PATINDEX('%'+@Delimiter+'%',@String)+LEN(@Delimiter),LEN(@String)) ELSE NULL END
    INSERT INTO @RESULTS (Val)
    SELECT @Value
    END
    RETURN
    END
    SELECT localtable ,f.Val
    FROM @DemoTable t
    CROSS APPLY dbo.ParseValues(t.fields,',')f
    --Prashanth

  • Challenge for SQL Query Experts

    Hello Everybody.
    I'm sorry but my English language is not good enough.
    I Have 2 tables.
    First 'tb_Transaction_In' Contains all sales  invoices (items Output from the stock)
    Second 'tb_Transaction_Out' Contains all purchases invoices  (items input  to the stock)
    I want to add  to every Invoice (which has many items) a column which calculate the cost value.
    example:
    stock 1 has an input invoice:
    Quantity of the invoice items 'x' is 10
    UTPrice is 100 for the one 'x'
    so my stock now has 10 pieces of x and the cost of the x is 100$
    =====================
    then the first Output:
    Quantity of the invoice items 'x' is 3
    Current Cost is 100$ for the one 'x'
    My stock has 7 pieces of x 
    =====================
    then the second input:
    Quantity of the invoice items 'x' is 5
    UTPrice is 75$ for the one 'x'
    so my stock now has 7+5 pieces of x and the cost of the x is (100*7 + 75*5) / 7+5
    =====================
    then the seconde Output:
    Quantity of the invoice items 'x' is 10
    Current Cost is 89.5 $ for the one 'x'
    My stock has 2 pieces of x 
    =====================
    ID Stock
    Product Price
    QtyIn QtyOut
    CurrentQty Cost
    1 R1
    x 100$
    10 0 10
    100$
    2 R1
    x 150$
    0 3 7
    100$
    3 R3
    x 75$ 5
    0 12
    89.5
    4 R2
    x 105$
    0 10 2
    89.5
    This is the DDL:
    USE [6]
    GO
    /****** Object:  Table [dbo].[tb_Transaction_In]    Script Date: 25/03/2014 1:19:25 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tb_Transaction_In](
    [Date] [datetime] NOT NULL,
    [Quantity] [decimal](18, 5) NOT NULL,
    [ProductCode] [nvarchar](50) NOT NULL,
    [StockCode] [nvarchar](23) NOT NULL,
    [Type] [nvarchar](5) NOT NULL,
    [UTPrice] [decimal](18, 5) NULL,
    [NotUsedQty] [decimal](18, 5) NULL,
    [ID] [uniqueidentifier] NOT NULL,
     CONSTRAINT [PK_dbo.tb_Transaction_in] PRIMARY KEY CLUSTERED 
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    /****** Object:  Table [dbo].[tb_Transaction_Out]    Script Date: 25/03/2014 1:19:25 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tb_Transaction_Out](
    [Date] [datetime] NOT NULL,
    [Quantity] [decimal](18, 5) NOT NULL,
    [ProductCode] [nvarchar](50) NOT NULL,
    [StockCode] [nvarchar](50) NOT NULL,
    [Type] [nvarchar](5) NOT NULL,
    [PendingAmount] [decimal](18, 5) NULL,
    [UTPrice] [decimal](18, 5) NULL,
    [ID] [uniqueidentifier] NOT NULL,
     CONSTRAINT [PK_dbo.tb_Transaction_out] PRIMARY KEY CLUSTERED 
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(48.00000 AS Decimal(18, 5)), N'TX121/50/W', N'RI', N'AI', CAST(11.09000 AS Decimal(18,
    5)), NULL, N'3b626123-799f-4e92-8fec-003cbeb2f6fc')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'RVS/SP-5-669-59', N'RI', N'AI', CAST(0.00045 AS Decimal(18,
    5)), NULL, N'b65e6927-969f-4bfb-aa0e-0273066bbdea')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501341DBC AS DateTime), CAST(20.00000 AS Decimal(18, 5)), N'YYIS-ICF2S13H1LDK*255', N'RP255', N'ST', CAST(61.08273
    AS Decimal(18, 5)), NULL, N'82de4604-ad11-40ae-a8d2-0926444123cd')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A5014657A5 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'BJ3361L', N'RO', N'RSL', CAST(7905.00000 AS Decimal(18,
    5)), NULL, N'8f3350d5-5cb7-49da-8b69-0e0c61d6c546')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'YYDG-CDM-R 35W', N'RI', N'AI', CAST(152.58000 AS Decimal(18,
    5)), NULL, N'f10eca1d-7215-4015-89de-10f629bc4091')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A50121C4DC AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'AF700F0/1T1.PT.01', N'RT', N'ST', CAST(82.79003 AS Decimal(18,
    5)), NULL, N'617576aa-5c6a-406c-8d76-168f8ba9d62b')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(2.00000 AS Decimal(18, 5)), N'YYHE-SIS180 220V*255', N'RP255', N'ST', CAST(49.64832 AS
    Decimal(18, 5)), NULL, N'a524aea7-2c75-4818-b6ac-196e80aef011')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(12.00000 AS Decimal(18, 5)), N'FO191116', N'RI', N'AI', CAST(132.52000 AS Decimal(18,
    5)), NULL, N'e1804c98-a753-44d2-9fe0-1b41a04099d2')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501341DBC AS DateTime), CAST(21.00000 AS Decimal(18, 5)), N'YYIS-IZT-2S26-M5-LD*255', N'RP255', N'ST', CAST(243.82820
    AS Decimal(18, 5)), NULL, N'93217ef1-a1c5-47af-8c49-1c8cacaf7f35')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'CIDV-ITACA/48*GOLD', N'RT', N'AI', CAST(441.94000 AS Decimal(18,
    5)), NULL, N'a9de52c4-a814-4db8-8db8-1e7a391f6450')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'FO25131', N'RI', N'AI', CAST(45.70000 AS Decimal(18, 5)),
    NULL, N'57480184-b8a7-43f3-a522-effc3733bcb7')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'NNSRC-181', N'RP303', N'AI', CAST(272.04000 AS Decimal(18,
    5)), NULL, N'292d363f-9be4-471c-b868-f41fc1a74138')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(42.00000 AS Decimal(18, 5)), N'YYHE-TC126-42*255', N'RP255', N'ST', CAST(47.80049 AS
    Decimal(18, 5)), NULL, N'732adced-785d-4c0a-b675-f436e9fcd430')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'SKDVW0808EA', N'RI', N'AI', CAST(3862.27000 AS Decimal(18,
    5)), NULL, N'f00853e4-f585-4cf7-994c-f4edf8cb421b')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(3.00000 AS Decimal(18, 5)), N'LLIL-89147', N'RI', N'AI', CAST(62.50219 AS Decimal(18,
    5)), NULL, N'3e7a26cd-ece2-44b0-8416-f500e5bb0bfb')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(100.00000 AS Decimal(18, 5)), N'YYHE-SI218-40*255', N'RP255', N'ST', CAST(52.80909 AS
    Decimal(18, 5)), NULL, N'90ad3dcd-6478-4b86-bdec-f7818ad7156f')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(135.00000 AS Decimal(18, 5)), N'LA4903020*294', N'RI', N'AI', CAST(379.04000 AS Decimal(18,
    5)), NULL, N'0b62da54-5db6-465f-8229-f79a93c4dbf1')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'DN921/FL 2X28*303', N'RI', N'AI', CAST(69.74000 AS Decimal(18,
    5)), NULL, N'270cb795-83c2-43b1-ae43-f8bef36b3470')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A501207B90 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'FO173011/220V*407', N'RI', N'AI', CAST(118.00000 AS Decimal(18,
    5)), NULL, N'cca4ac36-7538-45d0-90f8-f9a941515b74')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(12.00000 AS Decimal(18, 5)), N'YYHE-SI217-32-UNI*255', N'RP255', N'ST', CAST(51.15577
    AS Decimal(18, 5)), NULL, N'9da49db4-8bfb-488d-a153-fd36ef21df47')
    INSERT [dbo].[tb_Transaction_In] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [UTPrice], [NotUsedQty], [ID]) VALUES (CAST(0x0000A2A600DE48DC AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'LLIL-84700*253', N'RI', N'ST', CAST(143.01118 AS Decimal(18,
    5)), NULL, N'01831955-485b-4d6c-9665-fda401b8a5d1')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500C6CA8F AS DateTime), CAST(25.00000 AS Decimal(18, 5)), N'KHBG-4345*318', N'RI', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(1431.68531 AS Decimal(18, 5)), N'77d8fe2b-b7f7-4afb-baf2-00371e49ef50')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A600DE48DC AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'FO81177', N'RP318', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(125.19275 AS Decimal(18, 5)), N'64bb5a74-4f36-40bb-8a15-0178d9ce3532')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500E4483C AS DateTime), CAST(2202.00000 AS Decimal(18, 5)), N'TNSP-0594*020', N'RI', N'TO', CAST(0.00000 AS Decimal(18,
    5)), CAST(4.88155 AS Decimal(18, 5)), N'a6d2c5e8-315e-427f-9745-01c5f6857f62')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A50120C690 AS DateTime), CAST(10.00000 AS Decimal(18, 5)), N'ES651900S*253', N'RI', N'AO', CAST(0.00000 AS Decimal(18,
    5)), CAST(94.01000 AS Decimal(18, 5)), N'ae8a9ba7-74db-4f7d-b830-01f099ac24de')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A501139E98 AS DateTime), CAST(29.00000 AS Decimal(18, 5)), N'KHZM-42176950*255', N'RI', N'ST', CAST(0.00000 AS
    Decimal(18, 5)), CAST(361.52127 AS Decimal(18, 5)), N'2611d667-8db3-4e71-a543-0245258a5788')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A501203C48 AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'TN802/21', N'RP255', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(222.08500 AS Decimal(18, 5)), N'01027e8a-e576-4605-a420-03524fab994e')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500BE530C AS DateTime), CAST(13.00000 AS Decimal(18, 5)), N'ES651900S*253', N'RP253', N'SL', CAST(0.00000 AS Decimal(18,
    5)), CAST(120.00000 AS Decimal(18, 5)), N'dce64410-15b5-4ecc-88b4-04e2b7eac306')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A5011CE020 AS DateTime), CAST(5.00000 AS Decimal(18, 5)), N'LA9801023*313', N'RI', N'TO', CAST(0.00000 AS Decimal(18,
    5)), CAST(1288.96600 AS Decimal(18, 5)), N'3ce3c4b9-b0b4-45c6-b14e-058cb08608d2')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500D8910A AS DateTime), CAST(4.00000 AS Decimal(18, 5)), N'LA4906203*294', N'RI', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(62.34000 AS Decimal(18, 5)), N'25332af7-8f8c-489f-9e96-06427e4b64db')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A50103903E AS DateTime), CAST(24.00000 AS Decimal(18, 5)), N'YYLT-TRWW 155 HFP*294', N'RP313', N'SL', CAST(0.00000
    AS Decimal(18, 5)), CAST(325.00000 AS Decimal(18, 5)), N'4550841e-8ec9-4528-99d9-fcbef5215030')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(2.00000 AS Decimal(18, 5)), N'YYHE-SIS180 220V*255', N'RI', N'ST', CAST(0.00000 AS
    Decimal(18, 5)), CAST(49.64832 AS Decimal(18, 5)), N'10018f9c-a6ba-47c4-aff3-fd515f18c883')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A5012F0B4C AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'YYHE-SH150IZ*255', N'RI', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(74.20504 AS Decimal(18, 5)), N'2a43869a-4300-486d-b534-fe336cc37aeb')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500BE530C AS DateTime), CAST(4.00000 AS Decimal(18, 5)), N'YYVL-00358', N'RP253', N'SL', CAST(0.00000 AS Decimal(18,
    5)), CAST(80.00000 AS Decimal(18, 5)), N'c22c794d-cefe-40a2-b813-fea8aa2cc5fb')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500DBEC64 AS DateTime), CAST(50.00000 AS Decimal(18, 5)), N'TX203/50/BR', N'RI', N'ST', CAST(0.00000 AS Decimal(18,
    5)), CAST(33.85686 AS Decimal(18, 5)), N'3367f8a0-75ff-476e-b3ca-ff095ed25ba6')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A500BE530C AS DateTime), CAST(1.00000 AS Decimal(18, 5)), N'TN0453/3/21', N'RP253', N'SL', CAST(0.00000 AS Decimal(18,
    5)), CAST(250.00000 AS Decimal(18, 5)), N'6c87e1ad-98f8-485d-87e6-ff238eb2317e')
    INSERT [dbo].[tb_Transaction_Out] ([Date], [Quantity], [ProductCode], [StockCode], [Type], [PendingAmount], [UTPrice], [ID]) VALUES (CAST(0x0000A2A501341DBC AS DateTime), CAST(244.00000 AS Decimal(18, 5)), N'YYIS-ICF2S26H1LDK*255', N'RI', N'ST', CAST(0.00000
    AS Decimal(18, 5)), CAST(61.08273 AS Decimal(18, 5)), N'2d04ada8-ee92-4f28-9cbe-ffb855ebd93b')
    ALTER TABLE [dbo].[tb_Transaction_In] ADD  CONSTRAINT [DF_tb_Transaction_In_Date]  DEFAULT (getdate()) FOR [Date]
    GO
    ALTER TABLE [dbo].[tb_Transaction_In] ADD  CONSTRAINT [DF_tb_Transaction_In_Quantity]  DEFAULT ((0)) FOR [Quantity]
    GO
    ALTER TABLE [dbo].[tb_Transaction_In] ADD  CONSTRAINT [DF_tb_Transaction_in_ID]  DEFAULT (newid()) FOR [ID]
    GO
    ALTER TABLE [dbo].[tb_Transaction_Out] ADD  CONSTRAINT [DF_tb_Transaction_Out_Date]  DEFAULT (getdate()) FOR [Date]
    GO
    ALTER TABLE [dbo].[tb_Transaction_Out] ADD  CONSTRAINT [DF_tb_Transaction_Out_Quantity]  DEFAULT ((0)) FOR [Quantity]
    GO
    ALTER TABLE [dbo].[tb_Transaction_Out] ADD  CONSTRAINT [DF_tb_Transaction_Out_Type]  DEFAULT ((0)) FOR [Type]
    GO
    ALTER TABLE [dbo].[tb_Transaction_Out] ADD  CONSTRAINT [DF_tb_Transaction_oUT_ID]  DEFAULT (newid()) FOR [ID]
    GO

    You can do it by means of computed column based on a UDF. 
    so in your table just add a column like below
    CREATE TABLE
    cost as dbo.GetItemCode(ItemCode)
    and function would be as below
    CREATE FUNCTION dbo.GetItemCode
    @ItemCode varchar(20)
    RETURNS Numeric(10,2)
    AS
    BEGIN
    DECLARE @WAP Numeric(10,2)
    SELECT @WAP = SUM((COALESCE(i.Qty,0) - COALESCE(o.Qty,0)) * i.UTPrice)* 1.0/NULLIF(SUM(COALESCE(i.Qty,0) - COALESCE(o.Qty,0)),0)
    FROM (SELECT ProductCode,StockCode,UTPrice,SUM(Quantity) AS Qty
    FROM transaction_in
    GROUP BY ProductCode,StockCode,UTPrice)i
    FULL OUTER JOIN SELECT ProductCode,StockCode,UTPrice,SUM(Quantity) AS Qty
    FROM transaction_out
    GROUP BY ProductCode,StockCode,UTPrice) o
    ON o.ProductCode = i.ProductCode
    AND o.StockCode = i.StockCode
    RETURN (@WAP)
    END
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Different values multiplication

    Hi All!
    I'm creating a fillable module with some calculations. No problem with simple calc with unique fixed values.
    The issue is that i have to give a special rule to some calc. I have to calc the total of orders with the price of products, but prices canghe for multiple orders.
    EXAMPLE:
    PRODUCT A: 42€ up to 4 orders, 37€ from 5 orders.
    PRODUCT B: 58€ up to 4, 55€ from 5
    ECC.
    So the rule i want to apply is that if customer orders 3 "A", the total calculated must be 42*3. If customer orders 7 "B", the calc must be 55*7
    I think i have to write some JS, but I'm not so PRO!!
    thank you all for the help
    EDIT:
    after some reading, i got this, but it doesn't work. it gives me syntax error 3 row 4
    <script>
    function calcola(){
    var tariffa;
    if(document.getElementByName(nca).value <= 4){
    tariffa = 42;
    }else if(document.getElementByName(nca).value >= 5){
    tariffa = 37;
    var TOTCA = (document.getElementByName(nca).value*tariffa)
    alert(totale)
    </script>

    Hai!
    Try this..
    select $[$38.11.NUMBER] * $[$Item.Column.NUMBER]
    Auto refresh on Quantity, Display saved value.
    *Replace Item by Item no and Column by Column no of your UDF in Document, you can find this in task manager when pointing mouse on the udf, before that select > View> System information.
    Regards,
    Thanga Raj.K

  • 'Remarks' on the Journal Voucher print layout

    It is not possible to display the line level Remarks field from the Journal Entry on the Journal Voucher print layout. The header Remarks are displayed but it can be different from the row level values.

    Hi Coasts
    Definitely u can get those udfs in pld if u have created in journal entry line level check the JDT1 table and see the whether the required created Udf is their r not if it is their go to layout take one database field select table as JDT1 and column name select created udf i think this vil solve ur problem
    Regards
    Jenny

  • Journal Voucher Print Layout

    Hi,
    Is there any way to customize the print layout of a journal voucher to include more columns such as user defined fields that may be present in the journal voucher Entry rows?
    thanks,
    Costas

    Hi Coasts
    Definitely u can get those udfs in pld if u have created in journal entry line level check the JDT1 table and see the whether the required created Udf is their r not if it is their go to layout take one database field select table as JDT1 and column name select created udf i think this vil solve ur problem
    Regards
    Jenny

  • Commission base on price range not level for split commission for 3 reps

    Need to figure out how to design this complex commission sturcture.
    Commission NOT only base on price level but need add price range as well since they allow salesrep to sell in the range but over the range the commission rate will reducded.  Exapmle,  Item: A0001  for XYZ company - price level is "01"  is $3.50 and will split with 3 salesmen with different percentage for commision rate 8%.  But, if they selling price drop to $3.11 to $3.49 then the commission rate will be 7%.  When price drop to $3.10 will be price level :02" the commission rate will be 6% etc....
    How to setup Commission Groups with Percentage for different 2 or 3 reps then have to use Price Range for the calculation?

    Commission will be paid when the payment received, 95% will be paid in full.  Nor sure I have to choose data from incoming payment's record but not sure can retrieve the commission group with proper split commssion rate or link with Invoice to retrieve the Commission Group to split with 3 salesreps or 2 salesreps? 
    Which table(s) will be needed?  I will test UDF field if I can develop kind of solution for this first.
    I added this query SELECT $[$38.21.Number] * ($[$38.U_CommPcnt.Number]/100) ', with 2 UDFs, one is CommPcnt and another is CommTtl with User Defined Value - Auto Refresh when Document Total changes on Invoice U_CommTtl column.  These two UDFs worked well. 
    But, How to split total commission to 3 reps when invoices been paid?
    Edited by: Lily Chien on Sep 21, 2009 6:18 AM

  • A/R Invoice sort problem

    Hi every one
    I'm doing an A/R invoice where I've pull some sale orders from de BP, the problem is that the invoice seems to be sorting those sale orders by the number of the documents (ORDR.DocNUM) and I need them to be sort in the order y ctrl+click them in the 'Choose from list window', because i have several columns that need to be sorted in that order and since those are not number columns  I cannot simple dbl click the colum to get the sort done
    Thanks in advance
    enso

    Have you tried to change the sort order of documents in CFL (ctrl-shift-S)?
    AFAIK, the order of lines is determined first by the order of documents in the CFL
    then by the docline nbr.
    If that does not satisfy your requirement then you may
    want to consider the following workaround:
    - 'steal' one column (or make a UDF) for sorting purposes
    - generate a sort value for each line using Formatted Search on that column.
    Here I'm calculating the sort value using line description
    [code]declare @s as varchar(50)
    set @s = $[$38.3.0]
    if len(@s)=0 SELECT 0
    if len(@s)=1 SELECT ascii(substring(@s,1,1))*1000
    if len(@s)>1 SELECT ascii(substring(@s,1,1))*1000 + ascii(substring(@s,2,1))[/code]
    - doubleclick to sort
    HTH
    Juha

  • New DTW Features

    Hi Everyone,
    Have you seen the improvements that have been introduced in the new DTW patches?
    If not check out the blog describing the great improvements that have been made:
    /people/lisa.mulchinock/blog/2010/02/01/new-features-in-the-data-transfer-workbench-dtw
    More planned in each new DTW patch so keep an eye on the blog.
    Cheers,
    Lisa

    Hi Lisa,
    I see a lot of improvement in the feature of DTW. I mean the appearance is okay now, the wizard is well organized.
    Nevertheless, I find a little bit strange behaviour of the oItem object. Our end user SBO can't import the UDF value of existing item master data.
    In previous version, the user is only required to add new column and type the UDF code. After the code available in the row 1 and 2, then the user enter the value. Save as txt file.
    The import is not successful.
    They try to move the udf value to original field of master data i.e. itemname. They succeeded to import it. So, who was the man that must be responsible for this ? do I ask them to enter the UDF value in the existing 4000 items manually ?
    Rgds,
    JimM

  • Line total commssion percentage auto calculation

    Dear All,
    I want to have an option by which when I create a marketing document and in the item row if I create a udf as commission percentage and commision amount, based on the value of line total if I put commission percentage as 20 % of the line total i.e 1000 then in comission amount 200 should come automatically.
    How to do this...can any one tell me how this can be done through query or formated search.
    Thanks in advance.
    Regards,
    Kawish

    Kawish,
    What are the names of the 2 user fields and what are their types?
    Let us presume the Comm % field is called CommPer and Commission Total is called CommTotal
    SELECT $\[$38.21.Number]*($\[$38.U_CommPer.Number]/100)
    Link this to the Commission Total column
    Please change the UDF names as per your definition

  • Tilde Separated List to Table

    Given this SQL:
    SELECT ih.Company, 
    ih.InvoiceNum, 
    ih.SalesRepList
    FROM dbo.InvcHead ih WITH (nolock)
    WHERE ih.Company = 'SCOUT'
    which produces results as shown at left (Original), I would like create a table having new rows for each InvoiceNum with the tilde separated values and display the sales rep number in each row.  Result should look as that on right (Converted)
    Kirk P.

    Try this
    DECLARE @DemoTable table
    Company char(10),
    invoice char(10),
    SalesRepList char(10)
    INSERT INTO @DemoTable values('Scout',10102,'5~2')
    INSERT INTO @DemoTable values('scout',10103,'1')
    INSERT INTO @DemoTable values('scout',10104,'1~2~3')
    SELECT A.Company, A.invoice ,
    Split.a.value('.', 'VARCHAR(100)') AS SalesRepList
    FROM (SELECT Company,invoice,
    CAST ('<M>' + REPLACE(SalesRepList, '~', '</M><M>') + '</M>' AS XML) AS String
    FROM @DemoTable) AS A CROSS APPLY String.nodes ('/M') AS Split(a);
    Refer:-https://sqlpowershell.wordpress.com/2015/01/09/sql-split-delimited-columns-using-xml-or-udf-function/
    --Prashanth

  • How to mapp in UDF column of MasterData  &  Master Data Rows  UDO add time?

    Hi   all ,
      I have one MasterData(A) & 3 MasterData Rows(B&C) table
        A (Code ,Name ,U_SKU,U_AName,U_AID)      Master table
        B(Code ,Name ,U_SKU,U_BName,U_BID)        Child table
        C(Code ,Name ,U_SKU,U_CName,U_CID)        Child table
       Now tables are automatic Mapped with  Code  UDO Creation time but i want  to mapping with U_SKU  column
       please help  how to mapp MasterData(A) and  3 MasterData Rows(B&C) table with UDF Column
    Thanks in Advance
        Surajit kundu

    in the start routine of transformation from 0MAT_SALES_ATTR to znewmat do the following:
    select materials from /BIC/PZNEWMAT into i_mat
    for all entries in source_package where material eq source_package-material.
    loop at source_package.
    p_ind = sy-tabix.
    read table i_mat with key material = source_package-material.
    if sy-subrc ne 0.
    delete i_mat index p_ind.
    endif.
    this way you'll only update records that have previously been loaded by 0MATERIAL_ATTR DS
    loading sequence:
    first load ZNEWMAT from 0MATERIAL_ATTR. then activate ZNEWMAT. then load 0MAT_SALES_ATTR to ZNEWMAT.
    M.

  • How to export UDF and related columns?

    Hi All,
    how to export related UDF columns? When we do export of User.xml and import on fresh copy of OIM we do not have related column. I can not find correct option in deployment manager to export User DF. How to achieve this?
    Best
    mp

    bbagaria wrote:
    I had burned my hands with OIM 11G UDFs import/export. I would suggest manual create when you are moving to a new environment. Again UDFs have clashes with connectors etc and I have few SRs for those.
    HTH,
    BBI've managed to tame UDF attributes and categories for users and organizations using the ConfigManager service. But beware: in 11.1.1.3 it works for the USR table only, you need 11.1.1.5 to deal with organizations.
    See here for some hints:
    http://idmclub.wikidot.com/configservice-service

Maybe you are looking for

  • Error while installing Migration Tool kit for SAP BPC7.0

    Hi all, We are implementing SAP Business Planning and Consolidation Migration Process to BPC 7.0. We are trying to installin Migration Tool Kit. In this kit we are having two set up files - one for BPCMigrationClient and another for BPCMigrationServe

  • How do i shrink a dvd file size

    hi this proberbly very easy but i don't know how to do it so it isn't to me , I want to copy my childrens discs because they leave them lying around and the get knackered so i thought if i just give them the copy and stash the original it would be gr

  • How can you print 1-3 pages of a web document?

    I have an Ipad with a HP6500A Plus and can print. I have the eprint app loaded on the ipad. I need to be able to select the pages to print from a web page. This question was solved. View Solution.

  • Adobe Acrobat 8.1.2 Pro Print to PDF problem

    We are trying to us the print to PDF method of PDF creation. In the past you were able to select the PDF job options from under the apple print menu and in the PDF options section. When used under Illustrator or Indesign this would also allow you to

  • Tree using APEX 2.2

    Hi I have created a tree using APEX 2.2 and the wizard provided. The select for my tree is: select "NODE_PRIMARY_KEY" id, "NODE_FOREIGN_KEY" pid, CASE WHEN NODE_PRIMARY_KEY = :P6_SELECTED_PK THEN '<span style="color:white;background-color:#0000CD;">'