To Mak the headings Bold in Excel sheet.

Hi All,
     I am sending a mail to SAP inbox with an excel Sheet as an attachment.
     I am creating the Excel sheet Dynamically from the internal table,
     Now the Problem is the Headings i am putting in each colum are mixed with the data of the colums,
     So I have to make the headings<b> BOLD</b> or atleast I have to Differentiate them with the rest of the Data,
     Please Help me out in this,
Thanx,   Girish.

Hi Girish,
             Check out the example.gs_font is marked in bold
Code Part B.1 Data declarations
REPORT zole_tutor_example_ms_word .
*--Include for OLE-enabling definitions
INCLUDE ole2incl .
*--Global variables
*--Variables to hold OLE object and entity handles
DATA gs_word TYPE ole2_object . "OLE object handle
DATA gs_documents TYPE ole2_object . "Documents
DATA gs_actdoc TYPE ole2_object . "Active document
DATA gs_application TYPE ole2_object . "Application
DATA gs_options TYPE ole2_object . "Application options
DATA gs_actwin TYPE ole2_object . "Active window
DATA gs_actpan TYPE ole2_object . "Active pane
DATA gs_view TYPE ole2_object . "View
DATA gs_selection TYPE ole2_object . "Selection
<b>DATA gs_font TYPE ole2_object . "Font</b>
DATA gs_parformat TYPE ole2_object . "Paragraph format
DATA gs_tables TYPE ole2_object . "Tables
DATA gs_range TYPE ole2_object . "Range handle for various ranges
DATA gs_table TYPE ole2_object . "One table
DATA gs_table_border TYPE ole2_object . "Table border
DATA gs_cell TYPE ole2_object . "One cell of a table
DATA gs_paragraph TYPE ole2_object . "Paragraph
DATA gv_pos(5) TYPE n . "Position information for table
Step 2   Creating the OLE object and get main entities to handle variables.
START-OF-SELECTION .
*--Creating OLE object handle variable
CREATE OBJECT gs_word 'WORD.APPLICATION' .
IF sy-subrc NE 0 .
MESSAGE s000(su) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF gs_word 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF gs_word 'Documents' = gs_documents .
CALL METHOD OF gs_documents 'Add' .
*--Getting active document handle
GET PROPERTY OF gs_word 'ActiveDocument' = gs_actdoc .
*--Getting applications handle
GET PROPERTY OF gs_actdoc 'Application' = gs_application .
Code Part B.2 Creating the OLE object
Step 3   Setting the measurement unit to ‘CM.’
Code Part B.3 Setting measurement unit
*--Setting the measurement unit
GET PROPERTY OF gs_application 'Options' = gs_options .
SET PROPERTY OF gs_options 'MeasurementUnit' = '1' . "CM
Step 4   Some header text.
Code Part B.4 Setting header content
*--Getting handle for the selection which is here the character at the
*--cursor position
GET PROPERTY OF gs_application 'Selection' = gs_selection .
GET PROPERTY OF gs_selection 'Font' = gs_font .
GET PROPERTY OF gs_selection 'ParagraphFormat' = gs_parformat .
*--Setting font attributes
SET PROPERTY OF gs_font 'Name' = 'Arial' .
SET PROPERTY OF gs_font 'Size' = '10' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '1' . "Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '2' . "Right-justified
CALL METHOD OF gs_selection 'TypeText'
EXPORTING
#1 = 'This is an OLE example!'.
*--Setting the view to the main document again
SET PROPERTY OF gs_view 'SeekView' = '0' . "Main document view
Step 5   Writing the title.
Code Part B.5 Writing the title
*--Reseting font attributes for the title
SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
SET PROPERTY OF gs_font 'Size' = '16' .
SET PROPERTY OF gs_font 'Bold' = '1' . "Bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '1' . "Centered
CALL METHOD OF gs_selection 'TypeText'
EXPORTING
#1 = text-000.
*--Advancing cursor to the new line
CALL METHOD OF gs_selection 'TypeParagraph' .
Step 6   Writing some text.
Code Part B.6 Writing some text
*--Reseting font attributes for ordinary text
SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
SET PROPERTY OF gs_font 'Size' = '12' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
Please reward if useful.

