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

Similar Messages

  • Problems using a formatted search to link order lines to order header

    Hi,
    I'm having a nightmare trying to get the main lines table to populate the header within a sales order using a formatted search.
    I have created a UDF on the header for total value, and where items entered onto the order are of a certain type I need the header UDF to be sumated.
    Basically I have three parts for packaging (PACK1, PACK2 and PACK3), and the header has a UDF called U_TotPack
    Someone did sugest the following query, but this doesn't appear to work either:
    select sum(t0.linetotal) from rdr1 t0 inner join ordr t1 on t0.docentry = t1.docentry
    where t1.docnum = $[ORDR.DocNum] and t0.itemcode in ('PACK1', 'PACK2', 'PACK3')
    If it is a problem for me to use the line total field (as it is a variable calculation) I am happy to total the quantities for the items found, but I just can't seem to build any form of relationship between the header and lines.
    Hope someone out there is able to help as this one has really got me stumped.
    Cheers,
    J

    Hi Julian,
    I'm assuming you are trying to populate the header UDF before the Order is added to the system? If yes then it is not possible to achieve this via a formatted search, only SDK. A header FS cannot properly access line information, it only works the other way around - header info to line level.
    I presume the reasoning is that which line should your header FS take a value from? The FS syntax also doesn't allow you to loop throught all lines.
    The SQL that someone else suggested would only work for a sales order already added to the database. Hope this helps.
    Regards,
    Andrew.

  • Formatted search problem

    Hi,
    i've a problema with a formatted search:
    i want to create a serial number's substring to copy in a user Field.
    i want to launch this query automatically, and i want to update this user field when the user create serial numbers, without the user launch this query.
    this is my query:
    SELECT  DISTINCT SUBSTRING (T0.[IntrSerial], 11,9) FROM OSRI T0  INNER JOIN SRI1 T1 ON T0.SysSerial = T1.SysSerial WHERE T0.[ItemCode] = 'ST_2400_4X2_SL' and  T0.[IntrSerial] = $[$3.54.0]
    Anyone can help? thanks a lot

    Hi,
    the query i s ok, but i have to start it manually, although i want to start it automatically when the serial number field is written, how can do it? Thanks a lot

  • 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

  • Formatted Search calling a stored procedure

    Hello all,
    I am having a problem getting a formatted search to work when I call a stored procedure from SAP (I am doing this because of a bug we discovered and need to get the client live Feb 1).  The stored procedure works fine when passing variables from within SQL Server, but fails when using SAP.  The problem seems to be where I need to get a UDF from the item master table, but not sure.  Thanks in advance
    The call from SAP query is:
    declare @LineType as varchar(6)
    declare @Width as numeric (19,6)
    declare @LI as numeric (19,6)
    declare @LN as numeric (19,6)
    declare @LD as numeric (19,6)
    declare @HI as numeric (19,6)
    declare @HN as numeric (19,6)
    declare @HD as numeric (19,6)
    declare @QtyOrd as numeric (19,6)
    Select @Width = $[OITM.U_WTH]
    FROM OITM
    WHERE OITM.ItemCode = $[$38.1]
    exec TBC_CHOP
    @Width,
    @LineType = $[$38.U_LINETYPE],
    @LI =$[$38.U_LI],
    @LN =$[$38.U_LN],
    @LD =$[$38.U_LD],
    @HI = $[$38.U_HI],
    @HN = $[$38.U_HN],
    @HD = $[$38.U_HD],
    @QtyOrd = $[$38.U_QTYORD]
    The stored procedure is:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    -- =============================================
    -- Author:          <Mark Rueff
    -- Create date: <Jan 5, 2009>
    -- Description:     <Chop Calculation>
    -- =============================================
    ALTER PROCEDURE [dbo].[TBC_Chop]
         -- Add the parameters for the stored procedure here
    @LineType AS varchar(6) ,
    @Width AS numeric(19, 6),
    @LI AS numeric(19, 6) ,
    @LN AS numeric(19, 6),
    @LD AS numeric(19, 6),
    @HI AS numeric(19, 6),
    @HN AS numeric(19, 6),
    @HD AS numeric(19, 6) ,
    @QtyOrd AS numeric(19,6)
    AS
    BEGIN
         -- SET NOCOUNT ON added to prevent extra result sets from
         -- interfering with SELECT statements.
         SET NOCOUNT ON;
        -- Insert statements for procedure here
    SELECT
    CASE
    WHEN @LineType = 'c' AND @Width >= 3
    THEN ROUND((((ROUND((((@Width * 10) + 5) / 10), 1) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
    WHEN @LineType = 'c' AND @Width < 3
    THEN
        CASE
        WHEN RIGHT(CONVERT(int,(@Width * 10)), 1) > 0 AND RIGHT(CONVERT(int, (@Width * 10)), 1) < 5
        THEN ROUND(((((ROUND((@Width - 0.5), 0) + 0.5 * 8)  + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd), 1)
        ELSE ROUND((((ROUND(@Width, 0) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
        END
    WHEN @LineType = 'j' AND @Width >= 3
    THEN ROUND((((ROUND((((@Width * 10) + 5) / 10), 1) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
    WHEN @LineType = 'j' AND @Width < 3
    THEN
        CASE
        WHEN RIGHT(CONVERT(int, (@Width * 10)), 1) > 0 AND  RIGHT(CONVERT(int, (@Width * 10)), 1) < 5
        THEN ROUND(((((ROUND((@Width - 0.5), 0) + 0.5 * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd), 1)
        ELSE ROUND((((ROUND(@Width, 0) * 8) + (((@LI + (@LN / @LD)) + (@HI + (@HN / @HD))) * 2) + 4) / 12) * @QtyOrd, 1)
        END
    WHEN @LineType = 'r'
    THEN ROUND(((((@Width * 2) + (@LI + (@LN / @LD))) / 12) * @QtyOrd), 1)
    WHEN @LineType = 's'
    THEN @QtyOrd * 1.5
    WHEN @LineType = 'o'
    THEN @QtyOrd
    WHEN @LineType = 'l'
    THEN @QtyOrd
    ELSE 0
    END
    END

    Mark,
    I believe the syntax of your formatted search is not right. I guess you are trying to get the U_Width from Item Master and the other values from the current form.
    SELECT @Width = T0.U_WTH FROM [dbo].[OITM] T0.WHERE T0.ItemCode = $[$38.1.0]
    EXEC TBC_CHOP @Width, $[$38.U_LINETYPE.0], $[$38.U_LI.0], $[$38.U_LN.0],
    $[$38.U_LD.0], $[$38.U_HI.0], $[$38.U_HN.0], $[$38.U_HD.0], $[$38.U_QTYORD.Number]
    If you see I have added a third parameter which is the Type to the formatted seach field selection $[$Item.Column.Type]
    I have made then all 0 but you may change it as per the col type.  This Type should be 0 for Char type columns, Number for numeric columns and Date for Date type cols
    Suda

  • Formatted Search on Report Parameter

    Hi Experts,
    I've 5 reports that I build using Crystal Report 2008 for SAP B1. All of them will ask for parameter input. And for the parameter value input user will be helped by formatted search. What confused me is that when I set formatted search for a report, another reports formatted search value will also get change. For example I have 3 reports, A B and C.
    A has 3 parameters: date from, date to and warehouse code
    B has 4 parameters: as of date, warehouse code, item code and branch
    C has 3 parameters: as of date, item code, division
    When I update the formatted search for report B (No query, Warehouse, Item, Branch), then report A and C parameters will also follow those changes. So everytime I run the different report I've to reset the formatted search that will be user input in the report.
    Can anyone give me suggestion how to solve this problem so the formatted search attached to each parameter won't change?
    Thank you before
    Edited by: Willy on Mar 1, 2011 9:31 AM

    Hi Julie,
    I am using SAP token. This is the detail. I need an input of card code of customer to see detail report of the code chosen, but the input can also be typed  by user. and they can type 0 so they can see detail report of all code. At first I think I can use formatted search but the problem is the query I use in each parameter keep on changing, following the last change I do to another report. (as I explain in my first post). Is there any suggestion??

  • Searching problems when implementing my own repository manager

    Hi there,
    i've serious problems to get the search fuctionality for my own repository manager running. I'm using the 'new', Netweaver-based api.
    Always if I'm launching a search I receive a ClassNotFoundException in the follwing context:
    #1.5#172.16.17.102:7CF6B6:FF73BDDB07:-36E7#1097161124650#com.sapportals.wcm.WcmException#irj#com.sapportals.wcm.WcmException.WcmException(118)#System#0#####System_Thread_37##0#0#Error##Plain###invalid manager class: com.sapportals.wcm.repository.runtime.ManagerAdapter java.lang.ClassCastException: invalid manager class: com.sapportals.wcm.repository.runtime.ManagerAdapter
         at com.sapportals.wcm.repository.RMAdapter.<init>(RMAdapter.java:48)
         at com.sapportals.wcm.repository.runtime.CmSystem.getResourcesImpl(CmSystem.java:1134)
         at com.sapportals.wcm.repository.runtime.CmSystem.getResources(CmSystem.java:356)
         at com.sapportals.wcm.repository.runtime.CmAdapter.getResources(CmAdapter.java:153)
         at com.sapportals.wcm.service.indexmanagement.retrieval.trex.TrexSearchIndexCollection.getSearchResults(TrexSearchIndexCollection.java:1126)
         at com.sapportals.wcm.service.indexmanagement.retrieval.search.SearchSession.getSearchResults(SearchSession.java:293)
         at com.sapportals.wcm.service.indexmanagement.retrieval.search.FederatedSearchSession.getSearchResults(FederatedSearchSession.java:111)
         at com.sapportals.wcm.rendering.collection.SearchRendererStatus.refresh(SearchRendererStatus.java:180)
         at com.sapportals.wcm.rendering.collection.LightCollectionRenderer.createStatus(LightCollectionRenderer.java:718)
         at com.sapportals.wcm.rendering.collection.LightCollectionRenderer.renderAll(LightCollectionRenderer.java:498)
         at com.sapportals.wcm.rendering.control.cm.NeutralControl.render(NeutralControl.java:141)
         at com.sapportals.wcm.rendering.layout.cm.SimpleLayoutController.render(SimpleLayoutController.java:39)
         at com.sapportals.wcm.rendering.control.cm.WdfProxy.render(WdfProxy.java:1229)
         at com.sapportals.wdf.layout.HorizontalLayout.renderControls(HorizontalLayout.java:41)
         at com.sapportals.wdf.stack.Pane.render(Pane.java:153)
         at com.sapportals.wdf.stack.PaneStack.render(PaneStack.java:67)
         at com.sapportals.wdf.layout.HorizontalLayout.renderPanes(HorizontalLayout.java:64)
         at com.sapportals.wdf.stack.Pane.render(Pane.java:156)
         at com.sapportals.wdf.stack.PaneStack.render(PaneStack.java:67)
         at com.sapportals.wdf.layout.HorizontalLayout.renderPanes(HorizontalLayout.java:64)
         at com.sapportals.wdf.stack.Pane.render(Pane.java:156)
         at com.sapportals.wdf.stack.PaneStack.render(PaneStack.java:67)
         at com.sapportals.wdf.layout.HorizontalLayout.renderPanes(HorizontalLayout.java:64)
         at com.sapportals.wdf.stack.Pane.render(Pane.java:156)
         at com.sapportals.wdf.stack.PaneStack.render(PaneStack.java:67)
         at com.sapportals.wdf.ControllerDynPage.executeEvent(ControllerDynPage.java:338)
         at com.sapportals.wdf.BaseDynPage.onWdfEvent(BaseDynPage.java:132)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:172)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:101)
         at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:64)
         at com.sapportals.htmlb.page.PageProcessorServlet.doPost(PageProcessorServlet.java:25)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.wcm.app.servlet.WcmHtmlbBaseServlet.service(WcmHtmlbBaseServlet.java:81)
         at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:280)
         at com.sapportals.portal.prt.core.broker.ServletComponentItem$ServletWrapperComponent.doContent(ServletComponentItem.java:110)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:143)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:195)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:589)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:143)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:195)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:636)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:209)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:147)
         at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:789)
         at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:644)
         at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:305)
         at com.inqmy.services.httpserver.server.Response.handle(Response.java:165)
         at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1133)
         at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
         at com.inqmy.core.cluster.impl0.ParserRunner.run(ParserRunner.java:35)
         at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:132)
    I'm using EP 6.0 SP2 directly installed from the CD
    #51 020 549 without explicit installation of any patch or hotfix; the portal itself shows the version number 6.0.2.0.0 (implementation version 6.2.0.0.200310100950).
    I switched on logging but I never reached the INamespaceManager's methods isQueryPropertyNameUnderstood() or getQueryBuilder().
    So I figure that this might a problem of my (too old?) unpatched version of EP6????
    What can I do to get the serach func running?
    Thanks for your support,
    Daniel

    Hi Karsten,
    thanks for your annotation.
    Does it mean that I <b>HAVE TO</b> apply at least Patch 4
    to get the search working or <b>SHOULD</b> I apply the patch to be up-to-date and look for an error in my code???
    Thanx a lot,
    best regards,
    Daniel

  • 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

  • Problem with Formatted Search-Urgent

    Hi All, I have a problem as follows:
    I am trying to set up a formatted search in the Batches Setup window of GRPO document. I want to pickup the "Total Created" figure from Rows From Document grid (i.e. the upper grid) in the form. I want to add 100 to it and then to display the result in the "Batch Attribute1" Field in the lower grid i.e. Created Batches Grid.
    Please someone give me the tested query for the purpose..
    Thanks In Advance
    Amol Mangalkar

    Try the next FS:
    SELECT $[$35.38.Number]+100

  • Problem with activation of Formatted Searches

    There seems to be an error in the activation of formatted searches in SAP B1.
    The following is an example to demonstrate the real situation with a minimum of complexity.
    1. We have defined 2 user defined fields, U_trigger and U_target, in the title area of documents. Both are defined as alphanumeric fields with standard length 10 and some predefined values.
    2. For sales orders we have defined for UDF 'target' that a formatted search 'getTriggerValue' is activated on changes of UDF 'trigger'.
    3. The formatted search 'getTriggerValue' reads the value of UDF 'trigger' and writes it to UDF 'target':
    DECLARE @triggerValue AS nvarchar(10)
    SET @triggerValue = $[ORDR.U_trigger]
    SELECT @triggerValue
    When we add a new document to the database, i.e. the document is in "button-mode" = 'add', there are no problems with the activation of the FS on field 'target' when the value of field 'trigger' is changed!
    After a document is already written to the database and is later displayed on the screen again, the document is in "button-mode" = 'OK'. In this situation the FS on field 'target' IS NOT ACTIVATED when the value of field 'trigger' is changed, i.e. the value of 'trigger' is not copied to 'target'.
    After this first change the document is now in "button-mode" = 'update'. If we now change the value of field 'trigger' a second time the FS on field 'target' is activated an the value is copied from 'trigger' to 'target'.
    If we define the FS of field 'target' with option 'Refresh Regularly' the FS is activated after the first change of field 'trigger' as expected.
    But we CAN NOT USE THIS OPTION AS A STANDARD SOLUTION for our problem, since some fields and their FS can not work with this option and need the standard option 'Display Saved Values' set. Otherwise some fields yield wrong values, since they are working not only with constant predefined values as in the simple example above, but with dates which are set by GETDATE() in the FS, e.g.
    Is this behaviour a bug of SAP (FS is not activated even if the value of the refresh field is changed)?
    If not, what is the idea behind this behaviour?
    And how can I get around this behaviour?
    Thank you for your support!
    Frank Romeni

    Hello Suda!
    Many thanks for your answer!
    Perhaps my explanations are a bit in confusion.
    The example in my question is just to demonstrate the behaviour of the formatted search with option 'Display Saved Values' set, i.e. in a document that is already saved to the database, only after the second change the formatted search is activated.
    I am aware that with the simple formatted search that I have shown as an example everything works fine with the option 'Refresh Regularly'.
    But what is the meaning to activate the formatted search only after the second change when option 'Display Saved Values' is set?
    The reason why we can't use option 'Refresh Regularly' is that in our real application not only constant values are copied from 'trigger' to 'target'.
    Let me give you an example which approaches the real situation more than the first example:
    DECLARE @trigger AS nvarchar(20)
    SET @trigger = $[ORDR.U_trigger]  -- U_trigger / UDF 'trigger'
    DECLARE @save AS datetime
    SET @save = $[ORDR.U_date]        -- U_date / UDF 'date'; save current date
    IF @trigger = 'getDate'
      SELECT GETDATE()
    ELSE IF @trigger = 'getDateConst'
      SELECT '01.01.2008'
    ELSE IF ...
    ELSE
      SELECT @save                    -- no value in @trigger to change date ==> reset
    Option 'Display Saved Values' set: formatted search is activated only after the second change of value of UDF 'trigger'. This is not acceptable!
    Option 'Refresh Regularly' set: Suppose the 'trigger' is set to 'getDate'. The actual date, e.g. 25.06.08, is displayed in UDF 'date'. The document is saved to database. When the document is fetched again on the next day, the formatted search is activated immediately without the change of any values, i.e. 'trigger' still is set to 'getDate'. This is evaluated in the formatted search and the function GETDATE() is called and the now actual date, 26.06.08, is written to UDF 'date'. This is wrong!
    I hope that the new example shows why we can't use option 'Refresh Regularly'!
    We need no regularly refreshed value of UDF 'date', we need an activation of the formatted search only when the value of UDF 'trigger' changes. But why is it activated only after the second change when 'Display Saved Values' is set?
    Thank you for further support!
    Frank Romeni

  • Currency Formatted Search problem

    Hi
    I am trying to creat a formatted search for the marketing docs price / unit price field that populates the field with the currency and money value. I have a lookup table defined in sap where i store the currency and price i want to populate the udf with, based on certain conditions from udf's on the marketing doc's lines.
    when i try to type in a price manually on the form e.g. USD 1 SAP accepts the value with no problems, however business one only lets me insert the actual money value in the field and then inserts the default currency ie if my local currency is ZAR and my formatted search returns a price of 1 then SBO automatically formats the field as ZAR 1.
    If i want to insert a value of USD 1 into the field with the formatted search then SBO returns an error message. I have tried variations such as returning 'USD 1', '1 USD', '1USD', 'USD1' with the formatted search, all of which return an error message. However if i manually type any of the examples in SBO accepts them and formats the column correctly.
    This is quite an important functionality requirement as the customer needs the ability to have different currencies on different lines of a marketing document.
    I have also tried using pricelist lookups with the formatted search but experience exactly the same problem in that i cannot specify the currency in the formatted search.
    If anyone has experienced this problem please let me know if you were able to come up with a solution as manually capturing the prices per line is not an option (documents are often in excess of 500 lines)

    Hi Philip,
    Your question is obviously about functionality of the B1 application - rather than the B1 SDK - and thus might fit better into the "SAP Business One" Forum: SAP Business One Application
    However, I tried to use the non-LC in a Formatted Search in B1 2007 - and I didn't have a problem with that.
    Maybe it's just a bug (that has been fixed)?
    Maybe you should consider using an Add-On / SDK?
    Maybe there's just sth wrong in your query? ...are you sure that your "USD 1" variations are exactly as you wrote?
    Regards,
    Frank

  • Problem in formatted search runing by code

    Hi all, this is my problem:
    I have a one formatted search in one column and i want run it in lost focus of other column. In the forun appear this code to do but something wrong occurs in my case. The formatted search seems run and in one moment the resul value appear in the matrix but in the moment dissapear and the old value remains. Why the formatted search result dissapear?
    this is my code:
    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_LOST_FOCUS && pVal.ItemUID == "38" && pVal.Before_Action == false && pVal.ColUID == "U_n_formato"&&KEYDOWN_NUMERO_FORMATOS)
                    oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                    oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific;
                    try
                        oMatrix.Columns.Item("11").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular,0);
                        SBO_Application.SendKeys("+{F2}");
                    catch
                    //oItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular);
                    KEYDOWN_NUMERO_FORMATOS = false;
    Thank you all again.
    Regards.

    Hi
    you can set the true value to KEYDOWN_NUMERO_FORMATOS = true.
    in Got focus event of  column uid "U_n_formato"
    regards
    senthil

  • Problem With Formatted Search.

    Hi to all,
    I have linked a formatted search to a UDF that lies at row level in AP Invoice. This field is used to display the Sales  Order Price. The requirement is that from SO we create a purchase order and subsequently create a goods receipt and AP invoice.. Now in invoice it is showin perfectly fine whether it is copied from goods receipt or purchase order.. But in the purchase order and goods receipt screen this query will not work. And the same query used in AP invoice is being linked to these documents. Is there any work around for this?? Is it possible to run queries based on the form numbers?? If so ho do i pull the form number in the formatted search query??
    Please Help!!!!
    Regards
    Aris

    I recommend creating separate queries for each document.
    ie
    1 formatted search to lookup price on sales order from AP Invoice
    1 formatted search to lookup price on sales order from GRPO
    1 formatted search to lookup price on sales order from PO
    then change the lookup to pull fields from the document that you are using as a reference.
    when you are building the formatted searhes start by returning the values that are you are using as a reference. That way you are sure that you are pulling the correct information.
    Then layer in the lookup to the sales order.
    If you get stuck I recommend that you copy and paste the formatted search in SQL Server management studio and replace the variables refereces with real values.
    In my experience troubleshooting queries is more effective when using SQL Server management studio. (the error reporting is better).

  • Problem in Formatted Search

    I have added two UDFs namely ItemCode and ItemName on header level of Profit center form.
    I have attached folwing query to ItemCode for Formatted Search
          select Itemcode from oitm
    I want to display the corresponding itemname automaticaly in itemname field. So I created the folowing query:
    Select oitm.itemname from oitm where itemcode= (select $[$U_ItemCode.U_ItemCode])
    setting is that Auto refresh when field changes (ItemCode).
    Now what result I am getting is as follows:
    if I change ItemCode and goto ItemName, the itemname should change automaticaly, but it doesn't happen. However if I press Shift+F2 here on ItemName it takes the correct ItemName. I want that ItemName should be changes as ItemCode is changed automaticaly...
    I am using a Patch 01.
    plz help

    Amol,
    Please try
    SELECT T0.ItemName FROM OITM T0 WHERE T0.ItemCode = $[[OPRC.U_ItemCode]]
    NOTE: The format is $[[TableName.UserField]] .  Since you have create the User field in OPRC table I am referring to it as OPRC.U_ItemCode
    remove the http:// thats got added.
    Suda

  • Problem with formatted search in grid

    Hi all,
              I have a Grid with 3 columns in my user defind form. In that Grid,I used one one formatted search on column 2 based on the value of column 1.
               I mean when i was press 'SHFT+F2' on second column, it will execute the query based on value of  what we entered in the first column of the grid. How can i do this?? How can i fetch the value of first column in the formatted search??. Please help me.
    Thanx in Advance
      Oram.

    Hi
    write a query like this and assign formatted search on column2
    SELECT  ITEMNAME FROM OITM T0 WHERE T0.ITEMCODE = $[/$GRIDUID.COL1 UID.ROWNUM])
    regards
    Vishnu

