‎2012 Nov 02 11:21 AM
I am passing my internal table as String into an excel sheet. But i need to Bold and change font etc for some values.
Is there any way i can use xml tags or anything else to get the output i want ?
Would appreciate some help on this.
‎2012 Nov 02 11:30 AM
Is your Itab Data is displayed in SAP List. Or any CHAR255 field of ALV..?
or Do you just have the Data in the ITAB of type String/Char.
‎2012 Nov 05 4:34 AM
Sorry for the delayed reply,
The itab i populate while fetching data is a ztructure .
However, to populate the excel sheet, i pass the values to a new structure in this form
data: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
The structure solisti1 has one component of type SO_TEXT255
Looking forward to your expertise.
‎2012 Nov 05 4:42 AM
yes you can play around with XML tags
Try doing an reverse engineering
save the excel sheet in the form of HTML and try identify the source
and try populating the tag with required values into internal table and then you can achieve it.
see this example, it is achieved in same way what is said
http://www.saptechnical.com/Tutorials/ABAP/email/Index.htm
Regards
S.Janagar
‎2012 Nov 05 4:53 AM
‎2012 Nov 05 5:05 AM
Hi,
You can work with CL_IXML to do this or you can use OLE.
http://wiki.sdn.sap.com/wiki/display/Snippets/Formatted+Excel+as+Email+Attachment
You can find lot of articles for OLE here in SCN.
Thanks,
Shambu
‎2012 Nov 05 5:19 AM
Thanks Shambu but actually i think i cant use OLE cause my program needs to run in the background
‎2012 Nov 05 5:26 AM
‎2012 Nov 05 5:20 AM
Hello,
Befor moving your entries in structure, try using FORMAT INTENSIFIED. I am not sure about font change but you can hit n trial below for BOLD option
1.FORMAT INTENSIFIED INPUT.
WRITE 5 'JOHN'.
FORMAT INTENSIFIED OFF.
2. Addition 1
... COLOR n [ON] or ...COLOR OFF
Color of line background . n can have the following values:
OFF or COL_BACKGROUND Background
1 or COL_HEADING Headers (grayish blue)
2 or COL_NORMAL List body (bright gray)
3 or COL_TOTAL Totals (yellow)
4 or COL_KEY Key columns (bluish green)
5 or COL_POSITIVE Positive threshold value(green)
6 or COL_NEGATIVE Negative threshold value (red)
7 or COL_GROUP Control levels (violet)
Regards,
Deepti
‎2012 Nov 05 6:40 AM
Hi.
Since you mention solisti1 I am asuming that you are using fm SO_NEW_DOCUMENT_ATT_SEND_API1.
You can compose your mail using html with the full power of html in your hand.
Your user can copy and paste the content to Excel while retaining the fancy appearance...
You need to specify the "PACKING_LIST" entry as sopcklsti1-doc_type = 'HTML'
You need to create a string that will contain the full html for the main message or attachment.
When you are done you have to chop the string to fit SOLISTI1-line:
DATA: big_string TYPE string ."Contain the html message
DATA: it_contents TYPE srm_t_solisti1 .
DATA: st_contents LIKE LINE OF it_contents .
DO .
st_contents-line = big_string .
APPEND st_contents TO it_contents .
SHIFT big_string LEFT BY 255 PLACES .
IF big_string IS INITIAL.
EXIT .
ENDIF .
ENDDO .
big_string = '' .
A test:
‎2012 Nov 05 7:21 AM
hi try this tag <b>bold</b>
Reference from
http://stackoverflow.com/questions/9999713/html-text-with-tags-to-formatted-text-in-an-excel-cell