Similar Messages

  • How to make the headings bold of a csv file

    Hi,
    I am able to create .csv file, is there a way to make the content bold programmtically for the headings?
    thanks
    Shubha

    No. A CSV file does not have formatting.

  • How to populate the Quering data into Excel sheet in Oracle

    Dear Guys,
    How to populate the Quering data into Excel sheet in oracle.
    Please provide a solution.
    Thanks & Regards,
    Senthil K Kumar

    Hi
    To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
    Here's an example.
    Example
    <code>
    SET LINESIZE 4000
    SET VERIFY OFF
    SET FEEDBACK OFF
    SET PAGESIZE 999
    SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
    SPOOL c:\test_xls.xls
    SELECT object_type
    , SUBSTR( object_name, 1, 30 ) object
    , created
    , last_ddl_time
    , status
    FROM user_objects
    ORDER BY 1, 2
    SPOOL OFF
    SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
    SET LINESIZE 2000 VERIFY ON FEEDBACK ON
    </code>

  • Regarding the o/p in excel sheet

    hi experts,
    i have developed one report in alv when i transfer it to excel sheet its coming rt in development server,,but in production server when i take it to excel sheet the material number gets cut (half) and extra zero is coming ...why plz help me.....

    hi,
    go to the following thread
    Can we generate output of a report in an Excel Sheet?
    weird problem when downloading the output to an excel sheet
    ALV Report output in Excel format
    <b>plz reward if  useful</b>
    Swati

  • Error while download the data to an Excel sheet for ECC report from EP

    Hi experts,
    I had created a report program which will download the data to an Excel sheet using SAP OLE object
    For this report i had created a tcode too. The report which i developed is perfectly working fine in SAPGUI. But if i download the data to an Excel sheet for the same report throught SAP EP.I am getting the  error that "Error in excel downlaod"
    I analyed by putting dubigg point and it throws exception while calling Function module.
    The excpetion is " OLE object id not found".
    Can any body gives a light on this why i'm not able download the excel in ep?
    Thanks,
    JB

    Hello,
    (by the way I came here to ask my question and is my first time visit but...)
    The problem is obvious: How do you expect OLE handler can "touch" the local PC Excel through a web browser? I believe that is not possible. That means (at least for me) that I have to create the whole documents before I return them to the user. That is why I use XML Office documents generation or you can try to hack some Export to excel features of ERP reports.
    Regards Otto

  • How to put the data from one excel sheet in another excel sheet

    hi ,
    I want put the data from one excel sheet in another excel sheet in seq. order Eg: I have one excel sheet in which i have 3 col. Name , Sno. , Email along with data .I want to put data from this sheet to another excel sheet in the following orders of col. Sno,Name, Email .
    While loading data in another sheet , i have to perform validation like char field should n't contain numeric values and vice versa .
    Let me know on this soon ..
    regards
    Prashant

    Well, you can issue separate queries with the ordering you need from each tab in the spreadhseet. You can open an ODBC connection from a VBA macro, select a sheet, run a query, select another sheet and run another query. As for the validation, you can do this in Oracle via stored procedures or again in VBA code.

  • How to delete the Junk Data From Excel Sheet

    Dear ABAPers,
                I am uploading the Excel sheet from the Desktop to the SAP System. In the Internal table i am getting Unwanted Junk data's for Example '##########'.I am not getting this Junk data for all the times. i am getting it for Some times.How to ignore these junk data.
    Thanks & Regards,
    Ashok.

    Dear Friends,
                I communicated wrongly.I am very sorry for that.The Problem is I am getting All the Data into the internal table in addition to that lines i am getting the Junk data in the internal table at the end of the internal table.
    Excel Sheet
    L-1     21.10.2008     1110     888555444676001
    L-1     21.10.2008     1110     888555444676002
    L-1     21.10.2008     1110     888555444676003
    L-1     21.10.2008     1110     888555444676004
    Internal table
    L-1     21.10.2008     1110     888555444676001
    L-1     21.10.2008     1110     888555444676002
    L-1     21.10.2008     1110     888555444676003
    L-1     21.10.2008     1110     888555444676004
    Thanks & Regards,
    Ashok.

  • How to get(copy) the contents i.e the cell of an excel sheet to other excel

    How to get(copy) the contents i.e the cells of an excel sheet to another excel sheet.
    I can read the contents i.e the text in the cells and able to display it in the Java console
    i want these contents to be copied to another excel sheet with the cells data.
    I am using Java Swing for the UI, POI framework for the excel work.
    Please anyone suggest some code to this requirement.

    [spreadsheets with poi|http://poi.apache.org/spreadsheet/converting.html] Hi
    on the poi apache site there's a number of good examples...
    I started with poi only a week ago, but just from reading these examples
    (especially SS Usermodel code) i managed all i needed to know (so far).
    kind regards
    BB
    Edited by: BugBunny on Feb 22, 2010 4:36 AM

  • How to maintain the same layout in excell sheet and in the mailed version

    i have a report which gives the related sap o/p , when we chose a certain layout and trasfer the o/p to excell sheet it maintains the layout but when it comes to the emailed version (i.e., when it is emailed ) , the attachment , it is not maintaining the layout which i have chosen, can u suggest me what i need to do?

    Hello,
    it si not crear where you change the cost of the item to 90 USD?
    If you have a price of 100USD in the sales order then you should have a look in the copy control. Which pricing type is maintained here.
    If you want to take over the price from the sales order to the return order then you should maintain a pricing type which not new determine the VPRS. Then the VPRS should copied from the sales order.
    Please have a look 24832. Here is describe which pricing type is relevant to determine a new condtion.
    I hope that the information are helpful.
    Regards and have a nice day.
    Claudia

  • How can I execute the test case written excel sheet

    Hello
    I have written the test cases  in excel sheet. Please tell any one how to execute test case from labview.please send some sample vi

    I'm sorry, but you've provided zero information on what you have. All you've said is that you have an Excel "sheet" with test cases, and that it's written in VBA. What does that even mean? What's written in VBA? Are you trying to call the VBA code? Are you trying to rewrite the VBA code in LabVIEW? Unless you provide a better explanation of what you have and what you are trying to do, we can just keep playing a guessing game.

  • How can I mail the Job Log in the form of an excel sheet?

    Daily I have to monitor a Job and I have to retrieve the Job Log in an excel sheet, Format the excel sheet, and then mail the excel sheet and the Job Status(Finished/Cancelled) to Client/Person Incharge.
    I want to automate this entire process. Please guide me, how can I write a program that mails the Job Log, in the form of an excel sheet, to the Client?
    Edited by: Jiten Rajendra Barai on Nov 25, 2008 3:03 PM

    Hi,
    You can use this FM to mail the excel sheet.
    SO_NEW_DOCUMENT_ATT_SEND_API1
    Also have a look at the below thread, it might be very helpful.
    Sending Excel attachment in E-mail
    Cheers...

  • Embedding Macros in the BEx web exported excel sheet

    Hi all Advanced reporting gurus,
    I have to embed a macro in the excel sheet, when the user clicks the button Export to excel sheet in the BEx web. This needs to be generic, it means every BEx web user should be able to avail this macro. Can any one suggest me the methods to do so ?? Its really urgent and ur quick response is awaited....
    Thanking you in advance,
    Bret

    Hi Heike,
    Thanks for your help. I searched the office XML documents and one the help file specifys this tag
    IntlMacro Element (Microsoft Excel)
    Specifies whether a worksheet is an international macro sheet.
    Contained In
    WorksheetOptions
    Remarks
    If <x:IntlMacro/> is specified, the worksheet is an international macro sheet.
    so I guess, if Office XML standards are used in BW then this tag also shld work. I read few topics on SAP ABAP class files such as ZCL_RSR_XLS_HELP_WINDOW_PRINT and it has one the method to trigger rendering of data. Can I use this class and method to send the tag values so that macro is also embedded while sending data ????
    your thought are highly awaited,
    thanks
    D Bret

  • Script to make the text bold or italic

    I saw someone suggested the following code to meet the need:
    var app = new Illustrator.Application();
    var doc = app.ActiveDocument;
    var bold = doc.CharacterStyles["Bold"];
    var italic = doc.CharacterStyles["Italics"];
    var frame = doc.TextFrames[0];
    bold.ApplyTo(frame);
    italic.ApplyTo(frame);
    But it does work in my case since "doc.CharacterStyles["Bold"];" and "doc.CharacterStyles["Italics"]" declare an error message of "No such element". Is there another way that I can try to make the text bold or italic?

    look here
    http://forums.adobe.com/thread/881071?tstart=0

  • How save data from the one row of db to the one cell of excel sheet

    hi
    how to save data from one row of db to the one cell of excel sheet and so on..............

    hi,
    see this link
    http://poi.apache.org/hssf/quick-guide.html
    Regards,
    Ram

  • Export the list of the prices of the materials at an Excel sheet

    If we use PR00 condition for price of the materials, how can we export the list of the prices of the materials at an Excel sheet? Can we use V/LA or V/LD ?
    Thanks in advance.

    Go to menu bar select"System"-->list>Save--->localfile-->and then save it in spred sheet.

Maybe you are looking for

  • I Recorded 4 audio tracks, could hear it in the headphones while recording. Meters show input. No playback sound. Advise.

    I Recorded 4 audio tracks, could hear it in the headphones while recording. Meters show input. No playback sound. Please Advise.

  • Philips 32' LCD HDTV

    I cannot get a full screen display with the above TV (Model no.: 32PF9966) even after installing SwithResx. It has 1366 * 768 resolution. I would like to know if anybody using the same TV or similare Philips LCD TV with 1366*768 sucessfully achieve a

  • Blending options / knockout functionality problem in PS CC 2014

    Hello! I've been experimenting with blending options and especially the knockout effect recently, and have discovered that it's function doesn't appear to work correctly. For example: If I have a basic three layer setup as described under; The only w

  • Server Configuration - Limitation

    Environment Details:  XI 3 Build 12.1.8.1176 OS :  Windows 2003 R2 SP 2 Standard Edition Memory: Xenon X5355 -2.66 GHz on VM - 4 GB RAM Number of Web I Process - 2 on 1 machine. Development approch taken is, refresh reports, store as Web I with data,

  • How to create Activity to a Service Call

    Hi, how can i create an activity to a service call? i have to create an activity first and then add a line in the activities collection of the service call, right? but i always get an error message, when i want to create the contact. Error-Message: "