Formatted Search on Item Master

Experts,
I have a client who sells commodities. They need their Pricelists to be updated with each Purchase, because of fluctuating Prices.
If I can get the following Formatted Search to work, I believe that Iu2019ll have a solution:
I created a UDF on the Item Master Inventory tab rows, which I called OITW.U_Test
I need to populate this UDF with the following calculation: (OITW.OnHand * OITW.AvgPrice) + (T1.OnOrder * (Sum of all the quantities on open POu2019s)) / (OITW.OnHand + T1.OnOrder)
Here is the logic behind it: This UDF must show a modified Moving Average. Because POu2019s does not update the AvgPrice (only the Goods Receipt PO) this is cause for concern for this client who might have Sales Orders for Items that is not in stock yet, and posted as a lower AvgPrice.
Here is what I have done so far:
Select T0.ItemCode, T1.OnHand, T1.AvgPrice, T1.OnOrder,
     T1.OnHand*T1.AvgPrice as 'InStock Value',
     T1.OnOrder* ?????? as 'PO Value'
From OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
     INNER JOIN POR1 T2 ON T0.ItemCode = T2.ItemCode
Any help will be appreciated.
Marli

Gordon,
I tested this and you are right, to use a FS will not work because of the refresh issue.
I'm now working on a Stored Procedure that will update this UDF when a PO is Added or Updated. My experience with Stored Procedures is limited to True or False statements. (If this is true, do not add the Document, if it is false add the document)
My question is: Can I populate the UDF, with a Value according to my query, with a Stored Procedure?
Thanks for your help.
Marli

