Fixed column length in excel sheet thru abap program

HI Experts ,
I am sending 2 excel attachments from abap program to external email Id's  .
Excel attachments are successfully sending but the columns in the excel attachmet are compressed .
I want to fix some width for excel columns .
Please provide your help and suggest .
Thanks,
Nusrat

Hi All  ,
Thanks for the reply ,..
I am using below function module to send a mail with excel attachment , I would like to use the same code instead of OLE  .. Could you please let me know how to modify the column lenght using this module  .
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            sender_address             = 'Traking System'
            sender_address_type        = 'INT'
            commit_work                = 'X'
       IMPORTING
            sent_to_all                = gd_sent_all
       TABLES
            packing_list               = it_packing_list
            contents_bin               = it_attachment
            contents_txt               = it_message
            receivers                  = it_receivers
       EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
Thanks ,
Nusrat

Similar Messages

  • Increase the column lengths of excel sheet through abap

    I developed a abap program and it was displayed the output.
      So i need to display this out put in excel sheet.
      for that I read the out put and placed in the excel,
    the only problem is the column lengths are small
    after download  i am dragging the each column,
    But i need to increase the each column by the program
       How can I ?
    I am using the following code
          lastline = new_line_c + 13.
          DO .
            READ LINE sy-index LINE VALUE INTO it_read-excel.
            APPEND it_read.
            IF sy-index > lastline.
              EXIT.
            ENDIF.
          ENDDO.
          lastline = new_line_c - 38.
          colm = ( length - 37 ) / 18.
          colm = colm + 4.
          FOR THE EXCEL CONVERTION
          INCLUDE ole2incl.
          DATA: w_cell1 TYPE ole2_object,
          w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
          DATA: h_excel TYPE ole2_object, " Excel object
          h_mapl TYPE ole2_object, " list of workbooks
          h_map TYPE ole2_object, " workbook
          h_zl TYPE ole2_object, " cell
          h_f TYPE ole2_object, " font
          gs_interior TYPE ole2_object, " Pattern
          worksheet TYPE ole2_object,
          h_cell TYPE ole2_object,
          h_merge TYPE ole2_object,
          h_cell1 TYPE ole2_object,
          range TYPE ole2_object,
          h_sheet2 TYPE ole2_object,
          h_sheet3 TYPE ole2_object,
          gs_font TYPE ole2_object,
          flg_stop(1) TYPE c.
    *DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
          TYPES: data1(1500) TYPE c,
          ty TYPE TABLE OF data1.
          DATA: it TYPE ty WITH HEADER LINE,
          it_2 TYPE ty WITH HEADER LINE,
          it_3 TYPE ty WITH HEADER LINE,
          rec TYPE sy-tfill,
          deli(1) TYPE c,
          l_amt(18) TYPE c.
          DATA: BEGIN OF hex,
          tab TYPE x,
          END OF hex.
          FIELD-SYMBOLS: <fs> .
          CONSTANTS cns_09(2) TYPE n VALUE 09.
          ASSIGN deli TO <fs> TYPE 'X'.
          hex-tab = cns_09.
          <fs> = hex-tab.
          DATA gv_sheet_name(20) TYPE c .
    M A C R O Declaration
          DEFINE ole_check_error.
            if &1 ne 0.
              message e001(zz) with &1.
              exit.
            endif.
          END-OF-DEFINITION.
          DATA: xy TYPE i,
                xz TYPE i,
                yz TYPE i,
                ab TYPE i,
                pterm TYPE i.
          IF h_excel-header = space OR h_excel-handle = -1.
    start Excel
            CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
          ENDIF.
    PERFORM err_hdl.
    *--- get list of workbooks, initially empty
          CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    PERFORM err_hdl.
          SET PROPERTY OF h_excel 'Visible' = 1.
    add a new workbook
          CALL METHOD OF h_mapl 'Add' = h_map.
    PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
          gv_sheet_name = 'Price Comparison List'.
          GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
          SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
          index1 = 3.
          LOOP AT it_read.
           heading
            IF sy-tabix < 4.
              it_item = it_read.
              IF  it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                IF sy-tabix = 1.
                  it_item+0(1) = deli.
                ENDIF.
                APPEND it_item.
              ENDIF.
            ENDIF.
           headear data and item
            IF sy-tabix > 4 AND sy-tabix < descline1.
              it_item = it_read.
              IF it_item CS '----'.
              ELSE.
                REPLACE ALL OCCURRENCES OF sy-vline IN it_item WITH deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
            xy = 2.
            xz = 38.
           discount etc
            IF sy-tabix >= descline1 AND sy-tabix < descline.
              it_item = it_read.
              it_item+12(1) = deli.
              it_item+22(1) = deli.
              it_item+43(1) = deli.
              WHILE xy < colm.
                xz = xz + 18.
                it_item+xz(1) = deli.
                xy = xy + 1.
              ENDWHILE.
              APPEND it_item.
            ENDIF.
          payment terms
            xy = 2.
            xz = 37.
            pterm = descline + 6.
            IF sy-tabix > descline AND sy-tabix < pterm.
              it_item = it_read.
              IF it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                it_item+12(1) = deli.
                it_item+15(1) = deli.
                it_item+36(1) = deli.
                WHILE xy < colm.
                  xz = xz + 17.
                  it_item+xz(1) = deli.
                  xy = xy + 1.
                ENDWHILE.
                APPEND it_item.
              ENDIF.
            ENDIF.
         prepared by
            lastline = pterm + 3.
            IF sy-tabix >= pterm AND sy-tabix <= lastline.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+16(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
           remaarks
            yz = lastline + 10.
            IF sy-tabix > lastline AND sy-tabix <= yz.
              it_item = it_read.
              it_item+0(1) = deli.
              it_item+54(1) = ' '.
              APPEND it_item.
            ENDIF.
      approved by
            ab = yz + 5.
            IF sy-tabix > yz AND sy-tabix < ab.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+14(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
          ENDLOOP.
    *--Formatting the area of additional data 1 and doing the BOLD
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the second row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 2
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fourth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 4
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fifth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 5
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the sixth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 6
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
          DATA l_rc TYPE i.
          CALL METHOD cl_gui_frontend_services=>clipboard_export
            IMPORTING
              data                 = it_item[]
            CHANGING
              rc                   = l_rc
            EXCEPTIONS
              cntl_error           = 1
              error_no_gui         = 2
              not_supported_by_gui = 3
              OTHERS               = 4.
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = 1.
    PERFORM err_hdl.
          CALL METHOD OF h_excel 'Range' = range
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
          CALL METHOD OF range 'Select'.
    PERFORM err_hdl.
          CALL METHOD OF worksheet 'Paste'.
    PERFORM err_hdl.
    CALL METHOD OF h_excel 'QUIT'.
          FREE OBJECT h_zl.
          FREE OBJECT h_mapl.
          FREE OBJECT h_map.
          FREE OBJECT h_excel.

    Hello Ravi,
    Thank you very much for your suggestions.. but still have some more doubts:
    What i want to do is :
    -->call report in background job with a selection criteria.
    -->the output of the report should be trasnsfered to excel sheet
    -->then the excel sheet should be sent to XI..
    My doubts are:
    -> is it possible with every report or we need some extra code to achieve this
    -> If yes, then how exactly it should be done. can you please explain in more detail.
    Thank you very much for your help.
    Best Regards,
    Jasmeet

  • Problem while exporting ALV column header to excel sheet.

    Hi,
    I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
    For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
    How can I view the entire column header text?
    Kindly assist.
    Thanks.

    I have the same problem with you, when user export to excel. I fixed it by using
    w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
    perform generate_fcat_reftab
        using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
    form generate_fcat_reftab  using    p_fieldname
                                        p_tabname
                                        p_ref_tabname
                                        p_ref_fieldname
                                        p_output_text
                                        p_output_lenght.
      clear w_fcat.
      w_fcat-fieldname = p_fieldname.
      w_fcat-tabname   = p_tabname.
      w_fcat-ref_fieldname = p_ref_fieldname.
      w_fcat-ref_tabname = p_ref_tabname.
      w_fcat-seltext_s = p_output_text.
      w_fcat-seltext_m = p_output_text.
      w_fcat-seltext_l = p_output_text.
      w_fcat-outputlen = p_output_lenght.
      w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
      append w_fcat to t_fcat.
    endform.

  • How do I get the last COLUMN in an Excel Sheet using Report Generation toolkit in LV7.1?

    I am trying to get the last column in an Excel sheet using the Report Generation toolkit. The function "Excel Get Last Row" does not give last column info. Is there a function that will do this?
    Thanks

    Hello –
    I think the following example program might be helpful to get you started programming your application.
    Get Excel Data from Specified Field.
    Hope this helps!
    SVences
    Applications Engineer
    National Instruments

  • Unknown column in the excel sheet created using Export to Excel

    Hi,
    I created an excelsheet for the table data using the below link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%
    20Binary%20Cache.pdf
    but problem here is when i open the excel sheet it is having some unknown columns apart from the expected like amount/#agg next to the actual column amount and it is happening only for the cloumns which have some numbers.
    I dont know where these columns are coming from.
    Send me the solution and points will be rewarded for the helpful answers.
    I want to put some name to the excel file instead of using system created file name.for this requirement where do i need to change the code

    Hi,
    You can export to excel even not relating with any libraries
    Follow this way..
    Take one singleDimensional array, arrColNames[], and one Two dimensional array, arrValues[][].
    File f=new File("Sample.xls);
    FileOutputStream fos=new FileOutputStream(f);
    for(int i=0;i<arrColNames.length;i++)
    fos.write(arrLabels<i>.getBytes());
    fos.write("\t".getBytes());
    fos.write("\n".getBytes());
    for(int j=0;j<noOfRows;j++)
    String arr[]=arrValues[j];
    for(int a=0;a<arr.length;a++)
    if(arr[a]!=null)
         fos.write(arr[a].getBytes());
        fos.write("\t".getBytes());
    fos.write("\n".getBytes());
    fos.flush();
    fos.close();
    The exported excelFile will be stored in your server. If you want to open it using FileDownLoad UI Element,
    Create value attributes resource of type Resource, behaviour of type FileDownLoadBehaviour, reso of type String, fileName of type String , Then then append this code
    FileInputStream fis=new FileInputStream(f);
    FileChannel fc=fis.getChannel();
    byte data[]=new byte[(int)fc.size()];
    ByteBuffer bb=ByteBuffer.wrap(data);
    fc.read(bb);
    fis.close();
    IWDCachedWebResource objCachedWebresource=null;
    if(data!=null)
    objCachedWebresource=WDWebResource.getWebResource
    (data,WDWebResourceType.XLS);
    objCachedWebresource.setResourceName(f.getName());
    wdContext.currentContextElement().setFileName(f.getName());
    wdContext.currentContextElement().setResource(objCachedWebresource);
    wdContext.currentContextElement().setReso(objCachedWebresource.getAbsoluteURL());
    wdContext.currentContextElement().setBehaviour(WDFileDownloadBehaviour.ALLOW_SAVE);
    Regards
    LN

  • Need help in writing NVARCHAR2 column to an excel sheet

    Hi All,
    I have a NVARCHAR2 column in my table. I want to store the data present in the column into an excel file. When i write the data to an excel file the data is getting converted to some other form. It's not in human readable form.
    Language is not fixed for the column.
    I need help in storing the NVARCHAR2 data into an excel file without any implicit conversion done by the oracle.
    Please help.
    Thanks,
    Girish G
    Edited by: Girish G on Jul 14, 2011 2:02 AM

    Export data to BLOB (csv)

  • How to create the sales order using excell sheet thru BAPI's?

    Hi Guru's,
    In my excell sheet i had 11 sales order details ..now i wanted to create the sales order's sing BAPI's...?
    could please guide me step by step.....that would be greatly helpfull to me...
    Thanks in advance
    Srinivas....

    Hi,
    follow below steps.
    1. Get the excel data into internal table,  Build a internal table whcih fields are in bapi same order
    2. call the Bapi and pass the table data to the bapi
    3. after calling the  bapi,  call the commit bapi.
        then only it will careates.
    Regards
    Ganesh

  • How to create a job thru ABAP program for calling a program with variant???

    Hello experts,
    can u give me step wise procedure to create jobs for  a program with a variant name thru ABAP???
    Also, can a transaction can be scheduled as a job to run in background with a variant name???
    Edited by: SAP USER on Jul 22, 2008 6:08 AM

    Hi,
    To create a job through ABAP program you can do the following.
    Go to Menu bar.
    In there, go to   SYTSTEM> SERVICES> JOBS--> DEFINE JOB.
    Then give the JOB NAME and CLASS in the screen that comes up.
    This is how we schedule a program.
    Now, to create a variant for a program -
    First activate your program in SE38. Then execute it .
    Now, click on SAVE button. It will open up  the variant creation screen. Give the details there like variant name and value for the fields. Save and come back.
    Hope this helps.
    Regards,
    Hari Kiran

  • How to uplaod multiple excel sheets in a program

    Hi gurus,
    Can anyone suggest me
    how to upload multiple excel sheets in program.( not in OOPS)
    my excel sheets has 5 sheets like sheet1, sheet2, sheet3 ....like this..
    Thanks & Regards
    kalyan.

    swc_container it_event_container.                       
    swc_create_container it_event_container.                 
    CALL FUNCTION 'SWW_WI_CONTAINER_READ'
                EXPORTING
                  wi_id                    = wd_id
                TABLES
                  wi_container             = it_event_container
                EXCEPTIONS
                  container_does_not_exist = 1
                  read_failed              = 2
                  OTHERS                   = 3.
    if sy-subrc = 0.
    READ TABLE it_event_container WITH KEY element = 'name of your workflow container element'.
                IF sy-subrc = 0.
                  w_variable= it_event_container-value.
                ENDIF.
    endif.
    Regards
    Kedar

  • Fixed column width in Excel output

    Hi,
    Can we fix a column width when we are viewing the report output in excel? Can we do that in RTF template?
    If the column name is too long, it is automatically inreasing width of the column...But I need the column to be of a fixed width.

    You should try Excel templates instead of RTF templates. This is the best method to control Excel output formatting like column width.did you try excel template ?
    for example for 3 nested group?
    from Re: Can XDODTEXE produce BI Publisher output?
    i tested true excel template on ebs r12.1.2 and it works only for one group and for two group the result awful it duplicate and mix data
    IMHO true excel template very limited yet

  • Columns repeating in excel sheet

    Hi guys,
    I am trying to download context data into excel file using WD binary cache. I am using Office 2003 suite for this case. The text data is getting downloaded properly but all numeric data (though there actual data type is string) is getting repeated in adjacent column with "agg" getting concatenated in the column heading. can somebody help me out.
    Thanks,

    Hi
    Are you sure that the contents of the cell in Excel are actually in the expoential format?  Look in the formula bar at the top - does this display the 12 digit number or does it display the expoential text?
    Excel will display any number with more than 11 digits as and exponent when the cell format is General.  To force it to display the full number do the following:
    1. Select the cell or range of cells this applies to
    2. From the menubar select Format | Cells
    3. Change the category from General to Number
    4. Select the other fomratting options such as decimal places, seperators etc and click OK.
    Please note that your columns will need to be wide enough to display the 12 digits otherwise Excel will just display a series of '#' characters.
    As a general rule of thumb in Excel, what you see in a cell is the formatted version of the cell contents and not necessarily what the cell actually holds.
    Hope this helps
    Andy

  • How to call method excel subtotal in ABAP program

    I'm trying to call excel method subtotal, but i get an error (sy-subrc <> 0). How to correctly call this method? One of the parameters is an array. I've tried to use an internal table as the array, but ABAP syntax checker shows error.

    Hi Vytautas,
    The best way is to start recording a Macro(Tools->Macro->Record New Macro), and then do the operations (like entering data into cells, summing up, calculations,etc...)
    once you are done, display the macro and you will find all the needful information regarding what metohds are to be called and how...
    Regards,
    Raj

  • Export data to Excel through a ABAP program run in batch mode

    Dear Experts,
      The requirement is that a ABAP report should run through background job, which will do the followiing :
       1) Collect data from predifined CRM tables ( Activity , Order for example ).
       2) Create a Excel file in a Application Server ( physical file server location ) location.
       3) Push the data collected in the step 1 to the Excel file.
       I have found 2 function modules which does the export to Excel after creating the Excel file. They are :
        a) XXL_FULL_API
        b) MS_EXCEL_OLE_STANDARD_DAT
       But it seems that the ABAP report needs to run in the foreground ( correct me if i am wrong ) in order to create the Excel file.
       Please can anyone suggest a possible ABAP code to achieve OR how to use these FMs in background mode ?
      The excel creation needs to be automated and send to a administrator email id every day, so the need of exporting the data in background mode arises.
    Thanks and regards,
    Sudipta

    hi,
    In SM36, you can create a job(give your report prog name)..
    call the fun. module by storing all the values into final int. table it_data.
    but u need to open one excel file in your desktop...
      v_file = 'C:\file.xls'.  " path should be like this...
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'xls'
      has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      read_by_line                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      = it_data
    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.
    regards
    vijay

  • FTP thru ABAP program

    Hello ABAP Gurus,
    Kindly attached an example program for FTP process in ABAP...
    i have this project wherein i need to gather data from SAP and transfer it to
    an another server box for another applicaiton....
    Thank you in advance.

    Hi Friend,
    Check this link for code:
    http://abap-gallery.blogspot.com/2007/07/ftp.html
    Check this link:
    http://abapshare.wordpress.com/2008/07/23/connecting-to-ftp-server-using-abap/
    Regards,
    Chandra Sekhar

  • Problem with GUI_UPLOAD using excel sheet

    Hi,
      I am trying to upload excel sheet thru GUI_UPLOAD ... this excel sheet has a header line and 3 line of data. Even if I remove the header line then also the internal while debugging is showing 28 lines of entries with "#" "squares" in some columns ... while in others where data should be there shows all Zeros....
    The excel sheet has the following info
    Rate Type Valid From Date     From Currency     To Currency      Indirect Quote     Direct Quote
    M       29.09.2006             SGD             USD             1.6932     
    M       29.09.2006             USD             SGD                          1.6932
    M       29.09.2006             SGD             MYR                          2.19653
    KURST GDATU    FCURR TCURR INUKURS     DUKURS
    ###&#2161; |########|#####|### #|   0.00000 |0.00000 |
    ##29 |00000000|     |     |   0.00000 |0.00000 |
    o#d# |00000000|     |     |   0.00000 |0.00000 |
    The code that I am writing is as follows:-
    *& INTERNAL TABLES
    DATA : BEGIN OF T_INPUT occurs 0,
             KURST   LIKE TCURV-KURST,  " Exchange rate type
             GDATU   LIKE SY-DATUM,     " Date from which rate is effective
             FCURR   LIKE TCURC-WAERS,  " From currency
             TCURR   LIKE TCURC-WAERS,  " To currency
             INUKURS LIKE TCURR-UKURS,  " Indirect Quote
             DUKURS  LIKE TCURR-UKURS,  " Direct Quote
           END OF T_INPUT.
                S T A R T - O F - S E L E C T I O N                      *
    START-OF-SELECTION.
    Perform to upload the excel file.
      PERFORM UPLOAD_EXCEL_FILE.
    FORM UPLOAD_EXCEL_FILE .
      DATA: L_FILENM TYPE STRING.
      L_FILENM = P_FILENM.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = L_FILENM
          FILETYPE                      = 'ASC'
          HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = T_INPUT
       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.

    Hi SB,
    pls change the data type declared for 'valid from date'
    from
    DATA : BEGIN OF T_INPUT occurs 0,
    KURST LIKE TCURV-KURST, " Exchange rate type
    <b>GDATU LIKE SY-DATUM,</b> " Date from which rate is effective
    FCURR LIKE TCURC-WAERS, " From currency
    TCURR LIKE TCURC-WAERS, " To currency
    INUKURS LIKE TCURR-UKURS, " Indirect Quote
    DUKURS LIKE TCURR-UKURS, " Direct Quote
    END OF T_INPUT.
    to
    DATA : BEGIN OF T_INPUT occurs 0,
    KURST LIKE TCURV-KURST, " Exchange rate type
    GDATU(10) type c, " Date from which rate is effective
    FCURR LIKE TCURC-WAERS, " From currency
    TCURR LIKE TCURC-WAERS, " To currency
    INUKURS LIKE TCURR-UKURS, " Indirect Quote
    DUKURS LIKE TCURR-UKURS, " Direct Quote
    END OF T_INPUT.
    Cheers,
    Vikram
    Please reward for helpful replies!!

Maybe you are looking for

  • Flicker free page updates with JSF?

    My JSF app is running but there's flicker when I click the update button to get my search results. I basically forward my page to its self in the faces config file, so I figured this would happen. <navigation-rule>    <from-view-id>/Inputname.jsp</fr

  • Current time in microseconds

    For one of my programs i want to find the current time in microseconds. How do i get this in Java?

  • I updated to 1.1.3 - Why can't I use any of the new features?

    Hey, I just got my ipod touch 8 gig. It came with 1.1.2 on it so I updated. Now when I go to settings and about, it says it's 1.1.3 as well... However I cant add clips to my home screen (when I press + all I see is add bookmark), and I also can't re

  • KE26 Copy between systems

    Hi, We have HR and FI in two different systems. We need to copy activity types pricing entered in transaction KE26 from one system to the other, in a periodic basis, to have the prices syncronized. The transaction will only be maintained in one syste

  • Please find this query very urgent

    Query-->select value from mytable where value is not null      union all select value from mytable where value is null Ex: table name::mytable In this table i have one column called 'value' and this column values shold be like this 12 null 13 null 11