Manipulating excel file while using GUI_DOWNLOAD

hi all,
while using GUI_UPLOAD i want to
1) fix the width of the column of excel file
2) define the font of the data in excel file
3) change background color of the cells in excel file.
please suggest as to how can this be done?

using GUI_DOWNLOAD you can't change the data in excel sheet...if you want to do the things you need to use OLE concpets for downloading of data to Excel sheet wherein you can do most of the options excel can handle..
Check within SDN as there are blogs for downloading data to Excel sheet using OLE concepts..

Similar Messages

  • Need to include header in csv file while using GUI_DOWNLOAD

    Hi,
    Iam using GUI_DOWNLOAD for downloading certain texts,its working fine.now i need to include the header(i'e) some text say 'This is a error file'at the top.how can i do this?

    REPORT  ZTEST12347                              .
    DATA: BEGIN OF ITAB OCCURS 0,
            VBELN LIKE VBAK-VBELN,
            POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    SELECT VBELN
           POSNR
          FROM VBAP
          UP TO 20 ROWS
          INTO TABLE ITAB.
    DATA: IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE.
    IT_LINE-TDLINE = 'this is error file'.
    append it_line.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                = 'C:test.txt'
      TABLES
        DATA_TAB                = IT_LINE
      EXCEPTIONS
        FILE_WRITE_ERROR        = 1
        NO_BATCH                = 2
        GUI_REFUSE_FILETRANSFER = 3
        INVALID_TYPE            = 4
        NO_AUTHORITY            = 5
        UNKNOWN_ERROR           = 6
        HEADER_NOT_ALLOWED      = 7
        SEPARATOR_NOT_ALLOWED   = 8
        FILESIZE_NOT_ALLOWED    = 9
        HEADER_TOO_LONG         = 10
        DP_ERROR_CREATE         = 11
        DP_ERROR_SEND           = 12
        DP_ERROR_WRITE          = 13
        UNKNOWN_DP_ERROR        = 14
        ACCESS_DENIED           = 15
        DP_OUT_OF_MEMORY        = 16
        DISK_FULL               = 17
        DP_TIMEOUT              = 18
        FILE_NOT_FOUND          = 19
        DATAPROVIDER_EXCEPTION  = 20
        CONTROL_FLUSH_ERROR     = 21
        OTHERS                  = 22.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                = 'C:test.txt'
        APPEND                  = 'X'
      TABLES
        DATA_TAB                = ITAB
      EXCEPTIONS
        FILE_WRITE_ERROR        = 1
        NO_BATCH                = 2
        GUI_REFUSE_FILETRANSFER = 3
        INVALID_TYPE            = 4
        NO_AUTHORITY            = 5
        UNKNOWN_ERROR           = 6
        HEADER_NOT_ALLOWED      = 7
        SEPARATOR_NOT_ALLOWED   = 8
        FILESIZE_NOT_ALLOWED    = 9
        HEADER_TOO_LONG         = 10
        DP_ERROR_CREATE         = 11
        DP_ERROR_SEND           = 12
        DP_ERROR_WRITE          = 13
        UNKNOWN_DP_ERROR        = 14
        ACCESS_DENIED           = 15
        DP_OUT_OF_MEMORY        = 16
        DISK_FULL               = 17
        DP_TIMEOUT              = 18
        FILE_NOT_FOUND          = 19
        DATAPROVIDER_EXCEPTION  = 20
        CONTROL_FLUSH_ERROR     = 21
        OTHERS                  = 22.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Problem on zero's while using gui_download

    Hi,
    While downloading the internal table content for ex. ‘000010’ to Excel sheet by using ‘GUI_DOWNLOAD’ , zero’s are truncated and becomes  ‘10’(in this case).
    Is it any possible way to get as like ‘000010’?
    Thanks

    give the FILETYPE as  <b>DBF</b>  and checkout if it works
    or
    in the excel file , right click on that column>format cellschoose text

  • How to find out each Cell having Data or Not in Excel File by Using WDJ

    Hi Friends,
    I have one doubt on WDJ.
    I have to Upload Excel File. Click on Upload Button in Excel file Data will move to One Bapi. This is I was done. But my Requirement is if any empty Cell in Excel That File not uploaded it display one error message Please upload Correct Excel File
    How to find out each Cell having Data or Not in Excel File by Using WDJ. Please tell me.
    By Using this Code I have Upload Excel File
    InputStream text = null;
         int temp = 0;
         //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");
         try
                   File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());     
    FileOutputStream op = new FileOutputStream(file);
                   if (wdContext.currentContextElement().getResource()!= null)
                          text = wdContext.currentContextElement().getResource().read(false);
                             while((temp=text.read())!= -1)
                                  op.write(temp);
                                  op.flush();
                                  op.close();
                                  path = file.getAbsolutePath();
                                  //wdComponentAPI.getMessageManager().reportSuccess("Path Name :::::"+path);
         catch(Exception ex)               
                   ex.printStackTrace();
    But my Requirement is If excel having any Empty Cell that excel file not uploaded.How to do this...
    Regards
    Vijay Kalluri

    Hi my friend
    I would like to share you some APACHE APi´s that i use when i have to read excel files in Web Dynpro.
    JAR = poi-3.2-FINAL-20081019.jar
    Some Example:
    POIFSFileSystem fs;
    HSSFWorkbook wb;
    HSSFSheet sheet;
    String myMexican_ValueFromExcelis = "";
    try {
             fs = new POIFSFileSystem(new FileInputStream();
             // and select the cell "y"
            cell = row.getCell( 0 );
            myMexican_ValueFromExcelis = cell.getCellValue();  
    }cach(Exception e){
    REgargds

  • Exception UNKNOWN_ERROR while using GUI_DOWNLOAD in POWL

    Hi,
    I am trying to use FM GUI_DOWNLOAD to download an internal table in POWL to an excel sheet.
    Using GUI_DOWNLOAD I get an exception 6 = UNKNOWN_ERROR.
    Can anyone help? Or should I be using another function module? If yes, which?
    Cheers
    Kiran

    Hello Kiran,
    Strange Problem. Please try the code below. Also, please try any other drive other than C drive.
    w_path---> file path in presentation server.
      IF w_filepath IS NOT INITIAL.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                  = w_filepath  "TYPE STRING
          TABLES
            data_tab                  = p_t_output "TYPE STANDARD TABLE.
          EXCEPTIONS
            file_write_error          = 1
            no_batch                  = 2
            gui_refuse_filetransfer   = 3
            invalid_type              = 4
            no_authority              = 5
            unknown_error             = 6
            header_not_allowed        = 7
            separator_not_allowed     = 8
            filesize_not_allowed      = 9
            header_too_long           = 10
            dp_error_create           = 11
            dp_error_send             = 12
            dp_error_write            = 13
            unknown_dp_error          = 14
            access_denied             = 15
            dp_out_of_memory          = 16
            disk_full                 = 17
            dp_timeout                = 18
            file_not_found            = 19
            dataprovider_exception    = 20
            control_flush_error       = 21
            OTHERS                    = 22.
        CASE sy-subrc.
          WHEN 0.
            IF w_flaginfo IS INITIAL.
              MESSAGE i109.
              w_flaginfo = 1.
            ENDIF.
          WHEN 1.
            MESSAGE e033 . "file write error
          WHEN 2.
            MESSAGE e034 . "no batch
          WHEN 3.
            MESSAGE e035 . "gui refuse filetransfer
          WHEN 4.
            MESSAGE e036 . "invalid type
          WHEN 5.
            MESSAGE e037 . "no authority
          WHEN 6.
            MESSAGE e038 . "unknown error
          WHEN 7.
            MESSAGE e039 . "header not allowed
          WHEN 8.
            MESSAGE e040 . "separator not allowed
          WHEN 9.
            MESSAGE e041 . "filesize not allowed
          WHEN 10.
            MESSAGE e042 . "header too long
          WHEN 11.
            MESSAGE e043 . "dp error create
          WHEN 12.
            MESSAGE e044 . "dp error send
          WHEN 13.
            MESSAGE e045 . "dp error write
          WHEN 14.
            MESSAGE e046 . "unknown dp error
          WHEN 15.
            MESSAGE e047 . "access denied
          WHEN 16.
            MESSAGE e048 . "dp out of memory
          WHEN 17.
            MESSAGE e049 . "disk full
          WHEN 18.
            MESSAGE e050 . "dp timeout
          WHEN 19.
            MESSAGE e051 . "file not found
          WHEN 20.
            MESSAGE e052 . "dataprovider exception
          WHEN 21.
            MESSAGE e053 . "control flush error
        ENDCASE.
      ENDIF.
    Please let me know if this works or not.
    Thanks,
    Jayant

  • Reading second sheet of excel file while uploading

    Hello Freinds,
    I want to read second sheet of an excel file while taking the data from excel file into an internal table.
    Kindly help me with a FM which would take the sheet number too with the input OR a suitable option.

    Hi ,
    Try these links:
    Type conflict while uploading data from Excel sheet to Internal table
    FM for uploading data into internal table from Excel sheet
    Or
    Try using this FM:  'TEXT_CONVERT_XLS_TO_SAP'
    Thank You.
    Regards,
    Dhanalakshmi L

  • Blank spaces while using GUI_DOWNLOAD for Chinese characters

    Hi,
    While using GUI_DOWNLOAD for chinese characters I have used a code page option of 8300 for Chinese.
    The file which is getting downloaded in a notepad has some Chinese characters coming under some headings.
    After that columns other columns are getting shifted towards the right.
    This is working correctly for English characters.
    Can someone please help me.
    Now I am using CL_GUI_FRONT_END_SERVICES=>GUI_DOWNLOAD.
    What special options should I pass now.
    Regards,
    Subhashini

    Hi,
    I only solved my problem by using different code pages 8400 and 8300 for Chinese and Taiwanese characters.
    I fixed the lengths of the fields by converting them to hexadecimal string and back to string using these function modules as below.
    DATA:lv_xstring TYPE xstring,
           lv_temp TYPE string.
      DATA: lv_conv TYPE REF TO cl_abap_conv_in_ce.
      lv_temp = p_name.
      CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
        EXPORTING
          codepage_to      = p_codepage
          unicode_string   = lv_temp
          out_len          = p_outlen
        IMPORTING
          xstring_stream   = lv_xstring
        EXCEPTIONS
          invalid_codepage = 1
          invalid_string   = 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.
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
       EXPORTING
         from_codepage = p_codepage
         in_xstring    = lv_xstring
         out_len       = p_outlen
       IMPORTING
         out_string    = p_string.
    Create a Conversion Instance
    lv_conv = cl_abap_conv_in_ce=>create(
    encoding = p_codepage
    input = lv_xstring ).
    v_conv->read( IMPORTING data = p_string ).
    Regards,
    Subhashini

  • How to read MS-Excel file by using file Adapter

    hi friends,
    I have an issue on read Operation by using file Adapter.
    It is necessary to read excel file by using file adapter. But in the native format of file adapter there is no option to read excel type of files.
    So friends, please help me how to solve this problem?
    Thanks in Advance..

    See also this post:
    Read Excel File Using FileAdapter in SOA 11g
    It might help you

  • Problem in scheduling data refresh of excel file that uses PowerPivot

    I think I have successfully created and enabled the gateway and data sources for refresh - they are both seeming to connect.  However, when I try to schedule a data refresh to occur in the PowerBI site for the Excel file I receive an error message
    that the connection could not be established and receive error message "Correlation ID: d118ab93-436d-44a9-8c09-564f64fe0c58".  Appreciate any assistance in figuring out how to resolve.  Thanks a lotl

    Let's track it here: https://social.technet.microsoft.com/Forums/en-US/42c806dc-2d82-4bcf-ab6e-c279e2692a68/problem-in-scheduling-data-refresh-of-excel-file-that-uses-powerquery-and-powerquery?forum=powerbiforoffice365 
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Type of error in the log file while using using call transaction mode u2018Eu2019

    Hi Gurus,
    Please Answer for this qusetion urgently
    what type of error exactly  you will be seeing in the log file while using call transaction mode u2018Eu2019?
    Thanks/
    Radha.

    Hi,
    Can you be clear.
    In call transaction , no error logs  are created, you have to handle the errors explicitly using the structure BDCMSGCOLL.
    Whenever you use E mode then if the transaction encounters any of the errors i.e. data type mismatching or invalid values etc, it will stop at that screen.
    You can handle the errors in call transaction in the following method.
    create a table using the structure BDCMSGCOLL.
    then
    loop at ......
          CALL TRANSACTION 'XK01' USING I_BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO I_MESGTAB.
    endloop.
      SORT I_MESGTAB BY MSGID MSGV1 ASCENDING.
      DELETE ADJACENT DUPLICATES FROM I_MESGTAB.
      LOOP AT I_MESGTAB.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            ID   = I_MESGTAB-MSGID
            LANG = I_MESGTAB-MSGSPRA
            NO   = I_MESGTAB-MSGNR
            V1   = I_MESGTAB-MSGV1
            V2   = I_MESGTAB-MSGV2
            V3   = I_MESGTAB-MSGV3
            V4   = I_MESGTAB-MSGV4
          IMPORTING
            MSG  = MESG1.
        IF I_MESGTAB-MSGTYP = 'S' .
          WA_SUCCMESG-MESG = MESG1.
          APPEND WA_SUCCMESG TO I_SUCCMESG.
    else     IF I_MESGTAB-MSGTYP = 'E' .
          WA_ERRMESG-MESG = MESG1.
          APPEND WA_ERRMESG TO I_ERRMESG.
        ENDIF.
      ENDLOOP.
    Hope this is clear.
    Thanks and Regards.

  • How to encrypt excel file data using triple DES algorithm in oracle

    Hi,
    I would like to know the process or script to encrypt/decrypt the excel file data using triple DES algorithm in oracle.

    I'm not quite sure your requirement.... do you mean when uploading files to be stored in the database ?

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • Excel file edited using Numbers

    I am moving from PC to Mac. I have excel files I use for accounts and have just edited one using numbers and exported it to excel. This seems to have mucked up my totals. The formulas are correct but the actual value in the cells is nonsense. Is there a way back?

    Hi,
    It's no possible to upload directly Excel file in LSMW.
    You must transform to an flat File.
    There are 6 delimiters
    - No Separator
    - Tabulator
    - Semi-Colon
    - Comma
    - Blanks
    - Others
    Rgds

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • Errors in Flat files while using BDC

    *Hey Experts,*
    *I have made a BDC program which uploads an excel file into the system.Check the coding below*
    *I tried to run the same data but i received the following error at the system  status.*
    *Excel file://c:\cannot be processed .on checking in details i received this*
    *Message no. UX893*
    *Diagnosis*
    *An error occurred while attempting to process Excel file FILE://C:\Users\Administrator\Desktop\jack abaper\.*
    *Check whether:*
    *the file exists*
    *you have authorization to process the file*
    *Excel is installed and can be run*
    *System Response*
    *Excel file FILE://C:\Users\Administrator\Desktop\jack abaper\ is not processed. The activity is terminated.*
    *Procedure*
    *When the error has been corrected, restart the program.*
    *is there a way for the program to check the exact cause of error,like for my case the same data i was uploading.*
    *if it could tell me which row of data in the file is bringing this error.Apart from that I am to run this program in background not foreground ,please note of that while forgering a solution.*
    *Does anyone have a solution for this,or a better way gladly accept?*
    *Thank you my fellow abapers*
    *all help is appreciated.*
    *regds*
    *Ja*
    *Below see program>>>*
    REPORT  z_uploadbdc NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPE-POOLS: truxs.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE  rlgrap-filename OBLIGATORY DEFAULT 'C:\'.
    SELECTION-SCREEN : END OF BLOCK blk1.
    *&     Global Declarations
    TYPES: BEGIN OF t_datatab,
          col1(30)    TYPE c,
          col2(30)    TYPE c,
          col3(30)    TYPE c,
          END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab,
          wa_datatab TYPE t_datatab.
    DATA: it_raw TYPE truxs_t_text_data.
    TYPES: BEGIN OF ty_material,
           matnr TYPE matnr,
           anzahl TYPE anzahl,
           eqtyp TYPE eqtyp,
           servon TYPE servon,
           serbis TYPE serbis,
           sernr TYPE serbis,
           END OF ty_material.
    DATA: it_material TYPE TABLE OF ty_material,
          wa_material TYPE ty_material,
          it_bdcdata TYPE TABLE OF bdcdata,
          wa_bdcdata TYPE bdcdata.
    Table for messages from call transaction.
    The table is automatically filled with messages from call transaction.
    DATA BEGIN OF messtab OCCURS 10.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA END OF messtab.
    DATA : WF_MESSAGE(100).
    REFRESH MESSTAB.
    *&   AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *include bdcrecx1.
    *&   START-OF-SELECTION
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
      I_FIELD_SEPERATOR          =
          i_line_header              = 'X'
          i_tab_raw_data             = it_raw
          i_filename                 = p_file
        TABLES
          i_tab_converted_data       = it_material
        EXCEPTIONS
          conversion_failed = 1
          OTHERS            = 2.
      IF sy-subrc NE  0.
        MESSAGE ID sy-msgid
              TYPE sy-msgty
              NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *perform open_group.
      LOOP AT it_material INTO wa_material.
        PERFORM bdc_dynpro      USING 'SAPMIEQ0' '2000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RISA0-SERNR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      'BU'.
        PERFORM bdc_field       USING 'RISA0-MATNR'
                                      wa_material-matnr.
        PERFORM bdc_field       USING 'RISA0-ANZAHL'
                                      wa_material-anzahl.
        PERFORM bdc_field       USING 'EQUI-EQTYP'
                                      wa_material-eqtyp.
        PERFORM bdc_field       USING 'RISA0-SERVON'
                                      wa_material-servon.
        PERFORM bdc_field       USING 'RISA0-SERBIS'
                                      wa_material-serbis.
        PERFORM bdc_field       USING 'RISA0-SERNR(01)'
                                       wa_material-sernr.
    perform bdc_transaction using 'IQ04'.
        CALL TRANSACTION 'IQ04' USING it_bdcdata
                          MODE 'A' UPDATE 'S'
                          MESSAGES into messtab.
        REFRESH it_bdcdata.
    ENDLOOP.
    *&      Form  bdc_dynpro
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR wa_bdcdata.
      wa_bdcdata-program = program.
      wa_bdcdata-dynpro = dynpro.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO it_bdcdata.
    ENDFORM.                    "bdc_dynpro
    *&      Form  bdc_field
          text
         -->FNAM       text
         -->FVAL       text
    FORM bdc_field USING fnam fval.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam = fnam.
      wa_bdcdata-fval = fval.
      APPEND wa_bdcdata TO it_bdcdata.
    ENDFORM.                    "bdc_field
    perform close_group.
    Edited by: JackAbaper on Feb 8, 2012 3:11 PM
    Edited by: JackAbaper on Feb 8, 2012 3:14 PM
    Edited by: JackAbaper on Feb 8, 2012 3:15 PM

    Hi ,
    This is what you can do.
    Upload the file from presentation server to the application server through CG3Z.
    Then you can fetch the file from Application server to your BDC  program (Which you want to run in background).
    Regards,
    Chandan.

Maybe you are looking for

  • IPhone no longer shows up as a drive in "My Computer"

    Howdy. I am running Windows7 x64 RTM, and have been successfully using iTunes 8.2.1.6 and an iPhone for a while now. No problem with syncing. Until.... I have a second W7 box configured the same as my primary, and I plugged my iPhone into it just to

  • Programmatic ADF Business Component Work

    Is there any documentation on advanced usages of ADF Business Components at the programmatic level? Oracle supplies a lot of documentation (i.e ADF Developer's Guide for Forms/4GL Developers) regarding the programmatic use of business components at t

  • Firefox,Chrome, or Safari on Mountain Lion

    I have upgraded to Mpountain Lion for Lion. I have seached for software updates to find none. After a few days Safari seems slow and sluggish. Downloads are real slow. I used to use Firefox before I switch for Windows 7 to the Apple World. I am wonde

  • Apple Remote Desktop Update w/o ARD

    Software Update pops up "Apple Remote Desktop Update 3.3.1" on both of our Macs. We do not have Apple Remote Desktop on either computer. I am in the habit of installing any update that shows up but this one is a puzzle. I guess it wouldn't hurt to cl

  • Licesnisng Query

    Customer query Licensing query on Windows 2008 R2 Std edn. (3 Servers) There would be 2 terminal servers are in same domain then can we apply/activate the RDP license for 10 user CALs on Domain Server and redirect these RDP licenses through the domai