Maybe you are looking for

  • Logon issues when connecting to the R/3 system via System Template

    Hi All, I have created a System object for connecting to the R/3 system. the R/3 system is on ITS server. i have set the connector properties, ITS server details, User Management properties. Connector Porperties: Application Host: - , logical system

  • Images not syncronizing correctly

    My images won't always sync. Basically I loaded images into Lightroom 4.1 using the auto tone feature. What I'm attempting to do is simply copy my settings from one image with exposure and contrast both set to "0" then syncing them to the rest of my

  • File does not exist: wwv_flow_file_mgr.get_file

    I have an application that uses tabs, which have images that indicate that the tab is current. The image is missing and I get this message in the log: File does not exist: /opt/oracle/product/ccd/10.2/htmldb/images/wwv_flow_file_mgr.get_file I checke

  • Hyperlink in Java platform

    Hi, I hve created parent and child report in parent report i have used Hyperlink after clicking parameter is passing based on that child report is opening.....this linking is possible when i am setting prefrence in Infoview as a Intrective but i am s

  • Query Designer: Error-msg: Please enter a valid value for charact 1FORMULA

    Hello BI friends, when I open a query in the Query Designer (or change query from BEx Analyzer) I get this message. There is no detail description for the message. After pressing the OK-button in the message I get an u201Demptyu201D Query Designer (t