Date format in Scripts

Dear All,
I want to change date format in script text elements. Now the date format is MMDDYYYY. Now I want change it into DDMMYYYY. How I can change that.
Thanks and regards,
Krish....

WRITE ONE Z PROGRAM .
EX. ZTEST
write the code below.
PROGRAM ZTEST.
form GET_NEWDATE tables in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA : LV_NEWDATE TYPE D.
DATA : LV_OLDDATE LIKE OLDDATE,
data : gv_dd(2) type c,
gv_mm(2) type c,
gv_yy(4) type c.
data : date(8) type c.
gv_dd = LV_OLDDATE(+22).
gv_mm = LV_OLDDATE(2).
gv_yy = LV_DOC_DATE+4(4).
CONCATENATE gv_dd gv_mm gv_yy INTO date.
LV_NEWDATE = DATE.
read table OUT_tab index 1.
MOVE LV_NEWDATE TO OUT_TAB-VALUE.
CONDENSE OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX 1.
ENDFORM.
write the code below in ur sapscript,
/:DEFINE &LV_NEWDATE&.
/:PERFORM GET_NEWDATE IN PROGRAM TEST
/:USING &LV_OLD_DATE&
/:CHANGING &LV_NEWDATE&.
PRINT &LV_NEWDATE&
ENDPERFORM.

