Date Formatted Search

I use the following Query to Transfer The Document Date in a Purchase order to Document Date in Purchase Invoice:
SELECT T0.[TaxDate] FROM OPOR T0 WHERE T0.[CardCode]=$[OPCH.CardCode]
Can anyone tell me please:
1. Do I need to change the syntax of the query to make it work?
2. I use the query to change the Document Date in the AR Invoice when I COPY (convert) the order to an Invoive. What would be the Refresh condition since no Fileds will be changing in the COPY process.
Thanks for your help
Robert
PS Without this Forum I would have given up on SAP but I am grateful for your contributions but I am getting there..

If you derive the invoice from only one purchase order, you can solve the problem
1.     First of all you can select the base order, from which the invoice was derived. You can use the Remarks field, that contains the order number (if you checked Base document number in the General documents setting)
2.     you can set autorefresh when the Remarks changes.
3.     in the query you should refer to the current remarks field by $\[OPCH.Comments]
4.     you should use the charindex, substring and cast or convert functions to get the numeric order number
5.     then you can get the document date from the order with this order number.

Similar Messages

  • 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

  • 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

  • How do i deduct dates using formatted search with a query

    Hi Experts,
    I would like to know how to get the date difference using query and formatted search. Below are the details:
    1. I have created 3 Header UDF's composed of 2  Date type fields and 1 Quantity field.
    2. The first one is for the Original Date, the next one is for the Payment Date and the Last one is for the No. of Days Lapsed.
    What I would like to do is automatically compute for the number of days from the original date to the payment date. What query syntax should i use to achieve this?
    Thanks,
    Yvette

    Hi Yvette,
    It should be something like;
    DATEDIFF (day, T0.[createDate], T0.[closeDate] ) as 'Aging'  This is just an example. You may add your udf's instead of dates.
    Thanks,
    Joseph
    Edited by: Joseph Antony on Jul 2, 2010 1:53 PM

  • Forms6i - Search by hours, or minutes in Date Format.

    Hi All:
    Is it possible to search by hours,minutes, or seconds in the date format? I've tried the below SQL but it doesn't work.
    SELECT to_char(start_date, 'MM/DD/YY HH24:MI:SS') start_date
    FROM table_name
    WHERE start_date like '%05%';
    It returns no rows selected instead of the following rows.
    09/11/02 05:27:33
    09/11/02 05:27:35
    Please help.
    Thanks in advance,
    Regards,
    TD

    Hi,
    Change the WHERE clause,
    Where To_Char(start_date, 'DD-MM-YYYY hh24:mi:ss') Like '%05%'
    Ta
    Shailender
    Hi All:
    Is it possible to search by hours,minutes, or seconds in the date format? I've tried the below SQL but it doesn't work.
    SELECT to_char(start_date, 'MM/DD/YY HH24:MI:SS') start_date
    FROM table_name
    WHERE start_date like '%05%';
    It returns no rows selected instead of the following rows.
    09/11/02 05:27:33
    09/11/02 05:27:35
    Please help.
    Thanks in advance,
    Regards,
    TD

  • Search managed property date format dd/mm/yyyy instead of mm/dd/yyyy

    All regional settings in the site collections and the search site have been set to English(Australia), and the date format is correct within them however when I try to perform a search on a managed date property date:dd/mm/yyyy I do not get the expected
    results. I only get the correct results when searching date:mm/dd/yyyy.
    I found some articles regarding SP2010 and this issue, the correct answer was a link to a TechNet article with information about how to modify the XSLT in the results web part in the search centre. I could not find the XSLT in the results web part properties
    in SP2013 so I don't know if this information is redundant or if there is an easier way.
    It really seems like such a simple and common request so I can only imagine that its too obvious to blog about considering the time I've put into google on this one, and am I'm missing something here?
    Thanks,

    Hi karlostavitch,
    This issue seems to be caused by Query Language. Query Language is not the language of the Browser interface, but the language submitted to web sites. By default, the property of search results is null, the locale will be inferred from the browser language.
    You can change query language by exporting the Search web part, then adding query language property to the file.
    More information, please refer to the link:
    http://blog.orbitone.com/post/Language-sensitive-search-results-in-SharePoint
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Date format when searching

    Is there a way to apply the date format specified in the control hints of the entity object (or view object) also to the search mode in JClient, e.g. 'dd.MM.yyyy'?
    The only way I see at the moment is to add an ActionListener to the execute button and reformat the given date. Can this be done easier?
    Thanks a lot,
    Matthias

    You're not the only one.
    We're developing a system that may well use different date formats for different instances, so we can't hardcode the date format.
    Anyone got any clues?
    Are you there Oracle?

  • 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

  • Date format error in Search help

    Hi,
    I am using standard search help in my ABAP webdynpro application.It is related to payscale group (field P0008-TRFGR). It works fine if I do not specify any date but gives a error message "Enter date in the format __.__.____ "   irrespective of the date format I use to enter.
    Any pointers ?
    Regards
    Deepak

    Hi Deepak,
    Try following things:
    1) check separator / instead of .
    2) date in format mm.dd.yyyy or dd.mm.yyyy
    3) enter date through search help
    4) enter 0 before one digit month or day i.e. 02/02/2009 instead of 2/2/2009
    Regards,
    Saket.

  • 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

  • Formatted Search - Date Time Stamps

    Hi,
    We are trying to use a Date & Time Stamp for two udf's of which I will then calculate the difference in a report. I have a couple of issues. Ideally the user would enter the Start field (udf1), click Shift-F2 and that udf would be populated with a Date/Time Stamp like: 07/12/09 14:30:00 or 07/12/09 02:30PM. The user would also do the same thing for the End field (udf), so I end up with two udf's that both hold a Date/Time Stamp described above.
    1 - It looks like I will either need two udf's each for both stamps, one for the Date (date field type) and one for the Time (hour field type)...or I will need to use an alphanumeric field type to hold the whole timestamp. When using the hour field type I still have some issues.
         and
    2 - I can't seem to get the right sql (sbo query) function to return the date/time stamp and / or I can't cast it or format it the way I would like.
    -If the udf is date field, I can use the GetDate function, but it doesn't seem to get the time with it or the field isn't big enough or formatted properly.
    -If the udf is an alphanumeric field, I cast the GetDate function as nvarchar and it returns the date/time stamp, but it is an alpha field and the date is Jul 21 2009  4:41PM. I don't like the Jul 21 2009 formatting
    -If I use two fields, one for date (date type) and one for time (hours type), the date is formatted the way I like, but the hours field doesn't display the AM or PM and my formatted search doesn't return military time (14:00 instead of 2:00PM), so I can't tell if 2:00 is morning or afternoon.
    So I guess my questions are pretty general...Am I using the correct field types? Any suggestions on what to use? Are there any other ways to format this data? Not all date functions or casts (time, smalldatetime) work in the sbo query so I am looking for options. Any suggestions on what functions or cast to use?
    Thanks

    Hi,
    As you already aware, within B1 you may not treat datetime field easily.  For one of your request: I don't like the Jul 21 2009 formatting.  You could use function such as
    Select CONVERT(nvarchar(30), GETDATE(),106)
    to change it to 21 Jul 2009.
    Thanks,
    Gordon

  • Using a formatted search which incorporates copying data from base document

    Hi
    I have a user selling tiles.  They sell by sq meter but will only sell whole boxes.  I have a formatted search on the quantity field to calculate the number of sq meters in a box.  They also sell indivudual units and will key this value directly into the quantity field.  All this works fine.
    However if I enter this as a sales order and copy to a delivery, then the formatted search fires and the quantity field gets refreshed.  This results in the incorrect value where the user had keyed data directly into the qty field in the base document.
    Therefore I need to incorporate my base document values into my query where by if there is a base document, the query will pull the quantity data from the base document.  My query so far is as follows
    SELECT (CAST($[$38.U_ActMtr.0] AS DECIMAL(10, 2))*CAST(T0.U_SqmBox AS DECIMAL(10, 2))) FROM OITM T0 WHERE T0.ItemCode = $[$38.1.0]
    Any suggestions?
    David

    If I understand your requirements well, you want to save the base quantity, when the delivery is based upon a SO, and to compute it when the DLN is not copied.
    Try to use this modified FS:
    declare @q dec(19,6)
    set @q=$[$38.11]
    If $[$38.43]<>-1
    Select @q
    Else
    SELECT (CAST($[$38.U_ActMtr.0] AS DECIMAL(10, 2))*CAST(T0.U_SqmBox AS DECIMAL(10, 2)))
    FROM OITM T0 WHERE T0.ItemCode = $[$38.1.0]

  • 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

  • Want to write formatted search based on date

    Hi,
    I want to write formatted search where one date is lesser than other date.But it is giving error stating like date comparision not possible
    Pls advise

    Hi Sanjay,
    SQL DateDifferent Function.
    for example.
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate = $[ODLN.DocDate]
    SET @EndDate = $[ODLN.TaxDate]
    SELECT DATEDIFF(Year, @StartDate, @EndDate) AS NewDate
    Check the thread, You will be get more details of SQL Date Different Function.
    http://sqltutorials.blogspot.com/2007/06/sql-datediff-function.html
    Regards,
    Madhan.

  • Generic Search Date Format

    Hello all,
    In B2C, when searching for open orders or completed orders, the result list is displaying the AUDAT in format yyyymmdd.  The rest of the B2C site displays dates in mm/dd/yyyy format. 
    I have not been able to locate where to change this date format.  Is there a specific config file, or xcm that needs to be modified?
    Thanks,
    Steven

    I was able to figure this out.
    I was working on hiding the Description field of the B2B template screen when I noticed the date field had fieldOutputHandler attributes.  I added the following attributes to the AUDAT property of the B2C section of generic-searchbackend-config.xml and now the date is being formatted correctly.
    fieldOutputHandlerClass="com.sap.isa.ui.uiclass.r3.genericsearch.GenericSearchUIDynamicContentERP" fieldOutputHandlerMethod="getAudatToUIDate"

Maybe you are looking for