Link Formatted Search to BP

Hi
I would like to attach a query to a UDF on the BP Master Data.
When executed I would like it to display the results based on the current BP number on the header.
What do I need to add to my query to acheive this.
Thank you in advance.
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[U_ABBA_SPuCall], T0.[U_ABBA_SRecDoc], T0.[U_ABBA_SBProdStat], T0.[U_ABBA_SBArtStat], T0.[U_ABBA_SBRecStat], T0.[U_ABBA_ProdSch], T0.[DocDate], T0.[DocDueDate], T0.[U_ABBA_IntNotes], T0.[DocTotal] FROM ORDR T0 WHERE T0.[DocStatus] = 'O' AND T0.[U_ABBA_SBProdStat] = '4'

Hi,
The formatted search can return multiple values back in a list.  Having multiple values though would not work well when auto-refreshing, but when running manually its fine.
Change your query to be:
SELECT T0.\[DocNum\], T0.\[CardCode\], T0.\[CardName\], T0.\[U_ABBA_SPuCall\], T0.\[U_ABBA_SRecDoc\], T0.\[U_ABBA_SBProdStat\], T0.\[U_ABBA_SBArtStat\], T0.\[U_ABBA_SBRecStat\], T0.\[U_ABBA_ProdSch\], T0.\[DocDate\], T0.\[DocDueDate\], T0.\[U_ABBA_IntNotes\], T0.\[DocTotal\]
FROM ORDR T0 WHERE T0.\[DocStatus\] = 'O' AND T0.\[U_ABBA_SBProdStat\] = '4' AND AND T0.\[CardCode\] = $\[$-5.CardCode\]
Regards,
Adrian

