How to add coloum name in a exel sheet download file?

Dear all,
I amdownloading a excel sheet from a internal table.I am getting all data correctly.
but now i want to add coloumn name for each coloumn.
How can I do it?
i had try from work area and insert at first index but not get proper result.....
so if possible plz suggest sampl code also.
Regards
Ricky

Hi Ricky Maheswari,
                              I will send a sample code for u.check it once.I execute the below code that is executed successfully.
In my report u have check these things carefully "PEFORM APPEND_HEADER " and SELECT STATEMENT(I use appending table stmt there).Then ur problem will be resolved.
code:
*& Report  YBDC_DOWNLOAD_MM01_XLS                                      *
*& DEVELOPER   : KIRAN KUMAR.G                                         *
*& PURPOSE     : FETCH DATA FROM DB AND PLACE THEM IN .XLS FILE        *
*& CREATION DT : 2/12/2007                                             *
*& REQUEST     : ERPK900035                                            *
*& NOTE        : MENTION PATH & MENTION FILE.XLS IN THE SELE-SCREEN    *
REPORT  ybdc_download_mm01_xls  MESSAGE-ID zbdcmsg.
Tables
TABLES: mara, "General Material Data
        makt. "Material Descriptions
Global Variables
DATA: gv_path TYPE string. "Hold Path Selection Information
Internal Table
DATA : BEGIN OF gt_data OCCURS 0,
        matnr(20),   " Material Number
        mbrsh(20),   " Industry Sector
        mtart(20),   " Material Type
        meins(20),   " Base Unit Of Measure
        maktx(20),   " Material Description
       END OF gt_data.
Selection-Screen
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_file(90).
SELECTION-SCREEN : END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s_matnr FOR mara-matnr,
                 s_mbrsh FOR mara-mbrsh,
                 s_mtart FOR mara-mtart,
                 s_maktx FOR makt-maktx,
                 s_meins FOR mara-meins.
SELECTION-SCREEN : END OF BLOCK b2.
Initialization
INITIALIZATION.
  PERFORM initial.
Placing A File In The Directory
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  PERFORM path_directory.
START-OF-SELECTION.
Append Some Header Information To XLS File
  PERFORM append_header.
Fetching The Data
  PERFORM fecth_data.
END-OF-SELECTION.
GUI_DOWNLOAD
  PERFORM gui_download.
*&      Form  path_directory
      text
-->  p1        text
<--  p2        text
FORM path_directory .
  CALL METHOD cl_gui_frontend_services=>directory_browse
    EXPORTING
      window_title         = 'Download A File'
      initial_folder       = 'c:/'
    CHANGING
      selected_folder      = gv_path
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.
  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 METHOD cl_gui_cfw=>flush
    EXCEPTIONS
      cntl_system_error = 1
      cntl_error        = 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.
  p_file = gv_path.
  CLEAR gv_path.
ENDFORM.                    " path_directory
*&      Form  fecth_data
      text
-->  p1        text
<--  p2        text
FORM fecth_data .
  SELECT a~matnr
         a~mbrsh
         a~mtart
         a~meins
         b~maktx
    FROM mara AS a
   INNER JOIN makt AS b ON amatnr = bmatnr
   APPENDING  TABLE gt_data
   WHERE a~matnr IN s_matnr
   AND   a~mbrsh IN s_mbrsh
   AND   a~mtart IN s_mtart
   AND   b~maktx IN s_maktx
   AND   a~meins IN s_meins.
  IF sy-subrc = 0.
    MESSAGE s000.
  ENDIF.
ENDFORM.                    " fecth_data
*&      Form  gui_download
      text
-->  p1        text
<--  p2        text
FORM gui_download .
  gv_path = p_file.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
   BIN_FILESIZE                  =
     filename                      = gv_path
     filetype                      = 'ASC'
   APPEND                        = ' '
     write_field_separator         = 'X'
   HEADER                        = '00'
   TRUNC_TRAILING_BLANKS         = ' '
   WRITE_LF                      = 'X'
   COL_SELECT                    = ' '
   COL_SELECT_MASK               = ' '
   DAT_MODE                      = ' '
IMPORTING
   FILELENGTH                    =
    TABLES
     data_tab                      = gt_data
   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.
ENDFORM.                    " gui_download
*&      Form  append_header
      text
