Formatted  Search to Salesman in Order Row

Hi, everybody!
I create the FMS bellow to find the salesman in BP based in trademark of this BP buy. But now I need a message error when the salesman code is '-1'  or when the BP dont have a salesman associated in the trademark. Is it possible with a FMS?
declare @marca int
set @marca=(SELECT T0.[U_CD_MARCA] FROM OITM T0 WHERE T0.ITEMCODE = $[$38.1.STRING])
SELECT CASE
WHEN T0.U_SMT_MARCA1 = @marca THEN T0.U_SMT_VEND1
WHEN T0.U_SMT_MARCA2 = @marca THEN T0.U_SMT_VEND2
WHEN T0.U_SMT_MARCA3 = @marca THEN T0.U_SMT_VEND3
WHEN T0.U_SMT_MARCA4 = @marca THEN T0.U_SMT_VEND4
WHEN T0.U_SMT_MARCA8 = @marca THEN T0.U_SMT_VEND8
ELSE $[$38.11.STRING] END
FROM OCRD T0 Where T0.CardCode=$[ORDR.CardCode]
Thanks

Carlos,
FMS cannot generate an error message.  They can only be used to fill a field with some value like "INVALID", etc.....
If you want to display an error message or warning on the task bar then you need to use the SBO_SP_TransactionNotification stored procedure and write SQL code within that.
This Stored Procedure can be accessed from SQL Server Management Studio.
Suda

