Query for formatted search

Hi All,
I have a line UDF called U_PO in the sales order documents that denotes our purchase order number that particular item is ordered on.
I have another line UDF called U_XMill which I want to populate with the corresponding PO document due date.
What would be my query for that?
Basically, it should be something like:
SELECT T0.DocDueDate FROM OPOR T0 WHERE T0.DocNum=$[$38.44.0] FOR BROWSE
However, I am sure that "38.44" is wrong.
It should denote my current document's UDF *.U_PO.
And I am not sure what would be the correct notation for it.
I was wondering if there was a help document I could refer to to figure out the corresponding field numbers for the cases like this.
Thank you for your help.

Hello
use FMS on matrix (tables) as
[ItemUID.ColumnUID.Type] or [TableName.FieldName]
where itemUID is 38
ColumnUID is U_XMill
Type is 0 (general).
There is a now-to guide on service.sap.com/smb/sbo where you can find how to us FMS.
Regards
J

Similar Messages

  • SQL query for formatted search

    Hi guys and expertise,
    I have this one problem where i need to do the formatted search,below is my example query that i  have done
    declare @itemcode varchar (20)
    set @itemcode = (select x.itemcode from OITM x where x.ItemCode=[%])
    declare @itmgrp varchar(50)
    set @itmgrp=(select y.itmsgrpnam from OITB y where y.ItmsGrpNam=[%1])
    select
    CASE
    when @itemcode = 'Item Descriptions 1' then @itmgrp
    else t0.ItmsGrpNam
    end
    from OITB t0 inner join
    OITM t1 on t0.ItmsGrpCod=t1.ItmsGrpCod
    where t1.itemcode=@itemcode
    ***correct me if i'm wrong
    the condition is :-
    whenever the user selection is 'Item Descriptions 1' user will have to select the product group name else
    if the user selection is not equal to "Item Descriptions 1", automatically the product group name will be default according
    to the item code itself.
    i wonder if it's possible?  if it is, then i suppose there should be a way,right?

    Hi Gordon...
    Thanks a lot for the answer,
    I did try some research and manage to find a way out for the query that I want, the query is as below:-
    BEGIN
    IF
    $[$38.1.0]='Item Descriptions' or $[$38.1.0]='Item Descriptions 1' or $[$38.1.0]='Item Descriptions 2' or
    $[$38.1.0]='Item Descriptions 3' or $[$38.1.0]='Item Descriptions 4'
    SELECT T0.ItmsGrpNam FROM OITB T0 inner join OITM T1 ON T0.ItmsGrpCod=T1.ItmsGrpCod
    Group By T0.ItmsGrpNam
    ELSE
    SELECT T0.ItmsGrpNam FROM OITB T0 inner join OITM T1
    ON T0.ItmsGrpCod=T1.ItmsGrpCod where T1.ItemCode=$[$38.1.0]
    END
    regards,
    Asyraf

  • Can we write query for fomatted search without from clause

    can we write query for fomatted search without from clause as below.
    SELECT (($(u_amt)*14)/100)
    here U_amt is a UDF .I want to assign this to another field .
    Rgds,
    Rajeev

    Hi Rajeev,
    You can write query for FMS without from.  That is because you can omit it when you get value from active form by default.  The grammar of it is:
    Select $[$38.u_amt.0\] * 14/100 in your case if you have item type marketing document @line level.
    From View-System Information, you can get the info you need for your FMS query at the left bottom of your screen.
    Thanks,
    Gordon

  • Help needed for Formatted Search

    Hai Experts,
    would like to ask you some clarification on Formatted Search. In the
    query I found $http://$44.2.1 given in the criteria part.
    In some articles it was mentioned that, the 44 meant for the table
    connected with the form and 2 is field index and so on.
    Can you please explain how to find out those numbers and field index.
    I need to work out planty of FMS to fetch data into
    UDF automatically based on user input.
    Regards
    Anand

    Hi Anand,
    You may check these threads first:
    Re: Vendor default GL FMS help
    Re: Runtime data calculation
    Thanks,
    Gordon

  • Authorizations for formatted searches?

    Hello experts,
    I have created a simple formatted search so users select from the list the country of origin of a batch.
    Currently, they get an error message.
    Do you know which authorizations I should give them so they can use that formatted search query?
    Many thanks

    Hi Pam,
    In Authorisation window for the particular user who is facing the error.
    Navigate Admin > System initilisation > Authorisation > ( Select ) >
    Reports --> Query Generator -->  Execute Non - Select SQL Statement  and give  Full Authorisation.
    Is the User now able to execute FMS ?
    Regards,
    Rakesh N

  • Date Difference Query Syntax Formatted Search

    Hi Experts,
    My client renders a service(warehousing of Cargo) on time and material basis,therefore the Quantity column of the AR Invoice represents the number of days the cargo was warehoused.
    I want to create a formatted search with reference to a query on this field to help me compute the number of days automatically. The number of days is normally calculated by Subtracting the the Admission date(Serial Number Details Table "OSRI", field "InDate" from the document date of the invoice) from the AR invoice document date.
    Considering that the Item is serial number managed, the item serial number will connect the Serial Number details table to the AR Invoice table.
    Can anybody help me with the syntax of the query that will achieve the above for me.
    Waiting to hear from you .
    Thanks

    If you have many serial numbers for an item, there will be no way to identify which serial number was actually selected in the invoice till the time the Invoice is added.
    So knowing the Serial Number that was selected on that Invoice is important and what you select in the Serial number selection window on the Invoice is stored in temporary location and cannot be referencing by looking into OSRI table.
    If there are multiple serial numbers with different InDate's, how could you calculate?
    Is there a Delivery Step?  Delivery > Invoice
    OR
    Do you copy SO > AR Invoice directly
    Suda

  • Round up syntax for Formatted Search

    Hi all,
    I need help on writing the formatted search syntax for below scenario.
    Discount % = 2 decimal place only
    Unit Price = 99,376.00
    Discount = 30.97%
    Price After Discount = 68,599.25
    I want the Price After Discount to be rounded up to 68,600. Any idea how to achieve this? Will do this round up in another UDF so that my layout will show the rounded up price to customer.
    Even if the Price after discount is 600.02, i wanted the result to be always rounded up to nearest $1 as long as the original price has some amount at the decimal. For this case, should round up to 601.00.
    Anyone can help? Thanks in advance.

    Hi Too Mui Hwee
    Will the UDF be varchar or numeric? Do you want the udf to show the currency as well?
    I have done both for you. The problem with SQL 2008 & 2012 is that they don't have a roundup function. This is however in version 2014 which is not yet supported by SAP Business One.
    Without currency:
    SELECT CASE WHEN ROUND($[$38.17.NUMBER],0) < $[$38.17.NUMBER] THEN ROUND($[$38.17.NUMBER],0) + 1 ELSE ROUND($[$38.17.NUMBER],0) END
    With currency:
    SELECT CASE WHEN ROUND($[$38.17.NUMBER],0) < $[$38.17.NUMBER] THEN $[$38.17.CURRENCY] + ' ' + CAST(ROUND($[$38.17.NUMBER],0) + 1 AS VARCHAR(20)) ELSE $[$38.17.CURRENCY] + ' ' + CAST(ROUND($[$38.17.NUMBER],0) AS VARCHAR(20)) END
    Kind regards
    Peter Juby

  • How to frame the select query for wildcard search.

    Hi Experts,
    I have an input field P_USERALIAS.This value could contain the actual value or the wildcard for example : user can enter P_USERALIAS as SAP123 or S or SAPABC123 . I need to generate a dynamic search on table USREFUS  depending on what has been entered.Please help.
    Useful answers will be rewarded.
    Regards,
    Shrita Sharma.

    THIS IS A TEST REPORT FOR WILDCARD SEARCH**
    TABLES: USREFUS.
    PARAMETERS: P_NAME1 TYPE string.
    RANGES: R_NAME1 FOR USREFUS-USERALIAS.
    DATA: T_usrefus LIKE usrefus OCCURS 0 WITH HEADER LINE.
    *replace
    if p_name1 cs '*'.
    replace all occurrences of '*' in p_name1 with '%'.
    SELECT * FROM usrefus
    INTO TABLE T_usrefus
    WHERE useralias like P_NAME1.
    else.
    SELECT * FROM usrefus
    INTO TABLE T_usrefus
    WHERE useralias = p_name1.
    endif.
    LOOP AT T_usrefus.
    WRITE: / T_usrefus-useralias.
    ENDLOOP.
    **THANKS & REGARDS
    SHRITA SHARMA.

  • What incorrect syntax found in this query for dynamic search

    I make this stored procedure for dynamic search by date from date to employee no employee name
    but it give me error why
    Create proc CollectsearchData15
    @StartDate datetime,
    @EndDate datetime,
    @EmployeeID NVARCHAR(50),
    @EmployeeName nvarchar(50)
    as
    Begin
    DECLARE @SQLQuery as nvarchar(max)
    SET @SQLQuery = N'SELECT * from ViewEmployeeTest Where (1=1)'
    If @StartDate Is Not Null
    SET @SQLQuery = @SQLQuery + N' And (joindate >= @StartDate)'
    If @EndDate Is Not Null
    SET @SQLQuery = @SQLQuery + N' And (joindate <= @EndDate)'
    If @EmployeeID Is Not Null And @EmployeeID != ''
    SET @SQLQuery = @SQLQuery + N' And (EmployeeID = @EmployeeID)'
    If @EmployeeName Is Not Null And @EmployeeName != ''
    SET @SQLQuery = @SQLQuery + N' And (DriverName Like ''%'' + @EmployeeName + ''%'')'
    Print @SQLQuery;
    Exec sp_executesql @SQLQuery,
    N'@StartDate datetime, @EndDate datetime, @EmployeeID nvarchar(50), @EmployeeName nvarchar(50)',
    @StartDate, @EndDate, @EmployeeID, @EmployeeName;
    but it give me this error why
    Msg 102, Level 15, State 1, Procedure CollectsearchData15, Line 28
    Incorrect syntax near ';'.

    I think you are missing an END. Perhaps with no dynamic sql :
    SELECT * from ViewEmployeeTest
    WHERE
    (joindate >= @StartDate OR @StartDate IS NULL)
    AND
    (joindate <= @EndDate OR @EndDate IS NULL)
    AND
    (EmployeeID = @EmployeeID OR @EmployeeID IS NULL)
    AND
    (DriverName Like '%' + @EmployeeName + '%' OR @EmployeeName IS NULL)
    Thanks and regards, Rishabh K
    Please keep in mind that this might cause proc to generate bad plans
    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How do I use "Search Query" for nontrivial searches?

    After a few years in the community, this is my _first_ question to the boards ;-)
    In speaking with a colleague today, I learned about an NI forum feature that would be useful for me. When I tried to configure it, I then learned that I didn't know how to use it. When I tried to learn how to use it, I further learned that it wasn't fully documented. So, I'd like some clarification :-)
    The feature in question is "Search Query" which will send you an email when a forum search matches your query. What I don't know is:
    What are the rules (syntax) for search queries? For example, I would like to search for single words, all the words that I specify, as well as exact phrases. How do I differentiate between multiword queries and exact phrase queries?
    Is it possible to have more than one Search Query?
    If so, how do you delineate them? Would I use commas, a new line, something else?
    I'm asking because the available (and discoverable) documentation doesn't mention what to do when you want more than one Search Query. The help text on the subscription page [1] makes me think that only one query is possible, and says a Search Query:
    Sends you mail every time a message matching your query is submitted. Search queries take up to 15 minutes to take effect. Saving a blank query will disable this feature and will stop any mail from being sent.
    The other place I tried was the NI Forum FAQ [2], which makes me think that more than one query is possible:
    If you add a board, thread, message, or search term to your subscriptions, the system will send you an e-mail every time someone posts to the board, or replies to the message or thread. If you prefer not to receive an e-mail for your subscriptions, you can subscribe to the RSS feed of a board, thread, user, or search term.
    The FAQ goes on about what to do with board, thread, and message subscriptions, but doesn't say anything more about search subscriptions.
    The last place I looked was on the search results page itself. In the blue header that precedes the results, there's a link on the far left that says "Search Options" with a single option that says "Subscribe to this search's RSS Feed". While I could subscribe and use an RSS reader, I really would prefer email. I suppose if only one Search Query is possible, then this will be my workaround.
    As a comment, why does the Search Options menu not also have a "Subscribe to this search" option, which would add another entry in the Search Query box? This is a noticeably different interface than the Thread Options menu.
    [1] Subscriptions & Bookmarks
    http://forums.ni.com/ni/user_subscriptions
    [2] Frequently Asked Questions
    http://forums.ni.com/ni/help_faq
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)
    Solved!
    Go to Solution.

    Hi Joe,
    Thanks for all of the questions and congrats on posting your first question!
    Unfortunately I think all of your questions come from the valid assumption that the search query functionality is more robust than it actually is.  The search query functionality really only serves a single purpose and that is to email you when your phrase has been posted to the forums.  For me, I use it to email me when my name is mentioned in the forums.  It serves this purpose well since I have it set up to work off just a single search term.  However I find that multiple word phrases are combined with an OR which is not as useful.  The search query does not adhere to any common search syntax that you would expect (I believe we are the only community that uses this feature so it has not been improved upon).
    The best way to set up both multiple word queries and multiple different queries is to use the RSS feed as you mentioned.  This way you can tailor your search very specifically using different advanced search options and subscribe to them all in one feed reader without constantly getting emails.  The search query emails do not adhere to the digest subscription settings.  I find that the RSS feeds work very well for searches and I am fond of using them, but I do use an RSS Reader for many things so it is not out of my normal workflow.
    Thank you for reading the Forum FAQ.  I've done some work to improve it but I think it has a long way to go and it's good to know that people read it
    Regards,
    Laura
    Web Support & Operations
    National Instruments

  • Property "Query" for basic search iView - documentation needed

    the iView com.sap.km.cm.basicsearch has a property called Query. I need to know what are all the possible values for this property (SearchPluginName, SearchComponentName etc... and what do these values represent?! ). Are these documented somewhere?

    Hi Tiberiu,
    check this:
    https://www.sdn.sap.com/irj/sdn/thread?threadID=197279
    Regards, Karsten

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

  • Using Second Column of Formatted Search

    Hi All,
    i have a query for formatted Search, which goes like This
    "Select ItemName, ItemCode from oitm"
    When i press Tab on the field 'Product No.' in 'Production order',
    i get the CFL of ItemName and ItemCode.
    when i select one row from this, i need to capture the ItemCode
    in the field 'Product No.' (By Default it captures the first Column i.e ItemName)
    Any suggestion are most welcome
    Regards,
    Mahendra

    Mahendra,
    By default it will fetch the first column only. one workaround what you may not like to use is, to define a user defined field in production order form and give an FMS there. ther you show the itemname first as you have written, and give an Auto refresh FMS on production order field where you change it to itemcode when item name is selected.
    HTH,
    Regards,
    Binita

  • Formatted Search in Matrix

    How to create a query for formatted search if my variable is in the matrix(some column and some row).
    I would like the SAP user get a list of all Workorders for a Job, and Job is a cell in matrix.
    Workorder value should be shown in another cell in the same row.
    Thanks a lot,

    Hi Pavel,
    The document 'How to Define and Use Formatted Search' on the Service Market Place goes through defining and using formatted searches with queries. It also explains how to use fields in an active form in a formatted search, look at the section called 'Search by Saved Query' in the document.
    To find this document go to
    www.service.sap.com -> Channel Partner Portal -> Solutions - SAP Business One -> Support -> Additional Information - Documentation Resource Centre -> SAP Business One 2005 A SP 01 -> How to guides -> 'How to Define and Use Formatted Search'
    This document also gives some examples of the types of queries which are used in formatted searches.
    Hope this helps
    Noreen

  • 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

Maybe you are looking for