UDF for sorting date

Hi Guys,
I am doing scenario File to Idoc, i have to sort date in acending order, the date format will be in either 22.10.2007 or 22/10/2007 . can any one send UDF for this.
Regards,
venu gopal

Hi Venu
You can execute this without UDF. Use " Transform" function in the Date functions.
When you are using the UDF....you keep the strucure as "yyyMMddhhmmss" for that clickon Trnasform function and there you can see ShowAdvancedProperties...there u can find the format of the source which you are expecting and also change the strucutre of you target expected format.
You please try this and check the mapping it will get execute.
Use Standard Date Function DATATRANS. It have the property for format and input is the source date field. It will convert the date format to required specified format which you menstion in the DARTATRANS function
for UDF
Re: UDF  for this mapping rule
Re: Problem in UDF please Help?
Thanks!

Similar Messages

  • Calling webservice in udf for inserting data into webservice

    Dear Experts,
          Please give me the drawbacks of using lookup function for inserting data. we are calling a webservice from the udf for inserting the data using a webservice.
    It is a file to jdbc usnig a soap lookup . we use this approach because we need to pass the response from webservice along with the error data to the jdbc.   is there any other way to do it without using bpm ?
        In the udf we are creating the xml structure for webservice and passing the parameters through arguments.
    is there a better approach for this ?
    Thanks,
    Aju

    Hi Aju,
    You can do it without BPM.
    Write UDF for Soap Lookup. Parse the response message from Webservice.  and map the required values to respective fields.
    See the weblog
    Webservice Calls From a User Defined Function.
    Negative point of this solution is that it will take some time to call Webservice and get response back from it.
    Kulwinder

  • Suggestions for sorting dates

    Hi everyone,
    Im in need of sorting a few Date objects in descending order.
    I was thinking of storing them in some sort of vector/array but not sure how i could swap the objects in those positions.
    eg. if date at vector.elementAt(4) > date at vector.elementAt(0) swap positions.
    What would you people recommend i use to sort dates?

    i've been trying to add dates to an array but its not adding for some reason. here is a bit of my code:
             Date[] dates = new Date[500];
                           z = 0;
                   for (x=0;x<books.size();x++)
                      for (y=0;y<((Book)books.elementAt(x)).transactions.size();y++)
                         if ((((Transaction)((Book)books.elementAt(x)).transactions.get(y)).memberID).equals(memberID))
                   dates[z] = (((Transaction)((Book)books.elementAt(x)).transactions.get(y)).dateRent);
                            z++;
                            System.out.println (dates[z]);
                   }i know the dates are not adding to the array because when i try to print it out i just get null. and i know there is no problem with the dates im trying to add because i can print them out fine.

  • UDF FOR POSTING DATE

    Hi all,
    i have a document of fileld(LFA1=LIFNR),IT SHOULD BE POSTED ACCORDING TO POSTING DATE (BKPF-BUDAT).i.e 22022008.
    how  to caheive this functionality.should we write UDF?
    regards,
    rao

    Hi rao,
    According to me you don't need any UDF.
    the field lifnr has 7 line items ,these 7 line items should go in onedocument
    For this you have to use concat function.
    posting date for this document is as per (BKPF-BUDAT).
    For this you have to use IfWithOutElse function. By using Equals (Text category) and constant function.
    Take care of CONTEXT. Put Context of all input parameters at upper node(same level).
    and before map to Target field use SplitByValue function.
    Regards,
    Rohit
    Reward points if useful.

  • Sort data Date wise(YYYY-MM-Date) in BPEL output

    HI,
    Can any one help me, how to write code for sort data Date wise(YYYY-MM-Date) .
    I pass the input as Name from the service wsdl(Exposed Services) and its call the third party service(External References) , its return the output like below one,
    Name:Vodafone
    Pole:INdia
    End Date:2012-05-12
    Name:Airtel
    Pole:USA
    End Date:2012-05-13
    Name:Uninor
    Pole:Canda
    End Date:2020-10-13
    Name:Celltell
    Pole:INdia
    End Date:2011-03-21
    Above o/p in Random way, but i need this one in sort data date wise.
    Finally i need output based on the latest End Date..
    like,
    Name:Uninor
    Pole:Canda
    End Date:2020-10-13
    Name:Airtel
    Pole:USA
    End Date:2012-05-13
    Name:Vodafone
    Pole:INdia
    End Date:2012-05-12
    Name:Celltell
    Pole:INdia
    End Date:2011-03-21.
    Could you please help me the format of code, and where to i implement this one. its very urgrnt.
    Regards,
    Harsih

    Hi
    Sukanya,
    Thanks for ur quick replyy, i fetch data from external reference onlyy. If i fetch data from DB what u said its exactly right.
    Re: Sort data Date wise(YYYY-MM-Date) in BPEL output 

  • Efficent method to sort data from tab delimited text file

    I am currently writing a program to sort through data that was acquired and display it on a graph and some other indicators.  The file is a tab delimited text file with possibly 100,000s of data points.  the current method that I have tried using was that if I wanted all of the data from Oct, I would parse out the month from the timestamp, compare that to the desired month, and add it to the array if it is the same.  Other possible options of sorting are yearly and daily, possibly even hourly.
    The method does work, however it does take some time (up to a minute on a P4 3.6 GHz with 2 gb ram), and most of the other computers are not nearly as fast or with as much memory.  Is there a more efficent method to sorting the data??
    I attached my sorting vi as well as a sample data file.
    thanks for the advice.  It is saved in LV8.0.1
    Kenny
    Kenny
    Attachments:
    data sort.zip ‏84 KB
    oven1.txt ‏21 KB

    First of all, "sorting" has usually a different meaning (Sorting and numeric array ascending or descending, a string array aphabetically, etc.). Your data already seems sorted by date and time, you just want to pick a subset having certain characteristics.
    The main problem that is slowing you down is your constant growing of large arrays. This causes constant memory reallocations.
    Since your data is already sorted by date and time, all you need is to place your data in a sutable data structure, find the start and end point of your selection, then use "array subset" for example.
    Your code also seems to have a lot of unecessary complexity. See for example your "test for sort data" (see image below).
    the four cases only differ by filename --> only the file name belongs into the case and the file operation outside the inner case. Even better, just use autoindexing.
    that shift register does not do anything, because it always contains the same data. Using "index array" with index wired to [i] is equivalent to an autoindexing tunnel.
    You have a case structure to select which files to read, skipped files give you an empty array. Do you really need to do all these operations on an empty array. Why not place all code inside the TRUE case??
    Below is an image of one possible code alternative that addresses some of these points.
    Message Edited by altenbach on 10-26-2006 09:32 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    testForSortData.png ‏33 KB

  • Date Format for Spry data set sort

    Hi
    Just feeling my way through the use of Spry Datasets for the
    first time and have a couple of issues hopefully someone with more
    knowledge of it than me know the answer to.
    I had an issue with my Spry Dataset initially that it would
    not work in ie7 but was OK in FF3.
    After some mucking round I realised the error I was getting -
    albeit obscure in IE was telling me it was a date format issue in
    my data set.
    The db data I am playing with here is fairly simple: I have a
    couple of text fields, an integer field that contains the
    unixtimestamp of the entry (its a simple diary application) and a
    formal date field that holds the same date in mysql's date format.
    When I display the date in the dataset I do so in the format
    "23rd May 2009" (as an example)- I code this using phps date
    function in my xml query.
    I had set this field to date format in the Spry dataset
    conditions but IE seems to barf on this- I can change it to
    textstring but then my sort is done on Alpha/Numeric sort of the
    first character in the date field which is rubbish.
    I only display the date in this format and one of the other
    text fields in my dataset- the unixdate is for programmatic
    purposes not general display so I cannot sort on this field if its
    invisible. How can I acheive a date based sort with this set up- or
    what date formats does Spry code prefer for date sorts? (My client
    wants the date to show as I have explained). Many thanks. I have a
    second query which I will post separately!
    Kenny

    "Tanushiheadbash" <[email protected]> wrote
    in message
    news:gqa70o$iat$[email protected]..
    > I think I follow what you are saying and in fact I think
    its what I
    > already
    > have. I have set the sort order to use the unixtime when
    the page
    > initially
    > loads and thats OK.
    I am sorry, but you aren't following my explanation. English
    isn't my mother
    tongue, and I am not able to explain it any better.
    > However what I need to be able to do is to have the
    AJAX/Javascript sort
    > (done in this case with Spry- ) to sort on the date when
    the column header
    > is
    > clicked. The problem I have is the date format in this
    visible column is
    > in
    > DDth Month YYYY format and Spry does not recocnise this
    as a date format-
    > it
    > wants it as a string ( or ie gives an error). Maybe its
    not possible what
    > I am
    > trying to do- just thought there might be a clever way
    to implement this.
    You can take a look at this page:
    http://visual.unipv.it/tmt_calendar/admin/reports/events.cfm
    Even if all the dates here are incidentally using the
    yyyy-mm-dd format, the
    dataset display the date from the "start_date_formatted"
    field:
    <td><a href="javascript:"
    onclick="showUpdate('{event_id}')">{start_date_formatted}</a></td>
    But uses another field to sort the table:
    <th scope="col" spry:sort="start_date">Start
    date</th>
    You can have the same date, using two different formats,
    inside two,
    separated dataset fields. One is used for display, the other
    one is used for
    sort.
    You may try to read again my previous explanations, look at
    the code in the
    page above and see if you get the idea.
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    http://www.massimocorner.com

  • MRP is not considering material availability dates for sorting customer ord

    Hello Experts,
    MRP is not considering material availability dates for sorting customer order/ sales order in sequence (thatu2019s is oldest from newest in order) in MD04.
    Please suggest.
    Thanks,
    Om

    Om,
    No.  Aside from my obvious desire to preserve my privacy, it would be a disservice to the other forum members.  No-one else but you and I would understand your problem, and no-one else but you would be able to benefit from any solutions. 
    There are dozens of free public portals suitable for posting pictures on the internet.  I suggest that you use one.
    Best Regards,
    DB49

  • Supported date formats for sorting

    Can someone point me to a document describing the supported
    date formats for sorting? I mean, how should I format a date column
    in an XML dataset in order to have this column correctly sorted
    using the Spry framework?
    Thank you and sorry if the question is trivial.

    Thanks, what I have done for the moment as a temporary
    solution is to use the two date formats and have them both inside
    the one cell in the table (the column for the sortable date
    yyyy-mm-dd). In my CSS I have created a style for the first date
    that has it's visibility as hidden. That way it's sorting the Date1
    but only Date2 is being shown to the users as the other cells have
    more than one line of text it doesn't look too off centre.
    <div spry:region="ds2">
    <table width="662">
    <tr>
    <th width="127" class="eventhead"
    spry:sort="Date1">Date</th>
    <th width="151" class="eventhead"
    spry:sort="Type">Type</th>
    <th width="146" class="eventhead"
    spry:sort="Title">Title</th>
    <th width="189" class="eventhead"
    spry:sort="Venue">Venue</th>
    </tr>
    <tr spry:repeat="ds2" spry:setrow="ds2">
    <td height="53" class="event">{Date2}<span
    class="eventhide">{Date1}</span></td>
    <td class="event">{Type}</td>
    <td class="event">{Title}</td>
    <td class="event">{Venue}</td>
    </tr>
    </table>
    </div>
    </div>
    It seems to be working for the moment...

  • Excel14.4.7 (Excel for Mac 2011); can't sort data

    Upgraded to Excel for Mac 2011 (v.14.4.7) and cannot sort data. Have read instructions but keep getting error message "missing column/row name"
    Tried doing it with box checked "My list has headers" and with the box unchecked....same non-result and error message.
    I'm doing something wrong, obviously but can't figure it out. I am totally mystified & frustrated!
    any ideas????
    Thank you
    Rose

    This may be a related issue and fix:
    https://discussions.apple.com/message/26086328#26086328

  • UDF for Item Master Data

    Hi,
    The UDF options in the menu bar for the Item Master Data are available in one database but NOT in another database.
    Is this a known bug and/or related to conversion of a database from a previous version.
    We're using SBO 6.5 SP:01 EF:07
    Thanks

    Hi,
    UDF options in the menu bar are only visible if there are defined UDF for the active form. Are you sure that the seccond database has any UDF?
    Regards,
    Ibai Peñ

  • ADF Unable to filter / sort date column in table

    Hi,
    I am using JDeveloper 11.1.1.7.
    I have a read only table inside a panel collection. One of the columns in the table is a date field. I have filterable and sortable properties set to true for all columns. Filter and sort property works for all columns expect the date column. The filter and sort options is not even shown for the date field (shown below).
    <af:column headerText="#{bindings.ASRTCreateRequestVO1.hints.CreationDate.label}"
                                             id="c7" sortable="true" width="100"
                                             filterable="true">
                                    <af:outputText value="#{row.CreationDate}"
                                                   id="ot7">
                                      <af:convertDateTime pattern="#{bindings.ASRTCreateRequestVO1.hints.CreationDate.format}"/>
                                    </af:outputText>
                                  </af:column>
    Please let me know if I am missing anything here.
    Thanks,
    Ashwin

    Hi Ashwin,
    As mentioned by Timo, for me also the filtering is working as usual.
    But while browsing through the ADF UI Guide I came across with below note
    If you want to use a component other than an inputText component for your filter (for example, an inputDate component), then instead of setting filterVisible to true, you can add the needed component to the filter facet.
    To do so:
    1. In the Structure window, right-click the column to be filtered and choose Insert inside af:column > JSF Core > Filter facet.
    2. From the Component Palette, drag and drop a component into the facet.
    3. Set the value of the component to the corresponding attribute within the FilterableQueryDescriptor class created in Step 1(not above step but you can find it in pg:390). Note that the value must take into account the variable used for the row, for example:
    #{af:inputDate label="Select Date" id="name" value="row.filterCriteria.date"}.
    This is in the section: 12.5.1 How to Add Filtering to a Table(pg:390).
    I hope it helps.
    Regards,
    Peddi.

  • Pb retrieving sorted data from Table in SQL.

    Hi,
    I get problem to retrieve data in the right order from table in database SQL.
    See code attached: code.png
    I want to sort data according to ID number And then to retrieve those data and fill out a ring control in the right order "descending" .
    But i got always ID 2 instead of 1. See attached  picture : control.png
    it seems that the select statement (see under) is not woking properly. But it is working well in a query in Access DataBase .  
    //Select statement
       hstmt = DBActivateSQL (hdbc, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName));
       if (hstmt<= DB_SUCCESS) {ShowError(); goto Error;}
    Some idea ??
    Lionel.
    Attachments:
    code.PNG ‏39 KB
    control.png ‏32 KB

    Hello Lionel,
    According to the document Robert linked, the prototype of DBActivateSQL() is:
    int statementHandle = DBActivateSQL (int connectionHandle, char SQLStatement[]);
    For the 2nd parameter(SQLStatement), you're sending:
    ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName)
    Probably your intention is to substitute %s with szTableName, but that's not what it happens.
    By using comma operator, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName) is evaluated to szTableName, so you call is equivalent to:
    hstmt = DBActivateSQL (hdbc, szTableName);
    In order to substitute %s with szTableName you need to first build the string you're passing as the 2nd parameter:
    char query[512];
    sprintf(query, "SELECT * FROM %s ORDER BY ID DESCENDING",szTableName);
    hstmt = DBActivateSQL (hdbc, query);

  • How to sort data in cl_gui_alv_tree class?

    Hi,
    I thought that since this object uses an alv grid that the standard sort functionality would exist.  Now that I've developed most of the code, I realize that there is no native sorting functionality.
    Is there some way I can make use of the Superclass CL_ALV_TREE_BASE?
    It has some methods that are "Private", "Instance"  - I'm still a rookie at OO programming in SAP so I'm not sure how best to approach the situation.
    As I see it, I have a few options:
    1)  Manually manage sorting by providing an ascending and descending button/icon on the toolbar and then delete and rebuild the nodes in the tree.
    2)  Manually track the data along with the nodekeys and then use method MOVE_NODE to reposition the data in the tree
    3)  Clone these objects and somehow find the code that is causing the sort options to be suppressed in the toolbar.
    Has anyone built any applications using CL_ALV_TREE_BASE that permit sorting?
    Please don't waste my time by pasting in the links to all the SAP online help for ALV and expect to get points.  Been there, done that.  If there is a particular section that is of specific value, I'll happily study it and report my findings.  Particularly something that explains how to invoke the methods of a superclass and the difference between protected, public, and private.
    Mostly though, I really need a way to sort data in the CL_GUI_ALV_TREE class.
    Thanks

    Hi Ray,
    As far as I know, this will not work. I've had the same problem. The only solution I have found was to re-build the tree each time. It is easier than moving nodes around.
    You can take a look at the class cl_wa_notifications_wps - in case you have a PM or an A&D system.
    Ferenc

  • Any Ideas For Sorting Rows When Planning Using Excel Interface

    Greetings Colleagues,
    I have a customer that is using BW-BPS with the Excel-In-Place user interface.  During end-user planning, users have expressed a desire to re-sort their data using a criteria different than that defined in the lead column of the layout.  Unfortunately, once the data is sorted in Excel, this causes errors when saving.
    Any ideas on how a user may be able to re-sort data without adversely impacting the layout?
    Thank you in advance for any ideas you might have.
    -M

    Hi Michael,
    Once you execute the Planning layout in Excel, you still have the Excel Menu options available. If you go to
    "Data Menu" and select the "Sort" option it allows you to sort the dataset based on the criteria you want and allows you to save the data also.
    Hope this is what you were looking for.

Maybe you are looking for