Formatted Search on TaxCode Ship To addess

Hi Experts,
I have a Customer who wants a Formatted Search Linked to the Ship To address. This Formatted Search must populate TaxCode 'TST' when the State in the 'Ship To' address are Texas. When it is anything other than Texas, it must populate 'EX'.
The following is what I started, but it does not just populate the 'EX' or 'TST'. (It brings up a table....)
SELECT CASE WHEN $[CRD1.State] <> 'TX' THEN 'EX' ELSE 'TST' END
FROM CRD1
Any help would be greatly appreciated.
Thanks,
Marli

Hi Sridharan & Gordon,
Thanks for the quick reply! I did try both of the queries, but I must be doing something wrong... It populates 'EX' for state Texas and the other states...
Here is what I'm doing...
I link the Formatted Search to the TaxCode field in the Ship To Address. I tried this without 'Auto Refresh' and with 'Auto Refresh' 'when Exiting Column State'. And I selected 'Display saved Userdefined values'...
When I change the State to Texas, and click on the Magnifying glass, it populates 'EX'. It does the same for the other states.
Thanks for your help!
Marli

Similar Messages

  • Trigger Formatted Search on Freight Form

    Has anyone gotten a formatted serch to fire on the Sales Order - Freight form based on the document total changing in the main Sales Order form?
    Scenario - we set the Freight to a fixed amount $50.00.  If the document total goes over $500 then we want to set Freight=$0.00 using a formatted search (i.e. shipping is free when the order is above a certain amount).
    In troubleshooting I tried to use SELECT $[$29.0.0] and also tried SELECT $[$-29.0.0] to see if the FMS could even return the Document Total on the freight form but it doesn't seem to be linked. 
    Anyone gotten this to work?
    -Frank

    I already tried using
    SELECT $[$29.0.Number]
    Results in Internal error 3006.
    I also tried setting the FMS to SELECT '0.00' with Auto Refresh enabled on When Field Changes = Document Total just to see if the FMS would fire when the main Sales Order total changed.  FMS would not fire.
    Appears to me that the freight form is in some way disconnected from the main Sales Order form as it relates to FMS.
    Anyone gotten this to work outside of going to SDK?

  • 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

  • Formatted search - Copy Business Partner address of active screen

    Hello,
    I am using a credit card addon that creates a tab in Business Partner Master Data labeled "Credit Card". On this tab, credit card information is stored for the business partner. This includes CC Name, CC Type, CC Cardholders Name, CC Number etc.
    Credit cards are added on this tab, similar to an address being entered on the address tab. You have to click "Add New"
    The business process is the following:
    - CSR receives call from random customer (no BP data exists)
    - CSR creates new BP
       - Enters address for Bill to and Ship to.
       - We are required by this addon to enter address on credit card for a third time. This is where we would like to streamline the process by creating a formatted search to copy the Bill to information from the Address tab, to the address information on the credit card tab.
    This is where my dilema is. I am not sure how to capture the active record's information and bring it over to the credit card tab.
    Does anyone have an recomendations?
    John Sefton

    From what I have noticed.  You can create individual FMS and place them in the respective fields in the CC Tab.  I could only test this on the BP Remarks and they seem to work.
    For Address Name
    SELECT $[$178.1.0]
    For Street
    SELECT $[$178.2.0]
    For Block
    SELECT $[$178.3.0]
    Please enable system information from the VIEW menu for the other field co-ordinates

  • Conditional Formatted Search

    We have a formatted search in Sales Order to pull the Ship To Code from Sales Quotation based on the line #. But we want the formatted search NOT to happen for certain customers.
    How can we write a conditional formatted search so that when this condition is met, this formatted search does NOT carry out?
    thanks!

    Hi Yi Liao,
    try to use IF ELSE condition in the query.
    cheers,
    erwine

  • Formatted Search and UDF

    Hi all,
    I have an issue with a formatted search.
    My intention is to update the field RDR1.vatgroup with a value set in a UDF on the sales order.
    I have not been able to make it work, and If someone have a quick help idea it would be nice.
    I have defined a userdefined field called u_avgcode. This is linked to some valied values for field like U1,U2,U3. The structure is 1=U1 and 2=U2 and so on.
    <u>When I change a value here I would like to update the whole salesorder (all lines) with this value replacing the Tax code (RDR1.Vatgroup).</u>
    The formatted search is like this on the RDR1.vatgroup:
    if (Select $[$ORDR.U_avgcode]) = 'U1'
    begin
    declare @newcode as nvarchar(25)
    set @newcode = U1
    select @newcode
    end
    I have set 'Auto refresh' when the UDF field changes.
    I can't make this work properly, any ideas..
    I have also tried if (Select $[ORDR.U_avgcode]) = 'U1' with no luck.
    regards
    me

    Thanx for input Juha.
    I have made a solve to the problem, and it works fine now.
    My FS is like:
    declare @newtaxcode as nvarchar(2)
    if (Select $[ORDR.U_avgkode]) = 'U0'
    begin
    set @newtaxcode = 'U0'
    select @newtaxcode
    end
    I set this FS on my taxcode, and refered to my UDF when it changed. Works fine, but the screen is a bit flashy and "slow" when updating 50 order lines in a sales order.
    I am now able to update many lines in a matrix with a single select from a UDF.
    <u>Thanx to Ibai too, for helping me on track.</u>
    One issue that also was a key element is to refer to the defined values for the UDF.
    I had set like this:
    code description
    1    U0
    2    U1
    3    U2
    I changed this too
    code description
    U0   U0
    U1   U1
    U2   U2
    regards
    me

  • Formatted Search Matrix

    Good Day
    Experts:
    I am trying to buid a Formatted Search for a UserDefined field on the SalesOrder Content tab Matrix.  I need to reference the ItemCode and Whse columns in the Matrix.  I currently have the following Formatted Search that returns an internal error. 
    <b>Select U_ItemCode AS 'Item Code', U_WhseCode AS 'Warehouse', U_BinLoc AS 'Bin Location', U_Quantity AS 'Qty in Bin', U_QCHold as 'QCHold', U_Rcv as 'Rcv', U_Ship as 'Ship' FROM [@TEMBIN] where U_ItemCode = $[$38.1.0] and U_WhseCode = $[38.24.0]</b>
    If I replace the attempted column reference with the actual values in the row and run the query, the correct results are shown in the Formatted Search window.
    I have searched the forum and did not find a solution.  Does anyone have information on what I may be doing wrong?
    Thanks,
    Ed

    Hi Ed,
    There's a typo in the syntax on your second field reference. It should read $[$38.24.0]. You're missing the $ inside the bracket. Hope that helps.
    Regards,
    Andrew.

  • Formatted Search for Sales Order

    Hi,
    I setup a formatted search in Sales Order unit price field.
    Condition required:
    If Sales Order is copied from Sales Quotation, unit price remains as per Sales Quotation unit price, else formula to calculate mininum selling price appllies.
    Here's the query:
    DECLARE @BASE_ENTRY INT
    DECLARE @PRICE NUMERIC(19,6)
    SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
    SET @PRICE = $[$38.14.0]
    IF @BASE_ENTRY = 0
    BEGIN 
    SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
    FROM OITM T0
    WHERE T0.[ItemCode]=$[$38.1.0]
    END 
    ELSE 
    BEGIN
    SELECT @PRICE
    END
    l have no issue if the Sales Order copied from Sales Quotation, however when enter the Sales Order manually the formatted search having error message:
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Error converting data type nvarchar to numeric.
    FMS execution failed on field '' with query name 'Get Minimum Selling Price (SO)'
    Looks like my query has error...

    Hi ,
    Try this below query and let me know your feedback,
    DECLARE @BASE_ENTRY INT
    DECLARE @PRICE NUMERIC(19,6)
    SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
    SET @PRICE = $[$38.14.Number]
    IF @BASE_ENTRY = 0
    BEGIN
    SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
    FROM OITM T0
    WHERE T0.[ItemCode]=$[$38.1.0]
    END
    ELSE
    BEGIN
    SELECT @PRICE
    END

  • 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

  • Formatted Search - Restrict to Only One Customer on Activity Window

    Hello Experts:
    Am trying to create a formatted search to provide a suggested RMA Number on the Business Partners > Activity window in a UDF.
    While in Activity, the user should get a list of ONLY the one customer they are currently working with.  So if C0001 is being used in the Activity window, the list should show all suggested RMA numbers just for that customer of C0001, not any other customer. 
    When I use the following it shows all customers.
    --FMS 6BP Automated RMA Number
    SELECT
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode]))
    FROM OCLG T0
    INNER JOIN OCRD T1
    ON T0.CardCode = T1.CardCode
    ORDER BY
    T1.CardCode Desc,
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode])) Desc
    When I put in WHERE T1.CardCode = $[$ 9.0.0 ] in the right place it shows nothing...
    Any ideas on how to make only the one current customer in Activity window appear in the list???
    Thanks in Advance - Zal

    Thanks Istvan and Gordon...
    Istvan - that is the same as my SQL - just do not know how to show the $[$... correctly in this forum - it always goes to that http thing.
    Gordon - tried to use your SQL but it gave me an error of "Internal Error (-1003) Occured [Message 131-183] every time I tried to click on the magnifying glass.  However, due to your last line in the SQL it gave me an idea that eventually they were OK with - namely, the highest number to the top of T0.ClgCode...
    Thanks again guys - Zal

  • Formatted Search for Delivery Date field in SO not working

    Hi All
    Can anyone help me as to why my formatted search is not working?
    I am currently using SAP B1A SP01 Patch 19.
    I have created a user query as follows:
    SELECT $ [$10.0.DATE] + 5
    When I add this to the delivery field within the Sales Order and bring through the saved query which I set to auto refresh when the Posting Date field changes and to Display Saved Values it doesn't work.
    Any ideas?
    Thanks and best wishes
    Gail

    HI Gail,
    If I am not mistaken you want to add days to the posting date...if that is so then try this out:
    SELECT $[ORDR.DocDate.DATE]+5 From ORDR T0 For Browse
    Set The indicator to Auto Refresh when the fields change
    Nagesh

  • Formated search

    Hi all,
    In Dunning Wizard, step 5, I want to make a formated search to select only some documents. The Query I need is complicated so I tried to do Select ' '  or Select 'N' or Select 'Y' in all this examples when I do "Shift F2" nothing happens. Even with auto Refresh nothing happens. Perhaps Formated Searchs dont work on CheckBox Fields.
    How can I solve this?
    Any help will be apreciated.
    Best regards,
    José Silva
    Edited by: José Silva on Jul 16, 2010 12:45 PM

    HI SILVA,
    plz paste ur query ...
    then we update in query.
    Thanks,
    JRAJPUT

  • 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

  • Is there a way to NOT have the data from a formatted search highlighted

    Hi all,
    I have a formatted search that returns a big chunk of data, some comments that are then added to. When the fs is fired, it returns the data, but all of the data is highlighted so when the user starts typing they overwrite the data that was just returned. I know they could just hit the right arrow key or click their mouse at the end, but they don't do that half of the time. I also know they could use ctrl-z or undo when they do this, but they don't do that either. It would just be nice if they could fire the fs and when the data is returned, the cursor would be at the end of the data.
    Any thoughts?

    I don't think there are any options for you to change default system behavior like this.  What you may do is to change your FMS logic to get only one record if possible. Post your query here if you can.
    Thanks,
    Gordon

  • Formatted Search with multiple conditions

    Hi experts,
    I am using a formatted search to update the Unit price in Sales Order. Query mentioned below.
    Select      T0.ItemCode,
                   T0.ItemPrice,
    From        ITM1 T0 inner join OPLN T1 on T0.PriceList = T1.ListNum
    Where      T0.ItemCode = '[$38.1.0]'
         and     T1.u_location = '$[$38.2000002049.0]'
    But while adding Item on Sales Order, it is showing error, Incorrect Syntax near  '$[$38.2000002049.0]'.
    Note: I have added an UDF named U_LOCATION( Alphanumeric, 10) in OPLN and selecting location in Price List through another FMS which is working perfectly.
    Please help in this regards.
    Thanks in Advance.
    Nabyendu

    Hi Nabyendu Saha..
    You said the u_location as alphanumeric the why you have given 0 for the field type in the FMS...
    Select      T0.ItemCode,
                   T0.ItemPrice,
    From        ITM1 T0 inner join OPLN T1 on T0.PriceList = T1.ListNum
    Where      T0.ItemCode = '[$38.1.0]'
         and     T1.u_location = '$[$38.2000002049]'
    or
    Select      T0.ItemCode,
                   T0.ItemPrice,
    From        ITM1 T0 inner join OPLN T1 on T0.PriceList = T1.ListNum
    Where      T0.ItemCode = [$38.1.0]
         and     T1.u_location = $[ordr.u_location]
    Try the above , hope helpful
    Regards,
    Kennedy

Maybe you are looking for