Similar Messages

  • Creating a Formatted Search in Item Master based on Unit Price

    Hi Experts,
    I have to create a Formatted Search for assigning the Standard Cost of Items as Selling Price-Selling Price*.05  i.e the Standard cost of the item should be set upon automatically equal to 5% less of Selling Price .
    I have created the following Formatted Search Query :
    SELECT ((SELECT $[$34.68.NUMBER])-(SELECT $[$34.68.NUMBER] *.05))
    and have assigned this FS to Standard Cost Field . I am not able to base it upon Unit Price field . This FS is correct but it is not automatically refreshing upon change of Unit Price and I have to manually update it(ALT+F2) . I guess the filed upon which it should be based upon is not correct .
    please guide me how to resolve this issue . How to base this FS upon Unit Price.
    Thanks and Regards,
    Pooja Singh.

    Hi,
    Actually I dont want to set upon the last No for the Series. What about the Sequence ? Administration->setup->financials->Tax->Sequence. Here also the same thing can be done but Location Specific. When I created 2 Series for the two different locations , I found that two different fields appeared on the screen Sequence Name Where I found the two sequences I defined for the two locations. If you have any idea about what this sequence is for and how far is it different from Document Series , please let me know.
    Thanks and Regards,
    Pooja Singh

  • Formatted Search and Item Events

    Hi,
      I am having a huge problem with using Formatted Search and Add-Ons.
    On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes.  This is the only Formatted search on this form and it works fine.
    However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times.  I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
    If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
    I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on.  Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True. 
    Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
    Thanks for Any Help
    Paul

    Hi Alfredo,
      Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions.  Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything.  I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
    Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On. 
    Thanks Again,
    Paul

  • Problem in implementing formatted search

    Dear All,
    I am using the below code to implement formatted search for item master itemcode textbox. But i am unable to get the formatted search icon for the itemcode text box/ screen. Please correct me where I am going wrong.
    Dim oRs As SAPbobsCOM.Recordset
                                        oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                        Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
                                        oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
                                        oQuery.QueryCategory = -1
                                        oQuery.QueryDescription = "GetDfltBin"
                                        oQuery.Add()
                                        Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
                                        oFormatted.FormID = "150"
                                        oFormatted.ItemID = "5"
                                        oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery
                                        oFormatted.FieldID = "ItemCode"
                                        oFormatted.ColumnID = "-1"
                                        oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin'")
                                        oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''""
                                        oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
                                        oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
                                        oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
    Regards,
    Noor hussain
    Edited by: noor_023 on Mar 30, 2010 12:51 PM

    Dear J,
    Thanx for your post. I am gettig this error now.  "The entry already exists in the following tales odbc-2035". I am writing the above code in the page load event of item master form as below.
    If ((pVal.FormType = 150 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
                    '// get the event sending form
                    oForm = oSboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                    If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
                        Dim oRs As SAPbobsCOM.Recordset
                        oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
                        oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
                        oQuery.QueryCategory = -1
                        oQuery.QueryDescription = "GetDfltBin1"
                        oQuery.Add()
                        Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
                        oFormatted.FormID = "150"
                        oFormatted.ItemID = "5"
                        oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery  'bofsaQuery  'bofsaQuery
                        oFormatted.FieldID = "5" 'ItemCode
                        oFormatted.ColumnID = "-1"
                        oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin1'")
                        oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''"" ' oRs.GetField
                        oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
                        oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
                        oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
                        oFormatted.Add()
                        If oFormatted.Add() Then ' 0 Then
                            MsgBox(oCompany.GetLastErrorDescription)
                        End If
                    End If
                End If

  • Formatted Search on Inventory Posting

    Dear Experts,
    I have a FMS on inventory posting distribution rule, its supposed to display the distribution rule automatically for the items, without human intervention.  How can I set this to auto-refresh ?  since when using this form virtually no column is normally touched apart from the reconcile button.
    Edited by: Roc on Apr 8, 2010 4:27 PM

    Hi Gordan,
    we have upgraded SAP B1 2005 to 2007 - we are using old query for formatted search for items in marketing document - can in that cancelled items also reflecting - can you please correct that query where i dont want to reflect cancelled items.
    SELECT T0.[ItemCode] AS 'Item No.', T0.[ItemName] AS 'Item Description', T0.[UserText] AS 'Item Details', T0.[OnHand] AS 'In Stock' ,T0.PrchseItem,T0.SellItem FROM  [dbo].[OITM] T0  WHERE (T0.[UserText] Like N'%[%0]%'   ) AND  (T0.[UserText] Like N'%[%1]%'   ) AND  (T0.[UserText] Like N'%[%2]%'   ) AND  (T0.[UserText] Like N'%[%3]%'   )
    Thanks

  • Formatted Search - Calculate GP Base Price for Non Inventory Items

    Hi Experts,
    On one of our customer's 8.8 PL 15 installation, requirement was to calculate GP for Non Inventory Items (on SO screen). Since SAP does not automatically calculates it we proposed and implemented following solution.
    1. Have all Non Inventory Items to be costed at Standard cost so that you can manually enter the cost in the Item Master.
    2. Write following formatted search on GP Base Price field so as to calculate the GP Base Price for the Non Inventory Items only. The formatted search must not make any changes to Inventory Items as we want system to calculate the GP automatically (just in case cost changes from SO to Delivery or Invoice).
    DECLARE @II AS nVarchar(1)
    DECLARE @COST AS Numeric(19,2)
    SET @II = (SELECT OITM.InvntItem FROM OITM WHERE OITM.ItemCode = $[RDR1.ItemCode])
    SET @COST = (SELECT     (OITW.AVGPrice * $[RDR1.NumPerMsr]) FROM     OITW WHERE     OITW.ItemCode = $[RDR1.ItemCode] AND
         OITW.WhsCode = $[RDR1.WhsCode])
    IF (@II = 'N')
    BEGIN
    SELECT @COST
    END
    3. Formatted search achieves what was originally required however if a user overwrites the Item Code (Inventory Item) in the SO then above formatted search clears the GP Base Price field and sets the GP basis for the item as "Manual". By obverwrite means user first selected item A0001 on line 1 and then entered A0002 on same line i.e. Line 1.
    My question here is what is wrong in the formatted search that is resulting in this behaviour.
    Any questions please let me know.
    Thanks in advance.
    Regards
    Devinder

    Hi Gordon,
    Thanks for taking out time to help me however Key requirement here is
    Write formatted search on GP Base Price field so as to calculate the GP Base Price for the Non Inventory Items only.
    Your query sets the base price for GP Base Price for Inventory Item to ZERO and Base Price By to Manual.
    Note that my Formatted search has a problem only when an Inventory Item line is overwritten. I am not sure if this is a problem with SAP itself rather than my query.
    Any other ideas please?
    Regards
    Devinder

  • Formatted search to auto generate Item No.

    Hi,
    Customer is using 2007A PL47. They had requirement to auto generate Item No based on UDF created in Item Master Data(OITM). The stock code structure is as follow:
    Item No=EP(hardcode 2 char)+U_ProdRange U_ProdGroupU_ProdFamily+user defined text
    The keystroke steps are:
    1. Key in item description
    2. Select drop down list for U_ProdRange in OITM
    3. Select drop down list for U_ProdGroup in OITM
    4. Select drop down list for U_ProdFamily in OITM
    5. Formatted search to generate Item No based on 2,3, 4
    6. User keys in user defined text in Item No
    7. Fill in other relevant fields in Item Master Data
    8. Add Item Master Data
    May I know how to write the query in formatted search?
    Regards
    Thomas

    Hi,
    I had got solution.
    Try this Select TOP 1 'EP' +$[OITM.U_ProdRange] +$[OITM.U_Prodgroup] +$[OITM.U_ProdFamily]
    Regards
    Thomas

  • Formatted Search defined on an item added with the UI API

    Hello,
    I have added an Edit Text with the UI API on the Sales Orders form. It is visible and enable.
    I have linked a Formatted Search to this Edit Text.I have indicated to refresh the value on Supplier Name changed.
    I have linked the same formatted search to the Remarks field with the same conditions of launching.
    When I change the BP name, the formatted search on theremarks field is launched, but the formatted search on the Edit Text is not launched.
    Why the formatted search on the Edit Text is not launched when the condition for refresh is true?
    Thanks for your help.
    Best regards,

    Hi,
    This is a simple Edit Text which is not bound.
    I can launch manually the formatted search, but it is not launch automatically!
    It seems that SBO can't launch automatically FS on user forms and user items.
    I have tried to define a FS on the Fixed Asset master data form and you can only launch the Formatted search manually.

  • Formatted search query for displaying invoice items details

    hi all,
    i need to display all the items in AP invoice.kindly suggest me a query for that.
    in AP invoice
    Ex. row items
    code--descqtyprice--
    total
    I0001--XXXXXXX5--
    100 -
    500
    query should display this row as
    code--desc--
    price
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    =================================
    the query should display as the qty is 5 so it will display the same item 5 times
    kindly suggest me some query for formatted search
    its very urgent
    regards
    sandip

    Hi Sandip,
    DoQuery("Select b.ItemCode from OINV a,INV1 b Where a.DocEntry=b.DocEntry")
    Hope its help for you
    Give me reward points,
    Regards,
    G.Suresh.

  • Problem when create auto numbering in BP master using Formatted Search

    Hi all,
    I have a problem in creating auto numbering in BP for Customer type using Formatted search
    My query is like this
    declare @tempNo as char(20)
    set @tempNo=(select  Isnull(max(REPLACE(OCRD.CardCode , LEFT(OCRD.CardCode,10),'')),0)  + 1
    from OCRD where (CardType ='C') and LEFT(OCRD.CardCode,3) = 'CU.' )
    set @tempNo='CU.'left(convert(varchar,GETDATE(),112),6)'.'+@tempNo
    select cast(@tempNo as char(20))
    It should be creating the new number for example
    CU.201101.1
    CU.201102.2
    CU.201103.3
    CU.201103.4
    The format will be like this CU.YYYYMM.autonumbering
    So if the current year is still the same it will always increase the number and it will reset the number become 1 if the current year is change.
    But when i execute the number , the number doesn't increase, still generate the last number CU.201103.4
    I have use this query in generate item number, it runs well but different format.
    Is there some thing wrong with my query?
    Thanks in advance
    Regards
    Jia shun

    Hi Jia shun,
    You have posted an identical threads. There is no such need. Please close this one and response to the one with answer already.
    Thanks,
    Gordon

  • Read item code from Sales Order with formatted search

    hi,
    i'm tring to read tha values of the item or items of a sales order (before save it) with a formatted search.
    i have no problem to read the value of card code or cardname but i can't read the item's value.
    i tried with this [code]Select $[RDR1.ItemCode][/code]  (i found it on the forum) but it doesn't work.
    somebody can help me ?
    thank you

    Hi, Alessandro!
    I think the trouble is that you are trying to assign a FS to the header of the document. You are getting the information of the current row, so you have to bind a formatted search to some column of the "table - part" of the document.
    And also you can try:
    SELECT $[$38.1]
    38 - the value of "Item" (when you point a mouse to the cell, information you want from)
    1 - the value of "Column" (the same...)
    It will get an info of this cell in a current row.
    HTH!

  • Formatted search to update item description in Purchase order document

    Hello Everyone,
       Has anyone developed a formated search to update the item description field on the PO or SO document?  I need to change the  standard Item Description  based on the BP catalog number but cannot seem to get it to work.  I know to change it using the screens you need to enter CTRL+TAB to move from the field without triggering a lookup process but do not know how to do this in a formatted search.  Has anyone tried this?

    Hi,
    You may check this :
    BP Catalog Number in 8.8
    Thanks,
    Joseph

  • Formatted Search is not auto-refreshed when Item Description changes

    Hi all,
    I have a UDF "Packing Details" at Goods Receipt screen row level.
    My formatted search setting is the field should be auto-refreshed when Item No is changed.
    1) I press TAB at Item No and choose an Item, Packing Details UDF will auto-refresh. (No problem)
    2) However, if i press TAB at Item Description and choose an Item, Packing Details UDF will not auto-refresh. I need to press SHIFT+F2 to make packing details appear.
    I try the same setting at Goods Receipt PO, the Packing Details UDF will refresh automatically regardless i choose the item from Item No or Item Description.
    Is anyone face this problem before?
    Thanks.
    Regards,
    Lay Chin

    Thanks Gordon.
    I have told this to customer before, but they prefer to have 'Refresh' on both Item Code and Item Description.
    I think we have no choice but let the customer to choose either one, right?
    Thanks.
    Regards,
    Lay Chin

  • Formatted Search on user-defined items

    Hi everyone,
           I have to edittext item, editA and edit B. I created a formatted search on edit B but with a condition depending on the value of my editA. My query results to an internal error. Below is my code. Thanks
    SELECT T0.[Field1] AS [Field1]
    FROM [dbo].[@TABLE]
    T0 WHERE T0.[Field2] = [EditB]
    What is the right format for getting the value of [EditB] during run time?
    Regards,
    Omann

    Hi,
    Create the User Query and Save it with some name...
    Declare @Item varchar(20)
    Set @Item = Replace(RTRIM($[$editA.0.0]),'*','') + '%'
    SELECT T0.ItemCode AS 'Item Code', T0.ItemName AS 'Item Description' from OITM T0 WHERE T0.ItemCode
    like @Item
    Assign the Query to the User Defined Item i.e for editB Item in the FORM
    With Regards,
    MadhuSudhana Rao.G

  • Automatic formatted search for row udf item group autofill

    Dear All,
    I have a field udf field in the row of marketing document named u_itemgroupcode. I want that when an item is selected in any marketing document in the above udf automatically the Item Group code should come from the corresponding item OITB table.
    How to achive this through auto refresh formatted search.
    please help....!
    regards
    kamlesh

    Hi Kamlesh,
    ItemGroup code is available in OITM table itself. You could define the formatted search on the udf field
    with this query and define auto refresh with Item No.
    SELECT T0.[ItmsGrpCod] FROM OITM T0 WHERE T0.[ItemCode] =$ $38.1
    Regards,
    Vijay Kumar
    SAP Business One Forums Team

