Formatted Search Query for BatchNo

Dear All,
I am using the following query as formated search for Identifying the batches availble during the creation of  Delivary document
in a user defined column at row level. When i click on this field it's showing the Batches for the Item with Zero Qty also.
I need to display only the batches where the QTY >0. This query displaying even the Zero Qty Batches also. Please help me to modify the below query for getting the above. Below is the  query .
SELECT distinct  T4.[BatchNum] FROM [dbo].[OIBT]  T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN DLN1 T2 ON T1.ItemCode = T2.ItemCode INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry INNER JOIN IBT1 T4 ON T0.BatchNum = T4.BatchNum AND T3.DocNum = T4.BaseNum INNER JOIN OWHS T5 ON T0.WhsCode = T5.WhsCode WHERE T0.[ItemCode] = $[$38.1] AND  T4.[WhsCode] = $[$38.24] AND T0.[Quantity]>=$[$38.11]
Regards
Srini

i removed that T5, But It's  showing the  Batches where the qty in the main warehouse for that batch is Zero.That batch was actually present in another warehouse. And also when i am working on other warehouses it's showing the batches in the main warehouse where the qty is present.
Regards
Srini
Edited by: Srini on May 11, 2010 10:24 PM

Similar Messages

  • Formatted Search query for Vacation Accrued

    Hi Experts,
    I have a Client who needs to keep tract on the Vacation Accrued on the Employee Master Data. I have created this UDF on the Master Data, but I could not get the query for the Formatted Search right.
    This Formatted search on the UDF ( must look at the OHEM.startDate field and populate the following:
    If it is a still within year of the system date, it must populate 0,
    If it is > 1 year and < 3 years, it must populate 5,
    etc.
    Any help would be greatly appreciated.
    Marli

    Hi Experts,
    Here is what I did for the query mentioned above:
    {SELECT
    CASE
               WHEN (T0.startDate > GETDATE() -356)
                       THEN 0
               WHEN (T0.startDate > GETDATE() - 712)
                       THEN 5
    END
    As 'Vacation Accrued'
    FROM OHEM T0}
    The issue is that if I link this query to the UDF on the EMD, I get a list of 0 and 5 to choose from. I need to populate automatically.
    Thanks.
    Marli

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

  • Formatted Search Query for Variable field

    Hi Experts,
    I have a client who wants a UDF on the Delivery Document to auto populate wiht a Variable field in the Administration module. This variable field was added by a Add-on.
    The system information is:
    Form: ShipOpt
    Item: Boxes
    Pane: 1
    Column: Box Name
    Row: 0
    Variable: 3
    How do you specify a Variable field in the Query?
    Any help would be appreciated.
    Thanks,
    Marli

    Hi Marli,
    You may only use Current form variable for FMS query.  I believe you need UDF on the Delivery. SO the other form will not be available to your query.
    Thanks,
    Gordon

  • How to club 2 queries in one formatted search query

    Hi All,
    I have inserted a formatted search in the stock transfer for chnaging the 'From warehouse' based on series.
    I have written following query for same,
    SELECT $[$18.1.0]='08' WHERE $[OWTR.series] ='46'
    It is working Fine
    I want ot use same concept for selecting other based on other warehouse
    e.g
    SELECT $[$23.5.1]='02' WHERE $[OWTR.series] ='45'
    But I am not able to club these queries on one formatted search query can anybody help to group it in one formatted search query....
    Thanks and Regards,
    Atul Joshi
    Edited by: Atul Joshi on Dec 23, 2008 5:20 PM

    Hi Atul,
    You could define the quey like this
    SELECT
    CASE
             WHEN $[OWTR.series]='46' THEN '08'
             WHEN $[OWTR.series]='45' then '02'
    end
    from OWTR
    Regards,
    Vijay kumar
    SAP Business One Forums Team

  • Mandatory Input in Formatted Search Query Field

    I have created formatted search query. Which has only one field "Serial Number"?  I have to ensure that, the user has to enter the value in that field.  How to do that?
    I was thinking on implement in stored procedure SBO_TransactionNotification with Object_Type = "219". But I am not sure, how to enforce the validation only for this search query.  Because there are 50+ formatted search queries are available in the system.
    Please help

    Hi Suresh
    Check the below document
    How to SET a UDF field as Mandatory Does TNSP required for It?
    With Regards
    Balaji Sampath

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • Help on Formatted search query

    Hello
    I have a formatted search that is the following to select line of marketing documents example
    select [$23.5.NUMBER]
    when the general setting display decimal separator as "," I have no problem but when decimal separator changes to "." then the formatted search is giving me error because result is [number.000000] too many zeros when it is without zeros with decimal separator set to ","
    How can I have the query run without zeros at the end when decimal is set to ","
    Thank you for your help

    Hi,
    Please advice exact field to check.
    Thanks & Regards,
    Nagarajan

  • Formatted search query with variable

    Hi
    I am trying to create a formatted search on a purchase order document.The scenario is as follows:
    The issue is that the client will on certain stock records incur a tooling cost when raising a PO. This is a once off cost when they order a particular item. For example the tooling cost on a stock item is u20AC5.50. The cost price on the item is u20AC100. If they order for example 5 of these the total cost is u20AC505.50 i.e. u20AC100*5+tooling cost of u20AC5.50.
    What we are attempting to do is pull through the tooling cost and add this on to the line total using a formatted search.
    -UDF created on item record table. This is set type 'Unit and totals' and structure is 'Price'. This is called ToolingCost
    -UDF created on marketing doc rows for ToolingCost. Again this is set to the same type and structure as the UDF on the item record.
    -We have created a UDF on marketing row for total cost and set a formatted search against this with query attached that is attempting to calculate the total cost. We cannot get this to work and the problem would appear to be that the price field is a variable and this is causing an issue on the query. Can we include a variable field in our query and if so what should the syntax be?
    Our query at the moment is 'SELECT 100*($[POR1.QTY.NUMBER])+($[POR1.U_TOOLINGCOSTS.NUMBER])
    Note 100 in query syntax above to be replaced by price on POR1 table.
    Can anyone provide assistence please.
    Derek Smith

    Hi Derek........
    Try this.....
    declare @var1_Qty as varchar(255)
    declare @var2_Pr as varchar(255)
    declare @var3 as float
    declare @var4 as float
    set @var1_Qty=$[$38.11.0]
    set @var2_Pr=$[$38.14.0]
    Set @var3=$[POR1.U_TOOLINGCOSTS.0]
    set @var4=cast(substring(replace(@var2_Pr,',',''),0,len(replace(@var2_Pr,',',''))-3) as float)
    select (@var1 * @var4)+@var3
    Hope this will help you.......
    Regards,
    Rahul

  • 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

  • Formatted Search query

    Hi all,
    We have the following formatted search defined in OITM under Item Desc (foreign language):
    SELECT T1.DocNum AS 'Doc No', T1.CardCode AS 'BP Code', T1.CardName, T2.ItemCode, T2.OpenQty AS 'Open Qty', T2.WhsCode
    FROM [dbo].[ORDR]  T1 INNER JOIN [dbo].[RDR1]  T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OITM T3 ON T2.ItemCode = T3.ItemCode
    WHERE T2.ItemCode = $[OITM.ItemCode] AND T2.OpenQty > 0
    When run, we get a pop-up window with the relevant information. My question is, is there a way to make the T1.DocNum something which can be drilled down on?
    Thanks alot!!
    Rajiv Agarwalla
    G.Mckenzie & Co

    Hello Rajiv,
    I think only the Choose From List pop-menu is available in SAP.  For me, the Choose From List is a user-friendly feature because you can find or search through codes.

  • Formatted search query adding spaces

    Hello,
    I have created a table U_Items in SBO database.
    I was trying to run this query using formatted search.
    SELECT ItemDesc
    FROM U_Items T0
    WHERE T0.ItemCode = RTRIM(LTRIM('$[$38.1.0]'))
    When the query gets executed '$[$38.1.0]' is repalced
    by 'N'A00001       '' value.
    I want the value to be 'A00001' so that it can match the record in the U_Items. How can I get rid of the trailing spaces?
    Thanks,
    Sheetal

    Hello Sheetal,
    Your query,
    SELECT ItemDesc
    FROM U_Items T0
    WHERE T0.ItemCode = RTRIM(LTRIM('$[$38.1.0]'))
    I think must be
    SELECT ItemDesc
    FROM [@U_Items] T0
    WHERE T0.ItemCode = RTRIM(LTRIM($[$38.1.0]))
    if this is a user defined table.
    I think your query seems ok.  It doesn't work?

  • Formatted Search Querry for UDF

    Dear All,
            My client is using SAP B1 2007 B PL10. Now I am facing a issue like, I have made a UDF in the A/P Invoice Form and hence made it mandatory. But when i make a UDF field as mandatory I have to write a particular default value.  Hence i have written default Value as 0.
          Now whenever i open the A/P Invoice Form,  the mandatory UDF Field is showing default value as 0. But I want to write a Formatted Search Based Querry in a way that the UDF Field should become Nil whenever I Open the A/P Invoice Form.
          Please guide me in writing the Formatted Search Querry by which the UDF Field which is having a Default Value as '0' should become Nil.
        Regards
    Hitesh Parsawala

    Hi Hitesh ,
    You have two option :
    1.Either donot make ur UDF mandatory at the time of creation
    Use sp_transaction notification to validate
    2. Define UDF manadatory at the neginning
    if user donot change the value , triggger approval procedure through FMS
      I think it is
    Select Distinct 'True' from tablename where <userdefined field =''i
    If user donot change, it is going to triger approval procedure
    <You can look for code in forum if that is not working >
    Hope this helps
    Bishal

  • Formatted Search query on Sales Order Lines

    Hi Experts,
    I have a client that needs a Formatted Search that will bring back values according to the following Scenario:
    The Formatted search will be placed on the Sales Order Lines RDR1.U_UPC field.
    On a Sales Order I have created UDFs: RDR1.U_Label and RDR1.U_UPC
    On the BP Master Data I have created the UDFs: OCRD.U_UPCChoice
    On the Item Master Data I have created the UDFs: OITM.UPCRetail and OITM.UPCLoc and OITM.UPCItem and
    OITM,UPCOther
    When the RDR1.U_Label field is '1', I need the RDR1.U_UPC to be the text 'not Applicable'
    When the RDR1.U_Label field is '2', I need it to look at the OCRD.U_UPCChoice.
         If that value is '1' then it must bring back the OITM.UPCRetail Value back in the RDR1_UPC field,
         If that value is '2' then it must bring back the OITM.UPCLoc Value back in the RDR1_UPC field,
         If that value is '3' then it must bring back the OITM.UPCItem Value back in the RDR1_UPC field,
         If that value is '4' then it must bring back the text 'Look at Attachment'
    Any help would be greatly appreciated.
    Thanks,
    Marli
    Edited by: Marli Schutte on Aug 31, 2009 6:29 PM

    Hi Marli,
    Try this:
    IF $[RDR1.U_Label] = '2'
    SELECT Case T0.U_UPCChoice
    When 1 THEN T1.U_UPCRetail
    WHEN 2 THEN T1.U_UPCLoc
    WHEN 3 THEN T1.U_UPCItem
    WHEN 4 THEN 'Look at Attachment'
    END
    FROM dbo.OCRD T0, dbo.OITM T1
    WHERE T0.CardCode = $[$4.0.0] AND T1.ItemCode = $[$38.1.0]
    Thanks,
    Gordon

  • Doubt in formatted search query

    HI all
    This is the query i have seen in the forum
    Regarding linking of the UDF size in BOM to Production Order,
    you will need to create a formatted seach as the tables where the UDF exists are different.
    In case your UDF is at the row level then use the following SQL
    SELECT T0.U_SIZE FROM DBO.ITT1 WHERE T0.FATHER = $http://$6.0.0 AND T0.CODE = $http://$37.4.0
    Set this to auto refresh Exiting Alterned column Due Date.
    Can any one tell me what  does the following syntax mean
    T0.FATHER = $http://$6.0.0
    AND
    T0.CODE = $http://$37.4.0
    what is 37.4.0 and 6.0.0.
    or any one help me whre can i find the materials for the above things.

    FATHER refers to the Parent Item Code in the BOM definition
    CODE refers to the Child Item Code in the BOM definition
    If you Open the Production Order and Enable System Information from the View Menu and place your Cursor on the Product No field you will see the Item No on the Task Bar.
    $[/$6.0.0] - 6 refers to the Product No field on the Production Order form
    Similarly in $[/$37.4.0] - 37 refers to the Item Code at the Row level 4 refers to the column number in the matrix and 0 refers to the type
    Ignore the / I have used above
    Suda

Maybe you are looking for

  • How can I move back the rman convert file from file system to ASM?

    I have no idea on pluging-in the data files which were unloaded as follows: SQL> alter tablespace P_CDDH_DSPGD_V1_2011 read only; SQL> alter tablespace P_IDX_CDDH_DSPGD_V1_2011 read only; SQL> exec dbms_tts.transport_set_check('P_CDDH_DSPGD_V1_2011,P

  • Huge Syncing bug when iPad is almost full

    Hi, Just wanted to report I've just encountered a huge bug some minutes ago. My iPad1 16gb (4.3.3) was almost full, there were something like 491mb left. Tried to sync it via iTunes (10.3.1) which was unable to sync and import purchased apps cos it c

  • Windows Update Error Code 8007273D: Cannot Find Solution

    When trying to update Windows, I'm running into error code 8007273D.  When I click the link "Get help with this error", it takes me to a generic page.  After doing a help search for this code, nothing turns up.  After surfing the Microsoft website wi

  • Can I put a SATA 3 Solid State Drive in my Compaq Presario CQ57-447SI?

    I would like to upgrade my Compaq Presario CQ57-447SI and replace the hard drive with a solid state drive.  I'm considering the OCZ-Vertex-4 2.5 inch SATA 3 Solid State Drive (128GB) but I'm not sure if this will be compatible with my notebook?

  • User exit for MD01

    Hii I am doing user exit for MD01 i am finding difficulty in writing the code . I want materials haveing MRP Type : 'V1'. I wrote code for it but its not working .. TABLES: t024d, mara, marc . TABLES : t023t. DATA: v_dispo TYPE dispo, v_matkl TYPE ma