Date conversion from Excel to the SAP format

Hi,
I have created a BDC program which uploads daat from Excel sheet.
There is a date field also, the format of which can be any as per the end user (it will be one of those allowed by SAP).
However, the file will be used for execution by another user who may have a date setting which is different than that from the one in Excel.
Eg. End User's date format: DD.MM.YYYY, SAP User's date format: MM/DD/YYYY
So, how do I convert the date format from excel to the format which will be accepted by the transaction during the recording?
Regards,
Dave

Hi Dave,
I have faced the same issue while uploading the date to the bdc.
if ur date format is DD.MM.YYYY in the excel file, first of all you need to change this to dats format ie YYYYMMDD ie character8 format and pass to the bdc, it will automatically convert to sap format
ie you need to convert splitting at .
data lv_date type char10,
        lv_dd type char02,
        lv_mm type char02,
       lv_yyyy type char04,
v_date type char08.
lv_date = '30.12.2011'.
split lv_date at '.' into lv_dd lv_mm lv_yyyy.
if strlen(lv_dd) lt 2.
   concatenate '0' lv_dd into lv_dd.
endif.
if strlen(lv_mm) lt 2.
   concatenate '0' lv_mm into lv_mm.
endif.
concatenate lv_yyyy lv_mm lv_dd into v_date.
"Please use the variable V_DATE to populate to ur bdc"
Edited by: Rahul Babukuttan on Aug 11, 2011 5:35 PM