Maybe you are looking for

  • Accessing attachments stored in Open text (ECC) with Work manager 6.0

    Hello Experts, We are using Open text in one of our ECC systems to store documents, files, pdfs and other attachments for the Work Orders and Notifications. We want to configure the Work Manager 6.0 application hosted on SMP2.3, in order to fetch all

  • Installing the SDK from .dmg

    Hello. I was wondering if the old SDKs get uninstalled or overwritten when we install the new SDKs? The only reason I ask is because I had the 3.0 SDK, then upgraded to 3.1 which said it would take like 4 GB or something about a wk ago, and then upgr

  • My macbook starts up windows but not osx

    So after doing the software update on my mac side, it all of a sudden stopped booting up. Just stuck in the grey apple logo screen. However, I am able to boot up in my windows partitioned side. Is there any way to fix this? Or has my macbook crashed

  • Error Message: "There is currently a high demand f...

    Whenever I call my Skype number I get a recorded message saying "We're sorry. There is currently a high demand for this destination". This happens from my office phone, from my mobile phone, and from other places I have tried. If this is what my call

  • Questionable Legality: HyperlinkListener without URLs

    Hey guys, My goal is to have website-style links in a JEditorPane that cause certain behaviors in my GUI when the user clicks them. The SSCCE below works exactly how I'd want it to. The only problem is, I feel a bit dirty using a HyperlinkListener in