Similar Messages

  • MRP Forecast - Formatted search

    Hi all experts.
    I have created a UDF on the forecast report in SAP. Here I would like to list Alternative Items connected to the item number on each row. I have the following formatted search query:
    SELECT T1.[AltItem] FROM OITM T0  INNER JOIN OALI T1 ON T0.ItemCode = T1.OrigItem
    where t0.itemcode = $[ORCM.itemcode]
    This works fine when I trigger it with SHIFT+F2. But I would very much like this field to get data when I execute the report. I don't want it to be a manual task to trigger the query. I have tried setting this up by using standard settings of automatic update in the formatted search - but it will not fire the query.
    Any suggestions?
    Best regards, Runar Wigestrand.

    Dear Runar,
    The Formatted Seach (FMS) works when there is an 'Event' performed by the user on that particular B1 Window. This input can be in the form of 'Shift+F2 or also if there is a change which the user initiated in the values on that Window. So depending on this the values int he specific field will change.
    In essence, what I mean is that there has to be a User Initiated actions which has to occur on that particular B1 Window and only then the FMS would work.
    For more information on FMS, please have a look at the following link :
    [Formatted Search Documentation|https://websmp203.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_HIER_KEY=701100035871000437965&_OBJECT=011000358700003625432006E&_SCENARIO=01100035870000000183&]
    If you still have any doubts, please let us know..
    Regards
    Arshdeep

  • UDF link type and formatted search

    Dear experts,
    Im trying to use a formatted search to fill a UDF of the link type.
    The plan is to generate a weburl voor googlemaps like the link with business partner addresses. I do this with the following query:
         DECLARE @URLp1 AS VARCHAR(254)
         DECLARE @Adres AS VARCHAR(254)
         DECLARE @Plaats AS VARCHAR(254)
         DECLARE @Postcode AS VARCHAR(254)
         DECLARE @URL AS VARCHAR(254)
         SET @URLp1=('http://maps.google.com/?q=')
         SELECT @Adres=($[$U_Adres.1.0])
         SELECT @Plaats=($[$U_Plaats.1.0])
         IF LEN($[$U_Postcode.1.0])=0
              BEGIN
                   SELECT @URL=(@URLp1+@Adres+'+'+@Plaats)
                   SELECT @URL
              END
         SELECT @Postcode=($[$U_Postcode.1.0])
         SELECT @URL=(@URLp1+@Adres+'+'+@Postcode+'+'+@Plaats)
         SELECT @URL=(SELECT REPLACE (@URL,' ','%20'))
         SELECT @URL
    The select replace doesn't work yet but that's not the real problem.
    I used the following formatted search settings:
    Search in Existing User-Defined Values according to Saved Query
    Auto Refresh When Field Changes -> set to Adres
    Refresh Regularly
    When I try these settings on my UDF link style the field just stays empty.
    When I use this formatted search on a Alphanumeric(100) field it more or less works. I need to manualy refresh the field to execute the query.
    If I simplify the query to insert just one value like 'Opportunity No.' ($[$74.1.0]) it does auto update in both fields.
    Could someone point me in the right direction what I'm missing/forgetting or give me a sollution that might even be better?
    Kind regards
    Edit:
    PS. We are using SAP BO 8.8 PL15

    I've found a topic with a similar problem but there's no solution there either...
    Formatted search with Query auto update

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

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

  • 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 as such G/L Account name to be shown

    Dear All,
    I have added in Udf in the row level of marketing document like U_Sales A/C Name, U_Cogs A/C Name, U_Inventory Account Name.
    Stock is maintained Warehouse Wise. Now I want that in the row level for any item e.g warehouse 001 I want a formatted search which should refresh automatically and show the G/L account name of Sales A/c, Cogs A/c and Inventory A/C respectively in the individual udfs.
    I think it could be possible through formatted search but am not able to create the query for it.. Please help.
    regards,
    kamlesh

    Hi Kamlesh,
    Check the link
    How to insert G/L account name in query
    *Close the thread if issue solved.
    Regards
    Jambulingam.P

  • Golden arrows in a formatted search

    Hi
    I have a simple query that works fine and returns the golden arrows so I can drill into the documents.
    I then created a header UDF on the sales order and put a formatted search on that field.  The formatted search is set to use that query with no auto refresh. So the user will come to that field and hit Shift F2.   That also works fine the problem is when the results pull up there the golden arrows are no longer there.  Is it possible to retain the arrows in this situation?
    Thanks.

    Jared,
    This is a shortcoming with Formatted Searches where the link arrow will be lost. 
    I am not aware if there is a way to retain the link arrow.
    Suda

  • Formatted Search in Incoming Payments

    Hi All, I require some assistance with a formatted search and query please.
    I have create a UDF at a header level in an invoice - the value will be either D or blank.
    I have then created a UDF at a line item level in the incoming payment window.
    I would like to create a formatted search that looks at the invoices at the line item level in the payment window, and returns the value from the invoice (D or blank).   Any assistance on what the query should be would be greatly appreciated.
    Also, as the invoice numbers are variable fields, what field should be used for the 'auto refresh' option?

    Hi Lisa,
    It is very difficult to have create FMS that can be linked to header from row since it has different table. Row table and Header table are different. Why could you try to use the info from invoice table directly that can return value from it (D or blank) as you want ? what is the point in the invoice that can return the value ? is it invoice number ?
    Rgds,

  • Formatted Search - Search in existing values

    Hi,
      In formatted search we have an option "Search in Existing values"
      i need to know in which table the values we enter in this screen gets stored?
    Manoj

    Hi Manojkumar,
    You need to turn on the "System Information" from within the "View" menu on the main toolbar (or as Juha said, use CtrlShiftD), but then go into the "Define New" option on the table.
    This will open the linked form and when you hover over the data you are interested in the lower left hand side the screen will give you details of the table and field ID  that you need for your query.
    Hope this helps,
    Julian

  • To create a formatted search with customer ref no.

    Hi there, I am new to formatted searches and I am trying to do the following:
    on the delivery docket when the customer ref no is filled in I want this to populate a UDF called ordr_U_CAllREF
    I have the udf created and it is called Cust Ref.
    can someone please give me some tips on how to create this please?
    thank you.
    E

    Hi Edel,
    Try this.
    Select $[ORDR.NumAtCard.0]
    Save above query in query manager and go to Sales Order Form and put cursor on U_CAllREF UDF and press Alt+Shift+F2 and it will ask you to link the query by using 3rd option and simply link this FMS to U_CAllREF.
    Hope this will help you.
    Regards,
    Rahul

  • Formatted Search (FMS) Hotkey

    I have a formatted search that I am forever using. Is there a way to link it to a key to execute when pressed?
    I've played around in the user menu and can have the query manager open on a hotkey, but not a specific Query.
    Any thoughts are appreciated!!
    -Scott
    Edited by: Paul Finneran on Sep 18, 2008 12:44 PM

    Hi Scott,
    I don't think it's possible to assign a hotkey to trigger any specific formatted search, the only other way to trigger a formatted search is to press shift+F2 whilst in the field, this has the same function as executing the formatted search.
    Kind Regards,
    Matt

  • Automatic Delivery Date Calc with Formatted Search

    Hi,
    I'm trying to have the delivery date on purchase orders automatically calculated by using document date plus a value from the business partner master data (avragelate) which we are using as shipping time.
    What I have as my query is the following:
    Select $[$46.0.1]+t0.[avragelate] from ocrd t0 where $[$4.0.1]=t0.[cardcode]
    This is however returning an internal error when it runs.
    I have the formatted search set to run this query when the document date changes.
    Any ideas?
    Thanks,
    Michael

    Where are you linking this Formatted Search and how did you try to execute this?
    I don't generally post code before testing as I value the solution I provide and its importance to you...
    I had tested this and it worked just fine. 
    You should save this query and link this to the Delivery Date on the PO screen.
    I see you are a new member to the SDK forums.  If time permits please read through this link to know about the recognition program.. https://www.sdn.sap.com/irj/sdn/crphelp#section19
    Please let me know
    Suda

  • 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

  • Formatted search - Service call

    Dear All,
    Im trying to write a formatted search on the Service call screen to retrieve the email address of a queue. The queue is in the general tab of the Service call. You can add user defined fields for the service call-title, service call -solutions, service call- activities etc.
    I have added the userdefined field on the service call-title.
    My formatted searches can access all the other header details on the service call but I cannot get the queue data in the general tab.
    Kindly assist,
    Thanks,
    Indraj.

    Hi Indraj
    If I understand correctly you cannot add a formatted search on the queue field? If this is not so, let me know. If it is the Queue field, you must select the radial button to the left for the queue field to be active. I tested by doing the following:
    1. Added a UDF on Title level called email (U_email).
    2. Added a query - SELECT T0.[email] FROM [dbo].[OQUE]  T0 WHERE T0.[queueID] = $[OSCL.Queue]
    3. Added a formatted search to the email UDF and linked it to the query. Set auto refresh on field "queue"
    This works 100% whenever I select a queue number.
    Kind regards
    Peter Juby

Maybe you are looking for

  • Replaced Hard Drive Not Recognized/Boot--Bizarre!

    Help. I swapped a failing 30gb drive out of my 12" G4 1.33GHz Powerbook and replaced it with an 80gb WesternDigital. The Powerbook refuses to recognize it. I've been around and around the boards looking for answers: * Everytime I start I get a blinki

  • Problems after recording in AU CS 5.5

    Hi I'm new to audition and havwe a problem - probably something I'm doing wrong. I am in multi track mode and want to record from my Røde Podcatser. I arm the track I want to record to and place the playhead I press record and do the speak. The probl

  • Bad Update 10.4.6 - please help!

    I see that I am not alone with 10.4.6 update causing major problems. This sounds like an Apple problem, not an individual one... Anyway, after trying to update, got a message that said it wouldn't install. Tried rebooting - bad mistake. Just got the

  • QuickTime 7 works properly with Windows 8?

    In the product documentation does not say anything about it

  • Which application should I use?? Any help would be great!!

    I'm rather new to web-design, and I need some general guidance.  I am looking at taking on a rather ambitious project for my company.  I need to create a website that can do all of the following: Host online classes.  These would be some sort of flas