Formatting the date in an output file

Greetings Abapers
I am writing a program which outputs a file in csv format. Currently the date is shown in the file as 20080609000000 but i would like it to be shown as 09.06.2008. Help anyone?

it seems that you have concatenated timestamp  with  year .
just concatenate  w_a+6(2)
                           w_1+2(2)
                           w_a(4)
                 into   w_b .
now move this field w_b  to excel

Similar Messages

  • IS it possible to Format the data to CXML format in Java ?

    Hi all,
    I am new to Java programming. I am an SAP ABAP Developer and in my SAP CRM E-Commerce Web Shop coding, I have to do coding in Java.
    My current requirement is that I have some set of data and I have to format this data to CXML format in Java. IS this possible?
    Can I format the data to CXML format in Java? Are there standard API's to do this? Please let me know how should I procced with the coding?
    Apart from formatting the output to CXML format, I have to also post this data to an external market place...How can I do this?
    Please help me with relevant information. your help will be highly appreciated.
    Regards,
    Jessica Sam

    It should be possible to format the data, yes. If there's a "standard API" it should be one that comes out of that SAP CRM thing, so look there.
    As for "posting to an external marketplace", that's far too vague a concept to be able to answer. You should start by getting the specs about "how to post" from that marketplace.

  • Uploading the data from a flat file into ztable

    Hi,
    I have a requirement where I have to upload the data from 2 flat files into 2 z tables(ZRB_HDR,ZRB_ITM).From the 1st flat file only data for few fields have to be uploaded into ztable(ZRB_HRD) .Fromthe 2nd flat file data for all the fields have to me uploaded into ztable(ZRB_ITM). How can I do this?
    Regards,
    Hema

    hi,
    declare two internal table with structur of your tables.
    your flat files should be .txt files.
    now make use of GUI_UPLOAD function module to upload your flatfile into internal tables.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = 'c:\file1.txt'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab1
        EXCEPTIONS
          OTHERS              = 1.
    use this function twice for two tables.
    then loop them individually and make use of insert command.

  • Populate a table reading the data from a TXT file

    how can I populate a table reading the data from a TXT file?
    thanks

    Hey Kevin!
    Using FORMS.TEXT_IO to bulk load data from a file strikes me as re-inventing the wheel. It is just about justifiable in a self-service environment, but I regard the EXTERNAL TABLE is a better solution for that situation as well.
    The same applies to UTL_FILE. I think the ability to read text with UTL_FILE is primarily intended for read file-based configuration or file manipulation/processing rather than data loading.
    Re-writing a text file into SQL statements is too much like hard work (even with an editor that supports macro definition and regular expressions) for no real benefit. You lose all the bulk load peformance you would get from SQL*Loader. But for QAD I'd probably let you off with it.
    You missed out one obvious alternative: using Java to turn the contents of an XML file into a CLOB and inserting it into a table which is read by a PL/SQL procedure that parses the XML records and insert the retrieved data into a table.
    Stay lucky, APC

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • Steps to load the data by using flat file for hierarchies in BI 7.0

    Hi Gurus,
    steps to load the data by using flat file for hierarchies in BI 7.0

    hi ,
    u will get the steps int he following blog by Prakash Bagali
    Hierarchy Upload from Flat files
    regards,
    Rathy

  • HT3775 Is the Codec listed adjacent to the file format the Codec used with that file format?

    Is the Codec listed adjacent to the file format the Codec used with that file format?

    Is the Codec listed adjacent to the file format the Codec used with that file format?

  • The data rate of this file is too high encore

    Hi,
    Im new to all this, and I need a real quick solution as this needs to be done for the next few days, please help.
    I get a "the data rate of this file is too high encore"the data rate of this file is too high for DVD" message when I try to brun to disk.`
    I assume this means the bitrate I used when exporting from premiere? I only have one file to go on the DVD, what bitrate should I use?
    Thanks

    What did you export from Premiere?
    Did you use the MPEG2-DVD preset... and did you make any changes to the preset?
    CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 may help

  • Format the date in Smartform

    Hi Experts,
              Please tell me how to format the date in Smartform...I mean if my date is
    '04.03.2007' ..I wanted to print it as 4 March,2007.
    Please reply me back..its urgent..

    hai
    plz check this code
    DATA :i_monthname   TYPE TABLE OF t247,
          w_monthname   TYPE t247,
          v_date        TYPE sy-datum,
          v_year        TYPE bkpf-gjahr,
          v_month       TYPE bkpf-monat,
          v_day(2)      TYPE c,
          v_ndate(11)   TYPE c.
    CALL FUNCTION 'MONTH_NAMES_GET'
      EXPORTING
        language    = sy-langu
      TABLES
        month_names = i_monthname.
    CALL FUNCTION 'CACS_DATE_GET_YEAR_MONTH'
      EXPORTING
        i_date  = sy-datum
      IMPORTING
        e_month = v_month
        e_year  = v_year.
    MOVE sy-datum TO v_date.
    SHIFT v_date BY 6 PLACES.
    v_day = v_date.
    READ TABLE i_monthname INTO w_monthname WITH KEY mnr = v_month .
    CONCATENATE v_day '-' w_monthname-ktx '-' v_year INTO v_ndate.
    WRITE:/ v_ndate , sy-datum.
    **Please reward suitable points***
    With Regards
    Navin Khedikar

  • I have a 2007 iMac connected via WiFi. It has been working fine until I turned it on after a recent vacation. Network preferences indicates that it is correctly connected to my WiFI system but the data input and output rate is virtually zero. I know that

    I have a 2007 iMac connected via WiFi. It has been working fine until I turned it on after a recent vacation. Network Preferences indicates that it is correctly connected to my WiFI system but the data input and output rate is virtually zero. I know that the WiFI signal is reaching the iMac since both my iPhone and iPad are working perfectly at that location. I have rebooted the router and the iMac to no avail. Any suggestions would be greatly appreciated. Thank you very much. Geoff

    Hi Geoff,
    Hi, this has worked for a few...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    10.4 instructions...
    Is that Interface dragged to the top of Network>Show:>Network Port Configurations.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    Click OK.

  • FM or Way to validate Date format. The date is from TEXT File

    Dear All,
    I need to validate a date field whether it is in proper format.
    The field is coming from TEXT file to Internal table by using FM GUI_UPLOAD.
    Can any one give me the FM name or guide me how to do that?
    Definitely points will be given for correct solution.
    Thanks & Regards,
    Neeraj

    try the function module 'DATE_CHECK_PLAUSIBILITY'
      call function 'DATE_CHECK_PLAUSIBILITY'
           exporting
                date                      = '23.09.2007'
           exceptions
                plausibility_check_failed = 1
                others                    = 2.
      if sy-subrc <> 0.
        write:/ 'Please verify the date'.
        exit.
      endif.

  • Line Feed within the cell in .CSV output file

    Hello Experts,
    I have created one z-report, and the output of the report is in .CSV file format separated by 'semi-colon' as separator.
    Their is one column "Product" in which data is in the format
    <b>"[Product1][Product2][Product3][Product4]"</b>
    My code looks something like this:
    LOOP AT product_new INTO wa_product. 
      CONCATENATE Prod_str
                  wa_product-tdline             
             INTO prod_str.
    ENDLOOP.
    Our requirment is to insert Line-feed between each product entries within the cell.Line-Feed between each product within the cell is possible with ALT+ENTER key
    The output required is
    "[Product1](ALT+ENTER)
    [Product2](ALT+ENTER)
    [Product3](ALT+ENTER) 
    [Product4]"
    I would appreciate if anybody can help me to solve this.. (urgent)
    Thanx.

    Hi
    Go thru these links
    Regarding line feed
    add line feed to string
    When you concatenate try using the abap char utility for newline as well.
    i.e CL_ABAP_CHAR_UTILITIES=>NEWLINE.
    LOOP AT product_new INTO wa_product.
    CONCATENATE Prod_str
    wa_product-tdline
    CL_ABAP_CHAR_UTILITIES=>NEWLINE.
    INTO prod_str.
    ENDLOOP.
    Regards,
    balaji
    **rewrds for helpful answers

  • Refreshing the data in a flat file

    Hi
    I am working on data integration.
    I need to fetch data from Oracle data base and then write it to a flat file.
    It is working fine now,but for the next fetch I don't need the old data to remain there in the file.The data should get refreshed and only the newly fetched data should be present.
    After the data is written to the flat file can i rename the file?
    I need the format of the file to be 'File_yyyyMMDDHHmmss.txt'.
    My final question is how should I FTP this to the target?
    Please help me on this as soon as possible since this is needed in an urgent part of the delivery.

    All you ask is achievable:
    1) The IKM SQL to file has a TRUNCATE option, which will if set to YES, will start from a clean file.
    2) You could rename the file after writing it, but why not just write it with that name? If you set the resource name to be a variable, (e.g. #MyProj.MyFilename), and be sure to set the variable in the package before executing your interface, you should be able to get the file you want. Otherwise, you can use the OdiFileMove tool in your package to rename the file.
    To set the name of the variable you can use a query on the database (if you are using Oracle, something like SELECT 'File_'||TOCHAR(SYSDATE) from DUAL.)
    3) ODI has ftp classes built in- you can find the doc under doc\webhelp\en\ref_jython\jyt_ex_ftp.htm
    Hope this helps
    Message was edited by:
    CTS

  • How to format the text in an XML file

    This should be a fairly easy one. A fairly easy one that seems to be hard to actually find.
    When I write out the XML file, it's all on a single line. Not a huge problem all things considered (it works), but an annoying one.
    Here's the a snippet, to show what I'm doing. There's not enough information for this to actually compile, if one is so inclined, just comment out a bunch of things and have it write out aribitary data.
    Is this a case where I just need to manually write the formating myself?
    public void saveXML(File file){
            try{
                Document doc = DocumentBuilderFactory.newInstance().
                    newDocumentBuilder().newDocument();
                //give that document a root
                Element root = doc.createElement("root");
                doc.appendChild(root);
                Command[] command=getCommands();
                for (int index=0; index < command.length; index++){
                    Element element = doc.createElement("Command");
                    root.appendChild(element);
                    //get the name of the parser class this command should use
                    String pName=command[index].getParser().getClass().getName();
                    //remove everything but the last word
                    pName=pName.substring(JavaMUServer.PARSER_PATH.length());
                    //set the information.
                    element.setAttribute("name",
                        command[index].getName());               
                    element.setAttribute("parser",pName);               
                    element.setAttribute("method",
                        command[index].getMethod().getName());
                TransformerFactory tFactory =TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(doc);
                StreamResult result = new StreamResult(
                    new FileWriter(file));
                transformer.transform(source, result);
            }catch (Exception e){
                e.printStackTrace();
        }

    Well, that helped quite a bit. Seems however when I set the indent property, rather then indenting it just makes new lines. Rather counter intuitive.
    Here's the slightly modified code (changed one line really. Tried setting a few different properties.)
    public void saveXML(File file){
            try{
                Document doc = DocumentBuilderFactory.newInstance().
                    newDocumentBuilder().newDocument();
                //give that document a root
                Element root = doc.createElement("root");
                doc.appendChild(root);
                Command[] command=getCommands();
                for (int index=0; index < command.length; index++){
                    Element element = doc.createElement("Command");
                    root.appendChild(element);
                    element.appendChild(doc.createElement("sample"));
                    //get the name of the parser class this command should use
                    String pName=command[index].getParser().getClass().getName();
                    //remove everything but the last word
                    pName=pName.substring(JavaMUServer.PARSER_PATH.length());
                    //set the information.
                    element.setAttribute("name",
                        command[index].getName());               
                    element.setAttribute("parser",pName);               
                    element.setAttribute("method",
                        command[index].getMethod().getName());
                TransformerFactory tFactory =TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                transformer.setOutputProperty("indent", "yes");
                //transformer.setOutputProperty("method", "xml");
                DOMSource source = new DOMSource(doc);
                StreamResult result = new StreamResult(
                    new FileWriter(file));
                transformer.transform(source, result);
            }catch (Exception e){
                e.printStackTrace();

Maybe you are looking for

  • Something went wrong while downloading your template

    We have Office 2013 installed on Windows 7 Enterprise 64 Bit. When trying to download templates from Word, we get the message Something went wrong while downloading your template. We have confirmed it's not the firewall blocking the download. We have

  • Cannot burn DVD...

    Hi, for the last several weeks, my iMac G5 (iSight) does not burn DVDs. I did a little research and found iMac is very picky with DVD media. Recently I quit using Toast and changed to us Finder to burn DVD. Then an error code 536870198 appeared and c

  • "Error 0001: Fatal Internal Error" in System Generator

    Hi, I get the following error when I try to import data using the model explorer in Simulink. --------------------------------- Version Log ---------------------------------- Version                                 Path System Generator 10.1.1134    

  • Photos stacked in Aperture fully revealed in Photos app on iPad

    After syncing a few albums created in Aperture 3.0.3 with my iPad, I notice that all photos contained in each stack appear in the Photos app. Naturally, I'd like only the primary photo in the stack to be visible in the Photos app. Interestingly, thes

  • NAS NSS 326 Reset Issue.

    Hi peeps Have a little issue with a Cisco NAS NSS 326 Smart Storage 6 bay - with RAID 5 over 6 disks. Apparently there were some funny business with the performance with the device so someone reset the device from the button on the back. I've been as