-->  p1        text
<--  p2        text
FORM append_header .
  REFRESH : gt_data.
  CLEAR   : gt_data.
  gt_data-matnr = 'MATERIAL NUMBER'.
  gt_data-mbrsh = 'INDUSTRY SECTOR'.
  gt_data-mtart = 'MATERIAL TYPE'.
  gt_data-maktx = 'MATERIAL DESCRIPTION'.
  gt_data-meins = 'BASE UNIT OF MEASURE'.
  APPEND gt_data.
  CLEAR gt_data.
ENDFORM.                    " append_header
*&      Form  initial
      text
-->  p1        text
<--  p2        text
FORM initial .
  s_matnr-sign   = 'I'.
  s_matnr-option = 'BT'.
  s_matnr-low    = '800'.
  s_matnr-high   = '100-200'.
  APPEND s_matnr.
  s_mbrsh-sign   = 'I'.
  s_mbrsh-option = 'BT'.
  s_mbrsh-low    = 'M'.
  s_mbrsh-high   = ''.
  APPEND s_mbrsh.
  s_mtart-sign   = 'I'.
  s_mtart-option = 'BT'.
  s_mtart-low    = 'FERT'.
  s_mtart-high   = 'HALB'.
  APPEND s_mtart.
  s_maktx-sign   = 'I'.
  s_maktx-option = 'BT'.
  s_maktx-low    = 'IRON'.
  s_maktx-high   = 'STEEL'.
  APPEND s_maktx.
  s_meins-sign   = 'I'.
  s_meins-option = 'BT'.
  s_meins-low    = 'CM'.
  s_meins-high   = 'KG'.
  APPEND s_meins.
ENDFORM.                    " initial
Award points if helpful.
Kiran Kumar.G
                 Have a Nice Day..

