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

Similar Messages

  • 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 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 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

  • Problem with formatted search on UDO Form

    Hi,
    I've created an UDO and in the lines I have the fields ItemCode and ItemName. In the ItemName field I have a formatted search configured the next way:
           -Search by Saved Query
               -QueryName
           -Auto refresh when existing altered column
               -ItemCode
           -Refresh regularly
    This formatted search works fine when I do <shift> + F2 in the field. But when I change the field ItemCode and get out of the field it doesn't execute the formatted search.
    Any ideas?
    Thanks in advance, regards
    Vanesa

    Hi Vanessa,
    Firstly (and I'm not giving lessons on sucking eggs) does this work when run as a query with the $ field replaced with a litteral value that you know exists in the table you're searching (surrounded by single quotes)?
    The reason I say this is that I have had a few where as opposed to giving an error I've been hitting shift+f2 with absolutely NO feedback via error messages.
    Which form is this within? How have you used the variable element in the query?
    Is it possible for you to show the query? Along with details on which form you're using it in?
    Hopefully be able to help with more info,
    Julian

  • My Formatted search work wrong!!

    I'd like to get your understanding on my english ability.
    But..., Time Pressed..
    Please Help me ..
    I make a UDO and Formatted search(It Update the U_CardName whenever the U_Cardcode changes )
    After, I link a Formatted search to my form(using screen Painter and connecting UDO, it works good).
    The problem is formatted search work only When i pushed "Update" button in screen of Define Formatted Search , otherwise it doesn't work.
    so now, I work ..
       1. Form Load.
       2. Ctrl + Shift + f2 press in edittext of U_cardname
       3. (Originally, Checked "Display Saved Values"
          check "Refresh Regularly" and
          check "Display Saved Values"
       4. "Update"
    what's the my problem?
    why is it happend?

    Hi Lee,
    You have to define a Query in the cardname field indicating that the query must be executed when the value of CardCode changes.
    Now, define such a query:
    SELECT T0.CardName AS 'BP Name' FROM  [dbo].[OCRD] T0 WHERE  T0.CardCode = RTRIM($[$3.U_CardCode])
    Where "3" is the item number of the column that contains the U_CardCode. Check the one is assigned to your field using the "Debug Information" in the "View" Menu
    When you define the Formatted Search:
    - Select Search by Saved Query and choose the one that contains the statement above
    - Auto Refresh when...
    - Select here the description that match your U_CardCode field
    - Display Saved Values
    Now you have set your UFS and it works!
    Hope this helps,
    Felipe

  • 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

  • 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

  • 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

  • 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.

  • 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 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 problem plz slove it.

    Hi All,
    I created one user defined form. In that i put two fields. And i entered something in one fields, automatically that number will go to next. I written that query and i put it in second field using formatted search. And i given link also. But first time it is working fine. after that, it is not working. Again i have to go second field, and press ****+F2. But i don't want this.. Plz any one slove this..
    Regards,
    krishna.v

    Hi Krishna,
    Can you try delinking the FS and link again. I tied replicating your scenario and it works.
    Field 1 - @Master.A1
    Field 2 - @Master.A2
    FS 1 - $[@Master.A1.Number]
    FS 2 - $[@Master.A2.Number]
    Linking:
    FS1 --> Field 2
    FS2 --> Field 1
    This will make the columns identical irespective of where the user keys in data. Is this what you are looking for. If yes, please reconfirm that you have done the above.
    Regards,
    Hamsa

  • Problem in Formatting Total Column in Classic Table

    Hi,
    I am using Classic Table.
    I am able to format the column data but i am unable to format the column total value. I searched in forum and tryed something like in the following thread..
    Problem in formatting Total Value in advanced table
    since i am using Classic Tables i am unable to do it.
    I also tried the following
    OATableBean table = ....
    OATotalRowBean totalRowBean = (OATotalRowBean)table.getColumnFooter();
    System.out.println("Formattotal : "+totalRowBean);
    if (totalRowBean != null)
    oracle.cabo.ui.validate.Formatter formatter = new OADecimalValidater("#,##0.00;#,##0.00","#,##0.00;#,##0.00");
    totalRowBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
    in this case the total is not formatted.
    I also refered developer guide. There i found how to set value to total column.. but how to get the value its not given..
    Any body pls help in this regards
    Thanks & Regards

    Hi,
    When i am using Classic Table i am able to format column data but i am not able to format the column Total
    Code i using ;
    OATableBean table = (OATableBean) webBean.findChildRecursive("EmpTestVO12");
    table.prepareForRendering(pageContext);
    OAMessageStyledTextBean totalBean = (OAMessageStyledTextBean)table.findChildRecursive("Salary");
    if(totalBean!=null)
    Formatter formatter = new OADecimalValidater("#,##0.00;(#,##0.00)","#,##0.00;(#,##0.00)");
    totalBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
    //Properly formatting column data
    Whe i am using OAAdvance Table bean i am able to format the total but i am unabele to format the Column data. Using following code..
    OAAdvancedTableBean tableBean=(OAAdvancedTableBean)webBean.findChildRecursive("region2");
    tableBean.prepareForRendering(pageContext);
    OAColumnBean c1=(OAColumnBean)webBean.findChildRecursive("column12");
    if(c1!=null)
    c1.setAttributeValue(CURRENCY_CODE,"USD");
    Can anybody pls tell me how can i achieve both (column values and totals formatting) using either Classic Table or Advance Table..
    Thanks & Regards,
    Ram

Maybe you are looking for

  • Regarding cenvat

    hello all, i am facing the problem that when i create the excise in from TT DLFC then this amount shows in amounts payable part in J2IU and the excise amount of TT GRPO is also showing in same part by clubbing the values , but rest part ie- available

  • Question about users in thr realm file.

    Hi, I started reading and practicing how to implement security issues on web applications. I understand that you can use either a the declarative approach or a programmatic approach using annotations. From what I understand all the users,groups and p

  • Failed to load Data base information

    after completeing the report in crystal when ever i want to see print preview it will say  Failed to load Data base information and whenever i will export the report to pdf it will say Failed to load Data base information please solve this issue

  • HT204291 No mirroring button on iPad mini

    I can see the airplay icon but cannot see the mirroring button on my iPad mini retina v8.1.2

  • I can't download acrobat pro trial version

    Üzgünüz bir hata oluştu. Yükleyici hatalı yapılandırıldığından, bu uygulama yüklenemiyor. Yardım için lütfen uygulamanın gelliştiricisiyle bağlantı kurun.