Similar Messages

  • Upload data from excel (not the excle file) into SAP

    Guys,
    how can we upload data from excel sheet into SAP? I mean just the data not the entire file,
    I have a requirement where user press a button in excel sheet and the data in the sheet will get uploaded into SAP.
    I am sure we have to use BAPI and some VB programming for macros, I will really appriciate if anyone can help how to achive this.
    some sample code exampe will help.
    Cheers!

    I think u r writing BDC for Uploading the data from excel flile to sap. for this is the code I am sending u can use then for Uploading data from excel to sap.
    DATA: lv_filename TYPE rlgrap-filename.
    FIELD-SYMBOLS : <fs>.
    DATA : l_intern TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA : l_index TYPE i.
    PARAMETERS : startcol TYPE i ,
          startrow TYPE i ,
          endcol TYPE i ,
          endrow TYPE i .
    PARAMETERS: p_flnam LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_flnam.
      CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       program_name        = sy-repid
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_flnam .
      MOVE p_flnam TO lv_filename.
    Uploading the flat file from the desktop
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                      = lv_filename
          i_begin_col                   = startcol
          i_begin_row                   = startrow
          i_end_col                     = endcol
          i_end_row                     = endrow
        TABLES
          intern                        = l_intern
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      SORT l_intern BY row col.
      LOOP AT l_intern.
        MOVE l_intern-col TO l_index.
        ASSIGN COMPONENT l_index OF STRUCTURE itab TO <fs>.
        MOVE l_intern-value TO <fs>.
        AT END OF row.
          APPEND itab.
          CLEAR itab.
        ENDAT.
      ENDLOOP.
    I hope it will help u.
    Regards
    Nayan

  • Upload data from Excel to the Planning Book

    We are on APO 5.1. We have APO DP at the moment. I wanted to test upload of data from Excel to the planning book. I have tried several times. I have been unable to see any changed data in the planning. I do not get ANY errors during the upload. But I cannot see any changes that I made in the excel in the planning book. Please let me know what I am doing wrong. These are the step that I follow.
    1. Go to planning book.
    2. Short list only one key figure e.g Customer Forecast.
    3. Go into Details All mode.
    4. Download the file using the "Prepare File for Upload" option.
    5. Open the saved Excel.
    6. Change the values in the excel , save and close.
    7. Upload the excel into the planning book using the upload file option.
    I do not get any errors during all these steps. However, when I check to see if the values have been updated, the changes made in the excel are not updated in the planning book.

    Hello,
    Instead of selecting one key figure in data view, please select all key figures of the planning book and then try all the steps which you have carried out.
    please revert after you carry out this.
    Regards,
    Prafulla

  • Uploading data from Excel sheet into SAP.

    Dear All,
    I want to upload data existing in Excel sheet into SAP. Is there any possibility with the following requirements?
    1) Excel file contains serial numbers with different values.Like power(230Wp),Voc,Isc,Vmp and Imp.
    2) We need to upload the same data into SAP with validations.
    3) Validations are like no serial number should be repeated.
    4) And depending on the Power value, the serial number should be assigned to different batches.Eg:The batches are as follows:
         201 - 210
         210 - 220
         220 - 230
       and if the Pmax of the serial number is 205.It should be assigned to batch 201 - 210 .
    5) At present we are using MB31 to post the serial numbers which are existing in the flat file.
    Thanks and Regards,
    Varun Siddharth

    Hi,
    Refer to the following code:
    DATA: lv_filetype(10) TYPE c,
            lv_gui_sep TYPE c,
            lv_file_name TYPE string.
      lv_filetype = 'ASC'.
      lv_gui_sep = 'X'.
      lv_file_name = pa_dfile.
    FM call to upload file
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lv_filetype
          has_field_separator     = lv_gui_sep
        TABLES
          data_tab                = gi_zhralcon_file
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    The excel file must be a tab delimited file.
    Hope it helps.
    Regards,
    Rajesh Kumar

  • Error Message in Data IMport from Excel

    Hi All
    Please can you help - I am trying to import some BP data using the option in the menu Administration - Data Import/Export - Data Import from Excel.
    I have created my import file as a text file and provided the relevant mappings. Having located my text file, I then get the following error message:
    Row Number 1:Internal error (-2007) occurred.
    Has anyone got any ideas as to what this means I've done wrong?
    Thanks

    Dear, 
    Kindly refer to note 1296487 below:
    Symptom
    In attempt to import a Business Partner from an Excel file to SAP
    Business One, the following error messages are displayed and the
    Business Partner is not imported:
        o  When there are no House Banks in the company, the following error
           messages are displayed:
        Row Number 1: Internal error 'House Bank Accounts' occurred,
    and,0 Records imported successfully.
         o  When there are no Payment Methods in the company, the following
            error messages are displayed:
         Internal error 'Payment Methods for Payment Wizard' (OPYM)
    (-2007) occurred, and, 0 Records imported successfully.
         o  When Payment Methods and House Bank are defined in the company,
            the following error messages are displayed:
         Row Number 1: Internal error (-2007) occurred, and,
         0 Records imported successfully.
    Other terms
    DB, export, BP
    Reason and Prerequisites
    Application error
    Solution
    SAP intends to provide patches in order to solve described problem.
    The section Reference to related Notes below will list the specific
    Patches when available.
    The corresponding Info file of Patches on SAP Service Marketplace will
    show the correction / SAP Note number also.
    Be aware that these references can only be set at Patch release date.
    SAP will deliver Patches only for selected Releases at its own
    discretion, based on the business impact and the complexity of the
    implementation.
    If it is your case, We would like to inform you that we plan to fix the problem you raised,
    in patch 05 for SAP Business One 2007 A FP01 / SP01 Release.
    For SAP Business One Patch Delivery Schedule please look at:
    http://service.sap.com/smb/sbo/patches
    Best regards,
    Apple

  • Page numbers incorrect after conversion from Excel to pdf

    Page numbers incorrect after conversion from Excel to pdf
    ""This above link (thread:834599) is from a case back in 2011 that claims to solve this problem, but it does not solve this problem. I think that customer only cared about having continuous page numbering, not discrete page numbering per sheet.
    ========================
    I still have this issue in Acrobat XI and MS Office Professional Plus 2010. I keep upgrading to no avail. This regression has resulted in a huge time drain for me. If you fixed it, please explain how I can get my hands on the resolution.
    Previous versions of Excel and Adobe Acrobat enabled flexibility around the "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) token, depending on context and usage. The "# of pages" token could represent EITHER the number of pages in the workbook OR the number of pages in the tab/sheet, depending on how you generated the PDF:
    You could select "Selected Sheets" and then select all or some of the individual sheets in the workbook, and the PDF would honor the discrete numbering of each of the sheets, so the first page of each sheet was p1 and the "# of pages" was the number of pages in the sheet; not the number of pages in the workbook; or
    You could select "Entire Workbook" and the PDF would honor continuous page numbers across all sheets, as a single document.
    Now, it only honors the total number of pages in the workbook, regardless of the method you use to publish to PDF: saving as PDF, printing to PDF, using "createPDF" from Acrobat plugin to Excel's menu ribbon; selecting all sheets, some sheets, or Entire Workbook; automatic First page number or "1" under Page Setup > Page> First page number. (This last option, btw, does restart every sheet at p1, but it hardly makes sense if the total number of pages is still the total number in the workbook instead of the number in the sheet.)
    I spent a lot of time trying each which way that the blog posts recommended and have tried this on multiple versions of Excel and Acrobat now.
    NONE of these time-consuming experiments gave me what I wanted.They all insist that "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) is the total number of pages in the workbook or the total number of pages in the selected sheets combined.
    The numbering are correct in Excel Page Layout.
    The same issue happens when using LibreOffice calc. (Although, I never tested with Libre Office before, so I don't know that it ever worked).
    The workaround now is to create PDF for each spreadsheet one at a time, and then compile them using the Acrobat combine/binder feature. All alternatives are extremely time consuming and tedious. It used to be automatic. This is a major regression that has gone untreated for over a year now, maybe two years.
    My task takes infinitely more time to complete than it did with previous versions of Acrobat. That means that days are added to my project, when the functionality used to enable a quick pdf generation that was ready for review, now I have to do this very manual time-consuming set of steps to generate a draft. As the project has grown and more tabs are added, my pdf-generation task takes that much longer. We require lots of drafts. It used to be easy and fast. Now it is hard and time-consuming.
    In my opinion, the problem is not Excel; it is Acrobat because it was introduced with an upgrade in Acrobat, not an upgrade in Excel. The problem was introduced in Acrobat 9 or 10. Please provide a patch or add-on or something.

    If you are setting up the page numbers in Excel, the resulting PDF would display the the page numbers created in Excel. On Excel 2010 support page, (http://office.microsoft.com/en-us/excel-help/insert-and-remove-page-numbers-on-worksheets- HA010342619.aspx#BM2) is stated the following "tip" which indicates by default Excel 2010 starts numbering each tab with 1. Exel's workaround tip is below - 
    Set a different number for the starting page
    Tip   To number all of the worksheet pages in a workbook sequentially, first add page numbers to all worksheets in a workbook, and then use the following procedure to begin the page number for each worksheet with the appropriate number. For example, if your workbook contains two worksheets that with both be printed as two pages, you would use this procedure to begin the page numbering for the second worksheet with the number 3.
    On the Page Layout tab, in the Page Setup group, click the Dialog Box Launcher next to Page Setup.
    On the Page tab, in the First page number box, type the number that you want to use for the first page.
    Tip   To use the default numbering system, type Auto in the First page number box.
    Also helpful in the same section is the note on viewing page numbers. To see if the page numbering dilemma originates in Excel make sure you are using the Page Layout View see below:
    Hide All
    If you want numbers shown on pages when you print a worksheet  you can insert page numbers in the headers or footers of the worksheet pages. Page numbers that you insert are not displayed on the worksheet in Normal view — they are shown only in Page Layout view and on the printed pages.
    Overall it may be easier not to create the page numbers in Excel but instead create then in Acrobat using the Headers and Footers option in Acrobat.  I hope this helps - it sounds like a frustrating issue you are experiencing.

  • Can I recover my data information from excel file?

    For any reason I already lost (clear all) my data information, have any option where import the data information from excel file to view responses sheet? or , how, can I recover my data information?
    Antonio

    If you had saved your Excel file, then you may revert the Excel file to the last saved version. Follow below steps to do this:
    On the File tab, click Open.
    Double-click the name of the file that you have open in Excel.
    Click Yes to reopen the Excel file.
    If you had not saved Excel file, then follow below steps to recover your file.
    Click the File tab.
    Click Recent.
    Click Recover Unsaved Workbooks.

  • Data Extraction from MS-BI to SAP-BI

    Hi All,
    We have a requirement for data extraction from MS-BI to SAP-BI. In MS-BI cube they have same fact table and dimension table. This fact table is linked with dimension key. I want to know how to extract the data from the MS-BI cube to SAP-BI.
    Can we go with DB connect or Info spoke. Which will be the best option?? Let me know the steps also.
    And also how to find out the dimension table in SAP-BI cube??
    Pls let me know.
    Regards
    Sathiya

    Hi,
    a few years ago I used the DB-connect to extract data from siebel. Nowadays I think you can easily use UD-connect.
    regards
    Siggi

  • How do i do data conversion from 11.0.3 to 11.5.10?

    Hi to all,
    If any body have any approach how to do data conversion from 11.0.3 to 11.5.10 release?
    Thanx in Advance

    ajones2 wrote:
    I got the update to work but there seems to be one thing that does not work
    I'm anxious to install 4.5 as well because I understand the music player features a sound equalizer, but I believe it's not prudent to get it from somewhere other than your carrier.  I could be wrong, but I think that each carrier tweaks the OS in some fashion...
    Does your 4.5 have the sound equalizer ?
    George from Bedford, TX
    8120 on T-Mobile with BB Unlimited Email+Internet but
    without the BlackBerry Enterprise service

  • Is it possible to download and read books from Waterstones in the ebook format on iPad. If so how? Is there any need to download an app? Thanks

    Is it possible to download and read books from Waterstones in the ebook format on iPad. If so how? Is there any need to download an app? Thanks

    People who sell ebooks normally tell you what you need to read them, e.g.
    http://www.waterstones.com/waterstonesweb/pages/help-ebook-faqs/200001173/

  • Where does the data come from which powers the ship date and delivery date

    Hi All,
    Please let me know, where does the data come from which powers the ship date and delivery date?.
    Adi.

    Hi,
    DELIVERY DATE  will be maintain in the SALES DOCUMENT TYPES in VOV8 in the tab REQUESTED DELIVERY DATE/PRICING DAE/PURCHASE ORDER DATE.
    The field is PROPOSE DELIVERY DATE .
    If you check the field then the document created date will be the Requested date and will be carried from ORDER TO DELIVERY.
    If you want the delivery date other thann the CURRENT date then you have to maintain the LEAD TIME in days in the same tab.
    SHIP DATE: is the date on which you do the PGI in the delivery .
    Please check them and revert back if u need further details
    thanks,
    santosh

  • How to take the data from excel list to sap r/3(with time interval)

    hi experts,
       how to transfer the data from a third party system(if it is in format of excel) to sap r/3.with that in a particular time interval,it will delete the data from excel sheet.

    Hi
    use the Fm
    'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_path
                i_begin_col             = '1'
                i_begin_row             = '2'
                i_end_col               = '2'
                i_end_row               = '500'
          giving the starting row and column and passing the ending row and column name
    Reward points if useful........
    Regards,
    Nitin Sachdeva

  • Data upload from excel into SAP

    Hi Gurus
    Could anyone please guide me how to upload excel data into SAP?
    I need to update existing Gross weight and Net weight data. Got new data in excel format.So need to upload excel file straight into SAP and update the data.
    Step by step procedure will be much appreciated.
    Rgds
    Utpal

    try with bdc .....
    below coding is move the data from excel to internal table ....
    TYPES: BEGIN OF s_ovro,
              VKORG LIKE V_TVSFK-VKORG,
              VTWEG LIKE V_TVSFK-VTWEG,
              SPART LIKE V_TVSFK-SPART,
              STGKU LIKE V_TVSFK-STGKU,
              STGAK LIKE V_TVSFK-STGAK,
              STAFO LIKE V_TVSFK-STAFO,
           END OF s_ovro.
    DATA: I_OVRO TYPE TABLE OF s_ovro,
          w_ovro type s_ovro.
    data : request(15) type c,
            i type c.
    DATA : IT_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE.
    FIELD-SYMBOLS: <FS1> TYPE ANY.
    include bdcrecx1.
    SELECTION-SCREEN BEGIN OF BLOCK DATA WITH FRAME.
    PARAMETERS: P_FILE TYPE  RLGRAP-FILENAME DEFAULT 'C:\Documents and Settings\itfactory\Desktop\sd1.xls' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK DATA.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = 'P_FILE'
        IMPORTING
          FILE_NAME     = P_FILE.
    start-of-selection.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME                = P_FILE
          I_BEGIN_COL             = 1
          I_BEGIN_ROW             = 1
          I_END_COL               = 24
          I_END_ROW               = 60000
        TABLES
          INTERN                  = IT_EXCEL
        EXCEPTIONS
          INCONSISTENT_PARAMETERS = 1
          UPLOAD_OLE              = 2
          OTHERS                  = 3.
      LOOP AT IT_EXCEL.
        ASSIGN COMPONENT IT_EXCEL-COL OF STRUCTURE
        W_ovro TO <FS1>.
        <FS1> = IT_EXCEL-VALUE.
        AT END OF ROW.
         MOVE-CORRESPONDING: Wib TO Iib.
          APPEND w_ovro to I_ovro.
          CLEAR W_ovro.
        ENDAT.
      ENDLOOP.
    through bdc program update the data from internal table to bdc...

  • How to set first column as date (dd/mm/yyyy) in the specific format in excel

    hi need help wat i did need help is tht i need wen ever i send view a excel data  the first column set to date  but some times wen i view in different type of pc the date format change to mm/dd/yyyy. is  thr any way i can set the format?

    If you just need to reformat a correct date to show up as dd/mm/yyyy, just use the "Format Cells" command and set a custom format string to exactly that. If, on the other hand, you are finding that Excel just doesn't get that the first value is a DAY, not a month, such as trying to graph a temperature data logger that records data in dd/mm/yyyy:
    Reformat the strings as dd/mm/yyyy, using the first method. This will make them LOOK correct, even though the actual date VALUES are still day-month inverted. Now save the table as a .CSV file. This will save the dates as plain text in the correct order, which you can then re-import and have Excel now read the correct date value.
    Ryan R.
    R&D

  • How to store the data read from excel using java code in Ms access database

    Hi. I wrote a code to read the data from excel. May i know how can i save it to Ms access database using java. Also i have many excels. So i should not connect the database using DSN. So is there any other way to achieve this?

    kramish wrote:
    Im pretty sure that Access does support JDBCNo it does not. It supports ODBC.
    just doing a quick Google came up with some pages:
    http://blog.taragana.com/index.php/archive/access-microsoft-access-database-from-java-using-jdbc-odbc-bridge-sample-code/
    http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
    Both articles explains how to use the jdbc-odbc bridge. I think I've seen a pure jdbc driver for access but it wasn't from Microsoft and it wasn't free.
    Kaj

Maybe you are looking for

  • ITunes crashes when connected to 5th gen iPod, not other iPods

    iTunes 6.0.1 crashes EVERY time it starts up with the new 5th gen iPod. Works fine with other iPods, or no iPod at all. Reinstalled iTunes and restored to version 1.0 iPod form the 11-17-2005 iPod updater. Reset nvram, fixed disk permissions, reboote

  • How to disable some "columns to display"?

    Hello! I have one management pack (it's monitor some our network devices), which was written by contractors for our company. This mp have many unnecessary columns in it's view. I deleted some of these <ColumnInfo>  from mp (.xml file). Then I import

  • Using Firefox on a iMac OS-X; the settings used through Google labs in gmail, composing mail font settings don't work.

    I'm using 'DEFAULT TEXT STYLING" in Google LABS. Any setting you make here are not available in composing email. == URL of affected sites == http://mail.google.com/mail/?shva=1#settings/labs

  • Mail preference settings

    I have two computers both using OS X (10.4.11) and both usimg Mail 2.1.3(753.1). When I open a New Message blank on the G4 computer it comes up with a blank message form with the toolbar attached to the top of the message blank window just as I expec

  • FDM ERPI metadata mapping with EBS and Planning

    Hi, ERP integrator metadata mapping in its showing only Planning dimension names and EBS segments ,then mapping. suppose source(EBS) Account to Target(planning) Account,in this the EBS member codes and planning memeber codes are different , how can i