Similar Messages

  • MSRV* Reports: How to add Vendor name?

    howdy gurus!
    Appreciate very much for any guidelines on how to add vendor name in MSRV* reports.
    Cheers,
    Ron

    Thanks for the inputs guys.
    So there's no technique yet to include it (similar to FBL*N and CJI3/KSB1).
    No available note also in SAPNotes.
    I already developed the Z*  report but the key user requests the possiblities in MSRV*.
    Cheers,
    Ron

  • How to add a record in document library without upload file.

    Hi,
    how to add a record in document library without upload file?
    Is it possible? I want to create a folders in Document Library but inside folders i do not want to upload a file instead of just i want to create a record. I will map my local file path to the records.
    Can anyone help me on it?
    Thanks & Regards
    Poomani Sankaran

    Hello Sankaran,
    document library is to upload documents, without document you will not be able to add a record or Item to it.
    for your requirement you can use a list and enable folders within the list and maintain the local path of the file as an item in list.
    http://www.sharepointbriefing.com/spconfig/article.php/3834951/Enable-the-New-Folder-Creation-Option-in-SharePoint-Custom-Lists.htm
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • How to add empty coloumn in the work sheet

    Hi
    how to add empty coloumn in the work sheet for taking notes after getting print out the work sheet
    Regards
    Manikandan

    And if you want the column to be a certain width, then just create that calculation with spaces instead (ie: calc_junk = ' ' ).
    Russ

  • How to add document name and document namespace to xml mail sender msg

    Hi,
    I have set up a sender mail CC that accepts messages already in XML format. However, the messages are missing the document name and document namespace. I am trying to use MessageTransformBean to add these to the message payload. However the examples I've found so far all talk about converting plain text coming in. When I used convertionTpe -> SimplePlain2XML it messed up the original content with unnecessary xml tags.
    Can someone please tell me how to insert the document name and namespace into the payload without converting the original xml content? Thanks in advance.

    Dont think there is a way.
    As the source is a XML, why dont you create the MessageType with the same name and namespace as the XML file in the email.
    Regards,
    Bhavesh

  • How to add website name to video with QTX?

    I want to add the name of my website to video clips in such a way that it will be difficult for others to copy the video, remove my website name and republish it without any credit to me. At present I am using QuickTime to 'Save for Web' and then uploading the resultant file (M4V) to my website. The videos are just video blogs so they're not high-tech productions!
    I am running Snow Leopard 10.6.7. I used to have Quicktime Player 7 Pro. I now seem to be running QuickTime Player 10.0
    I cannot find a User Guide to QTP 10. The user guide for QTP7 does refer on page 35 to adding text to a video but a) it refers to a Clipboard I can't find and the menu options don't match what I'm looking at in QTP10; and b) if I can find a way to follow these instructions, how easy will it be for someone to simply download my video file and remove the text anyway?
    I'd appreciate any help or advice you can offer.

    I am running Snow Leopard 10.6.7. I used to have Quicktime Player 7 Pro. I now seem to be running QuickTime Player 10.0... The user guide for QTP7 does refer on page 35 to adding text to a video but a) it refers to a Clipboard I can't find and the menu options
    If you had QT 7 keyed for "Pro" use when you upgraded to OS X.6, then a Snow Leopard versions of the QT 7 Pro player should have been placed in the "Applications/Utilities" folder automatically. Alternately, if you still cannot find QT 7 on your upgraded system, you could try using the free MPEG Streamclip application. In many ways it functions as a QT 7 Pro alternative for conversions, merging files, and such but does not have QT 7 Pro's layering and masking features. However, it does have a built-in text "watermarking" feature in the "Adjustments" window. I.e., instead of using the QT X "Save for Web" option, you would use the MPEG Streamclip "Export to MPEG-4" option and add your "text" watermark before actually performing the export. Alternatively, many QT 7 Pro users add a graphic watermark or logo as a means of identifying their content. If interested, here are a couple of old QT "Quickie" tutorials for adding a graphic logo/watermark:
    Adding a Graphic Logo
    Adding a Graphic Watermark
    how easy will it be for someone to simply download my video file and remove the text anyway?
    If you embed a watermark or logo before exporting your file to its final compression format for posting to your site, then it is virtually impossible to remove totally without editing each frame of your clip at the pixel level. (It would, however, be easy to cover the logo or watermark with an opaque mask.) On the other hand, if you add the logo or watermark, text or graphic, as a post export edit in its own track layer, then it is quite easy to remove it using an application like QT 7 Pro or, in rare cases, by simply copying the main audio/video tracks to a different file container type.

  • How can add a name to the dictionary

    Everytime I put my daughter's name in a text msg, it suggests other spellings of her name. My crackberry let me add her name spelling to the dictionary? Does the iphone have something similar?

    Names are added by rejecting the autocorrect selection.  If you continue to tap the "x" when autocorrect suggests an alternative spelling it will eventually learn from this and stop trying to correct the spelling.

  • Whit PHOTO how to add a name when I expert one

    I upgrade recently Iphoto whit Photo.
    I need to export many picture. I usually add a name when I use Iphoto. But I didn't find the same option in Photo. So whit about 100 exported picture only the IMG-9999 camera name is boring.
    Tanks for any good help!
    Denis

    what exactly did you mean by adding a name?
    LN

  • [JSF 2.0] How to add a non-displayed comment in JSF xhtml files?

    Hello!
    I would like to know how to put a non-displayed comment in a JSF xhtml file.
    Currently, a *<!-- My comment -->* will be sent in the HTML output.
    I've tried also:
    *// My comment*
    *<%-- My comment --%>*
    and other ideas, but they are failing.
    On the web, I red an ugly solution, implying to add one parameter in each faces-config.xml files our project could have, and asking JSF not to parse some statements (if I remember well).
    Whatever, I am quite sure it was a solution for JSF 1.0 or 0.9...
    There must be a clean way to write a comment, but I just can't find it.
    How do I write a comment that is not displayed on HTML output, in a JSF xhtml file?
    Regards,
    Grunt.
    Edited by: Grunt2000 on May 10, 2010 9:23 AM

    Grunt2000 wrote:
    Hello!
    I would like to know how to put a non-displayed comment in a JSF xhtml file.
    Currently, a *<!-- My comment -->* will be sent in the HTML output.
    I've tried also:
    *// My comment*
    *<%-- My comment --%>*
    and other ideas, but they are failing.
    On the web, I red an ugly solution, implying to add one parameter in each faces-config.xml files our project could have, and asking JSF not to parse some statements (if I remember well).
    Whatever, I am quite sure it was a solution for JSF 1.0 or 0.9...
    There must be a clean way to write a comment, but I just can't find it.
    How do I write a comment that is not displayed on HTML output, in a JSF xhtml file?Does this help?
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>I'm not sure if that works under JSF 2. If not, you can always use <ui:remove/>.

  • How to add dimension in dimension_values.csv and schema.csv file

    How to add  one dimension in dimension_values.csv and schema.csv file

    I'm not sure on the equation Ventzo, so please tell me if I've got this wrong.
    This should create a text file on the desktop with a name of the folder you are in plus the time.
    #target bridge
    if( BridgeTalk.appName == "bridge" ) { 
    var quadDetails = MenuElement.create("command","Get  Quadrature", "at the end of Tools","QuadDetails");
    quadDetails .onSelect = function () {
    var file = new File(Folder.desktop +"/" + decodeURI(Folder(app.document.presentationPath).name) + time() +".txt");
    file.open("w", "TEXT", "????");
    $.os.search(/windows/i)  != -1 ? file.lineFeed = 'windows'  : file.lineFeed = 'macintosh';
    file.open('w');
    var sels = app.document.selections;
    for(var a in sels){
    var myThumb = new Thumbnail( sels[a]);
    var Resolution = myThumb.core.quickMetadata.xResolution;
    if(Resolution == 0) Resolution = 72;
    var CM = Resolution /2.54;
    var m = CM*100;
    var Height = (myThumb.core.quickMetadata.height/m);
    var Width = (myThumb.core.quickMetadata.width/m);
    file.writeln(decodeURI(sels[a].spec.name) + " - " +(Height * Width).toFixed(4));
    file.close();
    alert(decodeURI(file.name) + "  Has been created on the Desktop");
    function time(){
    var date = new Date();
    var d  = date.getDate();
    var day = (d < 10) ? '0' + d : d;
    var m = date.getMonth() + 1;
    var month = (m < 10) ? '0' + m : m;
    var yy = date.getYear();
    var year = (yy < 1000) ? yy + 1900 : yy;
    var digital = new Date();
    var hours = digital.getHours();
    var minutes = digital.getMinutes();
    var seconds = digital.getSeconds();
    var amOrPm = "AM";
    if (hours > 11) amOrPm = "PM";
    if (hours > 12) hours = hours - 12;
    if (hours == 0) hours = 12;
    if (minutes <= 9) minutes = "0" + minutes;
    if (seconds <= 9) seconds = "0" + seconds;
    todaysDate = "-" + hours + "_" + minutes + "_" + seconds + amOrPm;
    return todaysDate.toString();

  • How to add customized column in the time sheet CATS (transaction CAT2) ?

    Hello,
    I need to be able to add some columns in the time sheet CAT2 containing:
    - the name and first name of the person (in addition of the number), in display mode in the CATS time sheet.
    - a  text that I will found by reading some tables and values...
    Does anyone have any idea how to do so ? and if it's possible or not?
    Thanks a lot in advance for your help.
    Best regards
    Fanny GROUX

    Hi,
    Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
    But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
    When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
    Am I using the wrong table ? wrong user-exit ? or my code ..
    Thansk a lot again for your help.
    Fanny GROUX

  • How to add a header line to excel sheet?

    Hi Guru's
    I have download the scheduling agreement report in a excel sheet, I want to know how to add the header line  to that excel sheet.

    Hi
    See this sample code:
    Tables : zacg_cca,zacg_exsh.
    data: P_file like RLGRAP-FILENAME.
    Data: Begin of it_header occurs 0,
    Header(15) ,
    end of it_header.
    Data : begin of it_final occurs 0,
    ccode type zacg_cca-ccode,
    mat_cd type zacg_cca-mat_cd,
    ingr_desc type zacg_cca-ingr_desc,
    conc type zacg_cca-conc,
    quantity type zacg_cca-quantity,
    percqty type zacg_cca-percqty,
    flag ,
    APP_DATE type zacg_cca-app_date,
    rsamnos type zacg_cca-rsamnos,
    end of it_final.
    SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-000.
    select-options : s_Date for zacg_cca-app_date.
    SELECTION-SCREEN : END OF BLOCK blk.
    it_header-Header = 'Samp_code'.
    Append it_header.
    it_header-Header = 'Mat_code'.
    Append it_header.
    it_header-Header = 'Ingr_Desc'.
    Append it_header.
    it_header-Header = 'Conc'.
    Append it_header.
    it_header-Header = 'Quan'.
    Append it_header.
    it_header-Header = 'Perc'.
    Append it_header.
    it_header-Header = 'Flag'.
    Append it_header.
    it_header-Header = 'Date'.
    Append it_header.
    it_header-Header = 'Rsamnos'.
    Append it_header.
    it_header-Header = 'Mat_code'.
    Append it_header.
    select ccode
    mat_cd
    ingr_desc
    conc
    quantity
    percqty
    app_date
    rsamnos
    from zacg_cca into corresponding
    fields of table
    it_final where zacg_cca~app_date in s_date.
    loop at it_final.
    it_final-flag = 'T'.
    modify it_final.
    it_final-quantity = it_final-quantity * 2 .
    Modify it_final.
    endloop.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
    EXPORTING
    FILE_NAME = 'E:\IT\P_FILE'
    CREATE_PIVOT = 0
    DATA_SHEET_NAME = ' '
    PIVOT_SHEET_NAME = ' '
    PASSWORD = ' '
    PASSWORD_OPTION = 0
    TABLES
    PIVOT_FIELD_TAB =
    DATA_TAB = it_final[]
    FIELDNAMES = it_header[]
    EXCEPTIONS
    FILE_NOT_EXIST = 1
    FILENAME_EXPECTED = 2
    COMMUNICATION_ERROR = 3
    OLE_OBJECT_METHOD_ERROR = 4
    OLE_OBJECT_PROPERTY_ERROR = 5
    INVALID_PIVOT_FIELDS = 6
    DOWNLOAD_PROBLEM = 7
    OTHERS = 8
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    regards
    Satish

  • How to add same name records from datagrid,while i am selecting one of the record and click add butt

    hi  friends,
    i  am doing flex 4 mxml web application with as3,i am struck up in the following  concept,shar your suggession about this.
    i am using datagrid with 3 columns NUMBER, NAME, AMOUNT. one text box and one add button and one delete button.
    i have two records in the same name in grid, when i click one record from the grid and click ADD button means that time ,both records  AMOUNT WILL ADDED   which record having the same name and give that value in a text box.
    how to do this?
    any useful suggesssion or modal sample
    Thanks in advance,
    B.venkatesan.

    hi gajanan hiroji,
    Thanks for the useful help.
    And one more think i want ask you, i am doing web application, i am using 5 modules in that,every module in a single page.
    In this application i am using datagrid in last 3 models. the operation is same for the models, select a record from grid then click post it should move to next page.
    In that i am writting init() function . this for showing the last module posted records here while i am entering this model.
    At the panel initializing time the records loading and showing in the gird,
    i written refresh function for this .
    But some times the function working properly and show the records in grid.
    some time it wont show the records.
    refresh function not working properly..
    looking for usful suggession,
    Thanks,
    B.venkatesan.

  • AddChild(new button()) - How to add a name to this new created button

    Hello,
    Lost my old nickname, i was Pluda, now exPluda?.
    well, tring to use a loop to add some buttons to my work, but need to reference their names so I can have diferent x positions for each. How to do that?
    for ( var sm:uint = 0; sm < sub_menus.length; sm ++ ) {
            hsm.addChild(new bt_sub_menus());
            hsm.bt_sub_menus.x -= hsm.x-10;
            hsm.bt_sub_menus.y = hsm.bt_sub_menus.height+sm*15;
    this does not work, i just get one button placed where I want.
    Thanks!

    Hello,
    it works, but the first button doesn't places himself at hsm.x as he should.
    this is so far one of my greatest difficulties in AS3, controling events inside loops.
    in as2 we could use something like
    function whatever() {
         n = 0;
         for(n = 0; n<20; n++) {
              do stuff here, like per example fade in of movieclip
              n++
    in as3 I can't make this, I tried during this week to have some movieclips to place themselfs inside one sprite, using one timer to make each placement every 2 seconds. No results... they all are placed at same time.
    Its been dificult this as2 to as3 transition, (I just purchase flash cs 3 a couple of monts)
    Thanks

  • PLD How to add Project Name In Trail balance.

    Hi,
    how to Link to projects code and Project Nalme in Trail balance.....

    Hi,
    Do you know variable or database field for project name/code? In general, Financial report PLD were designed by SAP by using variables and its very difficult to find and to add it into PLD.
    Thanks & Regards,
    Nagarajan

Maybe you are looking for

  • Itunes 10.5 has stopped working message on windows vista

    Hey Guys. I've just updated to iTunes 10.5, currently running vista 32bit. I get an error message when i try and start up itunes saying itunes has stopped working, then this... Problem Event Name:          APPCRASH   Application Name:          iTunes

  • Idoc- can we sent already sended idoc if status is showing error message

    hi Idoc- can we sent already sended idoc if status is showing error message without making any changes. Thanks in advance.

  • Problem with activating account

    Hi Guys, I am newbie in the internet stuff and I dont know if I am writing on correct board on this website. I have got problem with activating my account. I received email but when I click on the link it was not working, is this link is correct? htt

  • Oracle Portal - Map Site

    How can I display the map site (tree) on Oracle Portal ?

  • How to pull data from SAP for OWB

    I am new to OWB but old to SAP. My experiance is that you can not go straight to the database in SAP to pull data. How does the OWB SAP connector work? I think i need to write a RFC module to pull the data - but my PM is telling me that Oracle WB can