Similar Messages

  • Formatted Search to pull Sales Order Remarks field onto Purchase Order

    Hi Guys,
    I need a formatted search for a Purchase Order remarks field, which will pull the remarks field from the linked Sales Order
    (When a PO is done through the logistics tab of the Sales Order)
    I have made this query but it is not working:
    SELECT distinct T0.[Comments] FROM ORDR T0 , POR1 T1 WHERE T0.[DocNum] = T1.[BaseRef]
    It is just pulling the remarks for the first sales order - purchase order link.
    Any help will be appreciated.
    Thanks
    Best Regards
    Dario Moutinho

    Hi Dario Moutinho,
    Try:
    SELECT distinct T0.Comments FROM ORDR T0
    WHERE T0.DocEnthy = $[POR1.BaseEntry\]
    Thanks,
    Gordon

  • 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

  • Formatted Search on A/R Invoice Row level

    Hi All,
    I need your help to do some arithmetical functions on UDFs.
    I have three UDFs at row level of A/R Invoices.
    U_MRP, U_AssValue (Unit & Totals -> Amount)
    U_abtment (Unit & Totals -> Rate)
    I want to do below process, but it gives me error.
    Select ($($38.U_MRP) - ($($38.U_MRP)* $($38.u_abtment))/100) * $($38.11.0)
    but it gives me error. Can any body help me to correct this query to set on U_AssValue as formatted search.
    Its very urgent & Important for me.
    Best Regards,
    Chintesh Soni

    Hi,
    I tried by creating UDF as u mentioned. For me its working perfectly.
    i will tell u how i created UDF created.
    MRP --> Units & Total --> Amounts
    AssValue --> Units & Total --> Amounts
    abtment --> Units & Total --> Rate.
    Save the query as A/r in query generated.
    Select ($[$38.U_MRP.number] - ($[$38.U_MRP.number] * $[$38.U_abtment.number]) / 100) * $[$38.11.number]
    Called this query in the AssValue, Qty --> 2, MRP --> 123, abtment --> 123 final output --> -58.
    Please remove http:// and add set bracket over there.
    Above query is working fine.
    Sagar

  • Issue with Formatted Search and Sales BOM

    Good afternoon,
    One of our customers uses a Formatted Search on the Sales Order row to lookup the Project Code stored against the Item.
    This works very well, except for when a Sales BOM is selected.  I assume the FS lookup is working correctly, but the screen is quickly refreshed to list all the component items related to the BOM.  This process appears to overwrite the contents of the Project field.
    We wish to keep this functionality, but retain the FS lookup results in the Project column.  Could the order of the process be changed so that the BOM refresh occurs prior to the FS lookup.
    Thanks
    Greig
    Edited by: Greig Burrows on Jul 21, 2010 5:57 PM

    Hi,
    For metadata, which metadata are you not seeing? Are they custom properties within the PDF, and have you checked if you have crawled properties matching these?
    I know there's issue with last modified on PDF's (http://sharepointfieldnotes.blogspot.no/2013/05/understanding-and-getting-sharepoint.html) 
    Thanks,
    Mikael Svenson
    Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • Get matrix row data and put it into header field with formatted search ???

    Hi All,
    I ask your help concerning the following:
    On an invoice matrix I want to check all Itemgroup Codes of all items in the rows, if there are some rows' items with ItemGroupcode 101 and some others with anything else, then header field should be Y, otherwise N.
    My main problem is: how do I put a matrix row data to a header data with checking all rows in the matrix?
    A minor problem is that I can't get the formatted search to work on all rows when the formatted search is assigned to the user field in header.
    If I put the formatted search to a row field then the row field is filled with the proper value, but the same query assigned to the user field in header works only on the first row.
    What am I doing wrong?
    SELECT USEDPROD= CASE T0.ItmsGrpCod  WHEN 101 THEN Y ELSE N END FROM .[OITM] T0 WHERE T0.ItemCode = $[$38.1.0]
    (SBO 7.6)
    Any suggestions are welcome.
    Thanks.
    Bálint

    Dear Adele,
    Thanks for the answer. The major one cannot be solved. OK, I'll try to get a workaround.
    However I still do not understand why my query does not work in all selected rows, just in the first row, i.e. if I assign the query to a header field and I'm positioned in the first row it's OK, but when I add a new item to the second row or any of the next rows, the header field is not updated at all.
    Why is that so? Do you have any idea?
    Bálint

  • 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

  • Formatted search in the User defined table

    Hi All..
    I created two user defined table one is for document row and other is for document master.So in the master table created one column named as Sales order no and through formatted search call the sales order no in that column.Now i want that in my child table i want to show the those items which belongs to the selected sales order no in the master table.So how can i do that through Formatted search.Is there any query of it then please forward it..
    Thanks

    Ya Sure..
    I need some quality check on the items after delivery so i am trying to manage it through the user defined tables.I created two tables first is document type ,Second is Document type rows.Now i created 5 user defined field in both the table.Now i want to call my sales order and its items in the UDT.so i created one fms and call the sales order in the Document table now when i double click on the first row after that i am able to see the new table which is the document row table .Now i need the item code and description of the selected sales order in the document rows table.So how the items and description can come in the row type table through FMS..
    I hope now u r able to get my scenario..

  • Formatted search values

    Hello experts
    How can I get access to formated search form?
    How to return its marix values (it returns 3 values)? I can choose forms uniqal ID, but how can I get a specific row from it?
    Or how can I display the list of indexes after puttin "*" in the column? what conditions must column have?

    Thanks for your reply.
    1. Well I think I could just make an Matrix object (its an item of formatted search form) and return its rows, am I right?
    2. Could you explain me how to display list of indexes after putting * and tab in a matrix cell (I have no CFL)?  I know it is possible but how should I bind column or maybe do sth else to gain this functionality?

  • Special Price + Formatted Search for Special Price.

    Hi all,
    Appreciate some help here.  Our client is using SAP B1 2007 Patch 38.  AU/NZ localization, Local Currency = AUD.
    Scenario:
    Item A, Price List 1 = $2795, Price List display = 4 decimals, Price List Currency = USD
    Special price for Item A has been set up as follows:
    Step 1 - Go to Item> Price List> Price and Volumne Discount
    Step 2 - The price and volumn discount screen opened. From the drop down, select price list and then select Item A by double clicking the line.
    Step 3 - Period Discount screen opened.  Valid from = 9th July 2008. Price = $2795.
    Step 4 - Double click the line, Volume Discount Price List open, with the following details maintained.
    Quantity=1, Discount=0, Special Price = $2795.
    Quantity = 10, Discount=7.1556, Special Price = $ 2595.0010
    Quantity = 100, Discount=10.0179, Special Price=$ 2514.9997
    Question:  we intend to put in Special price = $2595 and $2515, but SAP just does its own round up.  Is there a way to work around?
    Scenario 2:
    To deal with the problem from Question 1, we have created a formatted search in the sales order and formatted search to round up the value in Line Total.
    Column = Line Total
    Trigger by = Quantity
    Query = SELECT (case when $[$63.0.0]='USD' then Round($[$38.23.number],0) else $[$38.23.number] end)
    Column = Quantity
    Trigger by = Discount%
    Query = SELECT $[$38.11.1]
    The above set up works fine, if the user enter the quantity correctly the first time. 
    Eg:
    User enter Qty = 10, SAP will display Discount = 7.1556 % and Line Total = $25,950.00 (Round up from $25950.01).
    If user notice the quantity is wrong and then enter new quantity = 100, the discount remains at 7.1556%, it should be 10.0179%.
    Question: Is there a way to work around this?

    Hi Shawn ,
    1.First check the decimal setting
    a.Administration --> system intilisation --Document setting -- currency or by document --
    b.System initiliaisation ---> general settng --->Display
    c.Administration set up->Financial currency ---rounding --???
    Currency setting overides the rounding method of procedure B
    Scenario2
    Since your trigger is dicount percentage , You will not get the desired output from the formatted search . Try to get the trigger at quantity .
    Hope that helps
    Bishal

  • Formatted search based on screen entry

    Hi,
    I need help to create a formatted search based on a field that the user entered on the screen. For example, I want a formatted search on the Purchase Order screen where the item search will only show the items where the vendor entered in the Default Vendor field of the master record is the same as the vendor specified in the Vendor field of the purchase order.  Please advise on the correct sql statement.
    Thanks,
    Jane

    Thanks Sudah! That worked!
    However, I do not understand the syntax.  What does [dbo] mean?
    I am trying to duplicate the query for the following scenario.
    I have a user defined field U_Freight in the Business Partner Master Data (OCRD) and also in the sales order screen. I want to create a formatted search for the freight field in the sales order to automatically find the freight from the business partner master data screen based on the customer entered in the sales order.
    I have tried the following as a formatted search on the sales order screen, but it does NOT work.
    SELECT T0.U_FREIGHT FROM [dbo].[OCRD] T0
    WHERE T0.CardCode = $[$4.0.0]
    Please advise.
    Thanks!

  • Formatted Search on Serial Number (goods receipt PO)

    Dear Expert,
    I have the problem on generate Serial Number. I want to used formatted search to created serial number,
    the structure of serial number is :  x-99-9999-9999-99999
    1st   x = type of product (Regular, Consignment, Tenant)
    2nd  999 = Brand type
    3rd   9999 = Category
    4th   9999 = Year received
    5th   99999 = counter number
    for example : Item A with quantity 100 units,
    so.. what the formatted search that I want 
    On window serial number (detail level), I pressed Shift F2, so.. "the formatted search " will fill in each row on detail level until quantity (header level) --> will fill in until row 100
    I do not want used Generate Serial number which SBO facility, because it is many step to used it so that our user (warehouse staff) will confuse to used it.
    Does anyone have solution to solve my problem?
    Thanks before.
    regards,
    Hendra

    Dear Hendra Sulivan 
    Formatted search is basically used for getting data from your data base. It will not allow you to enter any data in your data  base.
    So your query can be solved only by using SDK.
    I can suggest you that through SDK you can provide standard Serial no entering screen where he will just enter the kind of serial no.
    This facility can be provided by using tab on Serial no screen.
    thanks,
    yatindra gokhale

  • How to Fetch the Row value in SBO Formatted search

    Hi Experts,
    I have created a Sales order, in which i  have 4 UDF Fields(A,B,C,D) in the following:
    Example values:
    A  B  C  D 
    2   2   4  4
    3   2   6  10
    C=A*B
    D=1st value of D + 2nd col value of C
    i have written query for C, but how to write the Formatted search Query for generation of D values. plz reply as soon as possible.

    Magesh,
    I quite understand what you are trying to do.   If you look at the example below I added a third row to show how you want the D to be a running total of column C. RIGHT !!
    A B C D
    2 2 4 4
    3 2 6 10
    <b>4 2 8 18</b>
    Honestly, it is not going to be simple as you do not have a way in SBO to access a particular column from a row.  When you say $[$38.U_C] it refers to the context row OR the row which has the highlight OR the row which has the curson on it.
    It is not possible to say $[$38.U_C from row 2]  JUST  NOT POSSIBLE ...
    You have to write a tricky code by using a temp table referencing the value of column C.  Also you have to keep track if Rows gets deleted and a new row added. 
    I will test a sample code and will come back.
    Suda

  • Read item code from Sales Order with formatted search

    hi,
    i'm tring to read tha values of the item or items of a sales order (before save it) with a formatted search.
    i have no problem to read the value of card code or cardname but i can't read the item's value.
    i tried with this [code]Select $[RDR1.ItemCode][/code]  (i found it on the forum) but it doesn't work.
    somebody can help me ?
    thank you

    Hi, Alessandro!
    I think the trouble is that you are trying to assign a FS to the header of the document. You are getting the information of the current row, so you have to bind a formatted search to some column of the "table - part" of the document.
    And also you can try:
    SELECT $[$38.1]
    38 - the value of "Item" (when you point a mouse to the cell, information you want from)
    1 - the value of "Column" (the same...)
    It will get an info of this cell in a current row.
    HTH!

  • Formatted Search - Sales Order - UDF

    Hi, I need to now if is possible, when I create a new Sales Order and I chage the Sales Employee on the drop down list I can catch the new sales employee selected and use it in a formatted search that is attached to a UDF, all this without saving the new created sales order...
    Is any way to catch a value in an active window and attach it to a UDF? for example the current selected sales employee?
    Thank you!

    Hi Gordon, its work's! many Thanks!
    Another question... you now if it is possible to update a field that have a FMS attached wen 2 event's happens?
    For example, I want to change the value of the commission % column when the user change the sales employee drop down list and when the user add a new line to the sales order... in this moment only works when I change the Sales employee, wen I try to add a new row it dont fill in the right commission %.       
    SELECT DISTINCT
    CASE
         WHEN $[ORDR.SlpCode]=6 THEN 6
         WHEN $[ORDR.SlpCode]=7 THEN 7
         WHEN $[ORDR.SlpCode]=8 THEN 8
         WHEN $[ORDR.SlpCode]=9 THEN 9
         WHEN $[ORDR.SlpCode]=-1 THEN -1
    ELSE 0     
    END
    FROM RDR1
    WHERE RDR1.ItemCode = $[RDR1.ItemCode]
    Thank you!

Maybe you are looking for