Similar Messages

  • Date format in script format

    hi,
    how to change the date format in script form.
    thanks.

    try like this
    /: SET DATE MASK = 'Foster City, MM.DD.YY'
    &DATE& -> Foster City, 03.01.97
    &DATE(Z)& -> Foster City, 3.1.97
    /: SET DATE MASK = 'MMMM DD, YYYY'
    &DATE& -> March 01, 1997
    regards
    Prabhu

  • Date format in Script

    Hi ,
    How can I change the date format in MAIN window.
    I am ablt to used SET DATE MASK in all the windows, but in main window this option is not working.please suggest how to change the date format?
    Regards,
    Sri.

    for sap script  u can change  the  date format in driver programm and store it into any variable  and than  write  it  in to sap script main window...
    for example..
    Suppose a date is given in the format 20050428 how to get the output in the format 28th Apr 2005.
    FORM set_text_date.
    DATA: month(9),
          year(4),
          date(2).
    CASE p_frd+4(2).
    WHEN '01'.
      month = 'January'.
    WHEN '02'.
      month = 'February'.
    WHEN '03'.
      month = 'March'.
    WHEN '04'.
      month = 'April'.
    WHEN '05'.
      month = 'May'.
    WHEN '06'.
      month = 'June'.
    WHEN '07'.
      month = 'July'.
    WHEN '08'.
      month = 'August'.
    WHEN '09'.
      month = 'September'.
    WHEN '10'.
      month = 'October'.
    WHEN '11'.
      month = 'November'.
    WHEN '12'.
      month = 'December'.
    WHEN OTHERS.
    ENDCASE.
    WRITE p_frd+0(4) TO year.
    WRITE p_frd+6(2) TO date.
    CONCATENATE month date ',' year INTO return_date SEPARATED BY space.
    CONDENSE return_date.
    ENDFORM.

  • Date formating in scripts

    hi experts,
    I want to print date in dd.mm.yyyy format in script.
    I have used SET DATE MASK command in script...
    But i am getting ddmmyyy format without any seperators.
    plz tell me what can be done.
    regards.
    sm

    instead of date print date1.
    write the above said code in driver program and write this variable in script.
    regards.
    santhosh reddy

  • Regarding Date Format in Scripts

    Hi
    i'm modifying sales order from. In rvorder01 for i'm getting sale order number and date from &VBDKA-VBELN& / &VBDKA-AUDAT& fields but when i'm printing date (VBDKA-AUDAT) it is printing as 23.09.2007 but my requirement is to print the date in 23/09/2007 format . can any one plzz let me know how to convert date format.
    Thanks & Regards
    Munna

    Use this
    /: SET DATE MASK = 'DD/MM/YYYY'.
    &VBDKA-AUDAT&
    Regards,
    SaiRam

  • HELP! date pass to script not display in date format

    hi all,
    i want to include final approver date into Puchase Order, and i call up a form, getting the date from CDHDR. however, when i return the date back to the script, the date display in PO are out of date format.
    original : 16.07.2007
    but it shows as : 20070716
    how am i going to change it to the actual proper format in script?
    very thanks for the help first.

    hi,
    but i have other date ( such as create date) which are showing correctly. the create date gets directly from table.
    i tried to use the SET DATE, but there is no charge on it. my actual code is as below:
    /:           PERFORM GET_TEST IN PROGRAM Z_TESTING6
    /:           USING &EKKO-EBELN&
    /:           CHANGING &UDATE&
    /:           ENDPERFORM
    PO            Release Date,,&UDATE&
    can only one help me. thanks

  • Urgent ......regarding date format in SAP Script

    In my MAIN WINDOW  I have date fields like Date of Manifacture, created date and Expiry date.
    So, currently  I am using SET DATE MASK = 'YYYY-MM' and it is printing same format for all fields.
    But now my requirement is I want to show date for Expiry Date like 'YYYY-MM-DD'. For this I defined one temparary variable in the form like below
    DEFINE &outdate& = &mchar-vfdat&
    SET &outdate& MASK = 'YYYY-MM-DD'.
    but still it is showing format YYYY-MM...
    Plz help me how to print my desired date format...
    I am waiting for ur reply...
    Regards,
    Kumar

    Hi Kishore kumar,
    What you can do is befor printing the Expiry date set the date Mask as 'YYYY-MM-DD' and after printing your Expiry Date again set the DATE MASK to 'YYYY-MM'
    i.e.
    /: SET DATE MASK = 'YYYY-MM-DD'
       &mchar-vfdat&
    /: SET DATE MASK = 'YYYY-MM'
    Regards,
    Sunil

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?

    How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?
    I currently run OS X 10.10.1
    Now i have been trying to work on this for a while now and what i want to do should be simple but its apparently not.
    Here is an example of what i want to happen.
    I will have 2 tabs: Contact | Sales
    Now Contacts will have the list of names and various information about a customer, While Sales will have one drop-down box for each Cell Row that will show the names of the person in tab contacts
    for what i am wanting to do i cant use the data format pop-up menu because the list is edited everyday several times a day.
    Now how do i do this, Excel can do this so how can numbers do it?

    Hi Shegra,
    Paste this into a applescript editor window and run it from there. In the script you may need to adjust the four properties to agree with your spreadsheet. Let me know if you have any questions.
    quinn
    Script starts:
    -- This script converts column A in one table into an alphabetized list of popups. It copies the last cell in that column. Then reverts the column to text. It then refreshes popups in column A of a data table starting with a user defined row.
    property DataEntrySheet : "Sheet 1" --name of sheet with popups to be refreshed
    property DataEntryTable : "Sales" --name of table with popups to be refreshed
    set copyRange to {}
    property PopValueSheet : "Sheet 1" --name of sheet with popup values table
    property PopValueTable : "Contacts" --name of table with popup values
    set PopStartRow to {}
    tell application "Numbers"
      set d to front document
      set ps to d's sheet PopValueSheet
      set pt to ps's table PopValueTable
      set s to d's sheet DataEntrySheet
      set t to s's table DataEntryTable
      set tf to t's filtered --this records filter setting on data Entry Table
      display dialog "Start from row #..." default answer "" with icon 1 -- with icon file "Path:to:my.icon.icns" --a Week # row
      set PopStartRow to {text returned of result}
      tell pt --convert list to alphabetized popups
      set ptRows to count rows
      set copyRange to ("A2:" & name of cell ptRows of column "A")
      set selection range to range copyRange
      set selection range's format to text
      sort by column 1 direction ascending
      set selection range's format to pop up menu
      -- popupsmade
      set selection range to cell ptRows of column 1 of pt
      set v to value of cell ptRows of pt
      end tell
      activate application "Numbers"
      tell application "System Events" to keystroke "c" using command down
      tell pt
      set selection range to range copyRange
      set selection range's format to text
      end tell
      tell t
      set filtered to false
      set tRows to count rows
      set pasteRange to ((name of cell PopStartRow of column "A") & ":" & (name of cell tRows of column "A"))
      set selection range to range pasteRange
      tell application "System Events" to keystroke "v" using command down
      set filtered to tf
      end tell
    end tell

  • How can i convert the firefox-history-timestamp in places.sqlite into a normal date format? The firefox-timestamp is not equivalent to the unix-timestamp, that's why I ask. I could not find a conversion function. Does anyone know something about this?

    As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?

    Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.

  • Finder date format in List View

    I want to tell Finder NOT to display the day of the week or the spelling of the month in the date columns when it is in List View.
    I want this exactly, and nothing else:
    mm/dd/yyyy 12:30
    I want the month and day to always use two digits. It just think it looks better when a column of data is all formatted the same exact way. And, I don't need to know that 04/17/01 was a Thursday (or whatever it was)!
    I know you can resize the columns to get various amounts of info and formats, but that's too much effort, plus you get all these weird ",..." filler garbage. Let's just make it simple!!!

    I think the width of the column is the sole determinant of the date format shown in list views. I use an applescript to set the size, position and column width of Finder windows to my preferred specs; it sets the date column width so that a shorter (but not shortest) date format is used (because I'm picky about that, too ). You can easily tinker with the numbers so the sizing suits your own preferences.
    -- works on frontmost Finder window;
    -- settings appropriate for display res 1440x900
    <code>
    tell application "Finder"
    set bounds of window 1 to {230, 120, 1260, 820}
    set sidebar width of window 1 to 200
    set width of column name column of list view options of window 1 to 280
    set width of column modification date column of list view options of window 1 to 180
    set width of column size column of list view options of window 1 to 100
    set width of column kind column of list view options of window 1 to 180
    end tell
    </code>
    Instructions for saving scripts in case you or other readers need them: Copy and paste the above into a new Script Editor document (or highlight and use the Services -> Script Editor menu). Save as file format: Script at this path -- ~/Library/Scripts/Applications/Finder/ -- creating any folders that don't already exist. You can change the numbers in the script and use the Run button in the Script Editor toolbar to test until you get something you're happy with.
    HTH,
    Lisa

  • Date Format in Forms 4.5

    For all the date fields in my Oracle Forms application i have set
    a date format of dd/mm/yyyy. When entering data if the user does
    not put the date in the above format, forms raises an error. I
    want to be able to let the user enter the date in any format
    and then convert it to the above format.
    Have you seen any reusable scripts that do this? Has anyone
    done this?
    null

    Hi Mala,
    I wasn't sure as to what you meant by any format. Is it like
    being able to enter a 2 digit year instead of a 4 digit year? Or
    is it like being able to enter the day, month, and year in any
    sequence? Try using the DD/MM/RRRR date format in the item
    properties if the problem is just with the four digit year. This
    allows you to enter a 2 digit year and depending on the value it
    decides whether the 4 digit year begins with 19 or 20.
    Hope this helps.
    CV
    Metro Infomation Services.
    Mala (guest) wrote:
    : For all the date fields in my Oracle Forms application i have
    set
    : a date format of dd/mm/yyyy. When entering data if the user
    does
    : not put the date in the above format, forms raises an error. I
    : want to be able to let the user enter the date in any format
    : and then convert it to the above format.
    : Have you seen any reusable scripts that do this? Has anyone
    : done this?
    null

  • Can't see HTML and Custom text format under data format tab in obiee.

    Hi,
    I want to add a java script to my report but I can't see HTML/Custom text format option under Data Format Tab--->"Treat Text as" menu.
    My report is a union report.
    For data column and numeric columns i can see custom option available but for text columns it is not visisble.
    Any idea why it is not showing and what should be done here.
    Any pointers are welcome.
    Please help,it is really urgent.
    Thank in advance!
    Edited by: 810008 on May 18, 2011 10:03 PM

    Hi,
    Select text column (varchar column) -> Treat Text as -> custom text format ->Remove @ (default) -> add [html]<script>sometext(‘@’)</script> followed by your javascript
    for eg:
    [html]<script>buildGoogleChart(‘@’)</script> <head> <script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } </script> </head> <body> <input type="button" onclick="show_alert()" value="Show alert box" /> </body> </html>
    hope helps u.........
    cheers,
    Aravind

  • Automatically actuality of date format despite of passwort security

    Hey people,
    my question relates to the descriped problems with the automatically generated date format, which is updated automatically, when you open the PDFs. The first step was advanced editing --> Java scripts generates a corresponding script in a text box.
    var datum = this.getField("datum");
    var jetzt = new Date();
    var tag = jetzt.getDate();
    var monat = jetzt.getMonth() +1;
    var jahr = jetzt.getYear() +1900;
    datum.value = "The printed version is only valid on "+tag+"."+monat+"."+jahr;
    However, the PDF must be secured be password; against unauthorized access.
    Is it possible, despite password protection, ensuring the update with opening the PDFs?
    Thanks for your help!
    Daniel

    Yes. Have you tried?
    Also, use the getFullYear method. The getYear method has long been deprecated.

  • How do I change the date format?

    Sorry, but I'm new to Oracle!
    I'm using "sqlplusw" to build my SQL statements. When I return columns that are date fields, I get the DD-MON-YY format. I want dates to be returned in "YYYY-MM-DD HH24:MI:SS". My DBA won't change the date format on the server, so how do I change SQLPLUS to return dates in the format I want? Do I need set this in some kind of startup file, or a reg key?
    Using client version 9.2.0.5 against a 9.2.0.1 server
    Jeff

    There are a couple of ways you could do it.
    Way 1:
    Search for a file by name 'glogin.sql' on your client work station and add the following statement
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure you save the file. This change will apply to all users who will log into the database using SQL*PLUS from your machine.
    Way 2:
    Create a shortcut and place it some where (for example on the 'DESKTOP').
    Right click on the short cut and choose properties.
    Change the text corresponding to the 'Start in' box to reflect the current location of the shortcut.
    Create a file by name 'login.sql' and place it in the same folder as the shortcut.
    Edit the file and add the following line.
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure that you save the file.
    When you double click the shortcut to start SQL*Plus and login, the script 'login.sql' is executed.

Maybe you are looking for