Formatting excel using 'SO_NEW_DOCUMENT_ATT_SEND_API1'
Hi,
I am having an issue in formatting excel content while sending as an attachment through a mail. I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'. I am getting an excel output as an attachment with the mail, but I would like to do formatting too in excel like add straight lines or add color to headings. Is this possible ?? I tried searching for this solution but I ain't getting anywhere. Please help if you have got any.
Regards
Raj.
Hey Guys,
Thanks for the help.. but it is not useful for me. I already said I am able to get the output in excel format with data in correct column headings. I just want an example or a link where the formatting of adding vertical lines between data and coloring of headings are done before attaching to the mail.
Regards
Raj.
Similar Messages
-
Blank line in excel using SO_NEW_DOCUMENT_ATT_SEND_API1
Hi Experts
I have a small issue while using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1". I am sending an excel file using this function module, but in the mail, the excel has one blank row on top. My client people doesnt want it.
Is there any method where we can control this in the program. I m filling pack list like below
CLEAR i_pack_list-transf_bin.
i_pack_list-head_start = 1.
i_pack_list-head_num = 1.
i_pack_list-body_start = 1.
i_pack_list-body_num = i_lines.
i_pack_list-doc_type = 'RAW'.
APPEND i_pack_list.
DESCRIBE TABLE i_excel LINES i_lines.
READ TABLE i_excel INDEX i_lines.
i_pack_list-transf_bin = 'X'.
i_pack_list-head_start = '1'.
i_pack_list-head_num = '1'.
i_pack_list-body_start = '1'.
i_pack_list-body_num = i_lines.
i_pack_list-doc_type = 'XLS'.
i_pack_list-obj_name = 'Propose UWYR Results'.
CONCATENATE 'Propose UWYR Results' sy-datum INTO i_pack_list-obj_descr SEPARATED BY space.
i_pack_list-obj_langu = 'E'.
i_pack_list-doc_size = i_lines * 255.
APPEND i_pack_list.
CLEAR i_pack_list.
Please suggest me if there is any other alternative.
Thanks
PraveenClear i_pack_list. and then ,
Remove lines in BOLD.
READ TABLE i_excel INDEX i_lines.
i_pack_list-transf_bin = 'X'.
i_pack_list-head_start = '1'.
i_pack_list-head_num = '1'.
i_pack_list-body_start = '1'.
i_pack_list-body_num = i_lines.
i_pack_list-doc_type = 'XLS'.
i_pack_list-obj_name = 'Propose UWYR Results'.
CONCATENATE 'Propose UWYR Results' sy-datum INTO i_pack_list-obj_descr SEPARATED BY space.
i_pack_list-obj_langu = 'E'.
i_pack_list-doc_size = i_lines * 255.
APPEND i_pack_list.
CLEAR i_pack_list.
Now issue will be solved
Edited by: Harsh Bhalla on Nov 26, 2009 4:39 PM -
Xml report output in excel format without using options tab in EBS
How to get xml publisher report output in excel format without using options tab in EBS?
I am getting XML Publisher report output in excel format by using options tab while submitting the concurrent request .
But i want to get excel output automatically.
Can anyone give idea to get XML publisher Report output in excel without selecting options tab.
Thanks in advance
Sandeep VHey Sandeep,
I am working on a similar format for a report and if possible can you please give me some guidelines. I have initially created reports using XML Publisher, but for those , the output preview format was PDF. So, if I select the preview format as EXCEL will it give me output in Excel and for this to happen, how do I define the rtf template. I believe the working will be same as for PDF, create a rdf report, get output in XML and apply the template to get the data in Excel or there is something different to this.
Thanks,
Sunil -
FORMAT Excel Colums using ABAP
Hi ,
I need to format excel rows and columns .
Ex: I need to add border to the entire table and not just the title .
I used CALL METHOD of wf_range 'BorderAround'
EXPORTING
1 = 1
2 = 4 .
This puts a box around the cell. What i want to do this for multiple cells and not handle it at for each cell.
like if my range is E1 to F3 then border is around ever cell. A2 A3 F2 F2 and not just around A2 to F3.
Please helpHi.
You can record macros in excel and look at generated visual basic code. Then you should convert it into ABAP code. -
Controlling the data formatting in excel using jsp.
Hi,
How to controlling the data formatting in excel using jsp with out using external jar files such as "jexcel" and "POI". And one more limitation is that it should be compatible with java 1.2.1dineshniot wrote:
Hi - Is there any possibility to automatically display the chart for the logged datas using write to measurement file or write to data file? Please let me know as soon as possible.
Thanks and Regards,
Dinesh
As an aside, "data" is already a plural. The singular is "datum."
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How can I disenable the EXCEL field format when use ALV download to excel ?
Dear friends,
I have a problem with the ALV download to EXCEL. One field Value in ALV is like u2018-abcdeu2026u2019.the character u201C-u201Cis the first position in field value.when I download the value to EXCEL,the field value u2018-abcdeu2026u2019 changed u2018=-abcdeu2026u2019 in EXCEL.how can I remove u2018=u2019 in EXCEL when I down to excel used ALV.
I add a space in u2018 -abcdeu2026u2019,So this value can be download to Excel .
Have you any solve method?
User does not use excel logo button to download.
User use Local fileu2026 button to download
Thanks
Sunadd a single quote to the beginning of the field.
like: '-abcde
in excel it will be shown as : -abcde -
E-mail functionality using so_new_document_att_send_api1
Hi
We Implemented E-mail functionality in our tool useing "so_new_document_att_send_api1" standard FM but here im unable to attach excel document .How to attach a excel document in this standard FM plz help.
Asifhi try this code
*& Report ZTEST_2 *
*& Report ZTEST_2 *
REPORT ztest_2 .
TYPES : BEGIN OF t_email_update_iw32,
aufnr LIKE viaufks-aufnr,
vornr LIKE afvc-vornr,
text(220),
END OF t_email_update_iw32.
DATA : gt_email_update_iw32 TYPE STANDARD TABLE OF t_email_update_iw32,
gw_email_update_iw32 TYPE t_email_update_iw32.
TYPES : BEGIN OF t_email_date_error,
aufnr LIKE viaufks-aufnr,
prueflos LIKE qamr-prueflos,
merknr LIKE qamr-merknr,
text(220),
END OF t_email_date_error.
DATA : gt_email_date_error TYPE STANDARD TABLE OF t_email_date_error,
gw_email_date_error TYPE t_email_date_error.
TYPES : BEGIN OF t_email_conf_doc_error,
aufnr LIKE viaufks-aufnr,
vornr LIKE afvc-vornr,
text(220),
END OF t_email_conf_doc_error.
DATA : gt_email_conf_doc_error TYPE STANDARD TABLE OF
t_email_conf_doc_error,
gw_email_conf_doc_error TYPE t_email_conf_doc_error.
SELECTION-SCREEN : BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS : cb_email AS CHECKBOX DEFAULT 'X'.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT (16) text-007 FOR FIELD p_email1.
PARAMETERS : p_email LIKE somlreci1-receiver,
p_email1 LIKE adr6-smtp_addr.
PARAMETERS : p_table1 AS CHECKBOX,
p_table2 AS CHECKBOX,
p_table3 AS CHECKBOX.
SELECTION-SCREEN : END OF BLOCK b4.
CLEAR gw_email_update_iw32.
REFRESH gt_email_update_iw32.
gw_email_update_iw32-aufnr = '1234567'.
gw_email_update_iw32-vornr = '0010'.
gw_email_update_iw32-text = 'This is table1'.
APPEND gw_email_update_iw32 TO gt_email_update_iw32.
CLEAR gw_email_update_iw32.
gw_email_update_iw32-aufnr = '4564578'.
gw_email_update_iw32-vornr = '0020'.
gw_email_update_iw32-text = 'This is table1'.
APPEND gw_email_update_iw32 TO gt_email_update_iw32.
gw_email_date_error-aufnr = '222615'.
gw_email_date_error-prueflos = '1111'.
gw_email_date_error-merknr = '2222'.
gw_email_date_error-text = 'This is table2'.
APPEND gw_email_date_error TO gt_email_date_error.
gw_email_date_error-aufnr = '222615'.
gw_email_date_error-prueflos = '3333'.
gw_email_date_error-merknr = '4444'.
gw_email_date_error-text = 'This is table2'.
APPEND gw_email_date_error TO gt_email_date_error.
gw_email_conf_doc_error-aufnr = '9900107987'.
gw_email_conf_doc_error-vornr = '999999'.
gw_email_conf_doc_error-text = 'This is table3'.
APPEND gw_email_conf_doc_error TO gt_email_conf_doc_error.
gw_email_conf_doc_error-aufnr = '9900107987'.
gw_email_conf_doc_error-vornr = '999999'.
gw_email_conf_doc_error-text = 'This is table3'.
APPEND gw_email_conf_doc_error TO gt_email_conf_doc_error.
DATA : lw_space VALUE ''.
SET PARAMETER ID 'ZPDF' FIELD lw_space.
DATA : pripar LIKE pri_params.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_parameters = pripar
line_size = 255
layout = 'X_65_132'
no_dialog = 'X'
IMPORTING
out_parameters = pripar
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
RESERVE 5 LINES.
DATA : text1(10) TYPE c VALUE 'AUFNR',
text2(10) TYPE c VALUE 'VORNR',
text3(50) TYPE c VALUE 'TEXT'.
IF p_table1 = 'X'.
WRITE AT 10 text1. WRITE AT 30 text2 . WRITE AT 30 text3.
LOOP AT gt_email_update_iw32 INTO gw_email_update_iw32.
WRITE : / gw_email_update_iw32-aufnr , gw_email_update_iw32-vornr ,
gw_email_update_iw32-text.
ENDLOOP.
ENDIF.
WRITE : / sy-uline .
IF p_table2 = 'X'.
WRITE : / 'AUFNR' , 'PRUEFLOS' , 'MERKNR', 'TEXT' .
LOOP AT gt_email_date_error INTO gw_email_date_error.
WRITE : / gw_email_date_error-aufnr, gw_email_date_error-prueflos,
gw_email_date_error-merknr,gw_email_date_error-text.
ENDLOOP.
ENDIF.
WRITE : / sy-uline .
IF p_table3 = 'X'.
WRITE : / 'AUFNR' , 'VORNR' , 'TEXT' .
LOOP AT gt_email_conf_doc_error INTO gw_email_conf_doc_error.
WRITE : / gw_email_conf_doc_error-aufnr,
gw_email_conf_doc_error-vornr, gw_email_conf_doc_error-text.
ENDLOOP.
ENDIF.
NEW-PAGE PRINT OFF.
DATA : mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : rqident LIKE tsp01-rqident ,
rqcretime LIKE tsp01-rqcretime .
SELECT rqident rqcretime FROM tsp01
INTO (rqident,rqcretime)
WHERE rqowner = sy-uname
ORDER BY rqcretime DESCENDING.
EXIT.
ENDSELECT.
DATA: spool_id LIKE tsp01-rqident.
MOVE rqident TO spool_id.
DATA : p_file LIKE rlgrap-filename VALUE 'C:\file.pdf' ,
numbytes TYPE i,
cancel.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spool_id
NO_DIALOG =
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
PDF_SPOOLID =
LIST_PAGECOUNT =
BTC_JOBNAME =
BTC_JOBCOUNT =
TABLES
pdf = mtab_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
end
DATA : w_buffer TYPE string. "To convert from 132 to 255
DATA : i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
LOOP AT mtab_pdf.
Replacing space by ~
TRANSLATE mtab_pdf USING ' ~'.
CONCATENATE w_buffer mtab_pdf INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~ ' .
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
*start try
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA : tab_lines TYPE c.
doc_chng-obj_name = 'TEST'.
doc_chng-obj_descr = 'Mail came successfully'.
objtxt = 'Regards'.
APPEND objtxt.
objtxt = 'Nitin'.
APPEND objtxt.
objtxt = 'hahaha'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
* ERSTELLEN DES EINTRAGS ZUM KOMPRIMIERTEN DOKUMENT
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
* ERSTELLEN DER ANLAGE FUR DAS DOKUMENT
**OBJBIN = '\O/ '. APPEND OBJBIN.
**OBJBIN = ' '. APPEND OBJBIN.
**OBJBIN = ' / \ '. APPEND OBJBIN.
LOOP AT i_record.
objbin[] = i_record[].
ENDLOOP.
DESCRIBE TABLE objbin LINES tab_lines.
*objhead = 'picasso.txt'. APPEND objhead.
* Erstellen des Eintrags zur komprimierten Anlage
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
objpack-obj_name = 'PDF File received '.
objpack-obj_descr = 'PDF File received '.
*objpack-doc_size = ( tab_lines ) * 255 .
APPEND objpack.
* Fullen der Empfangerliste
refresh reclist.
reclist-rec_type = 'U'.
reclist-receiver = p_email1.
APPEND reclist.
reclist-rec_type = 'B'.
reclist-receiver = sy-uname.
APPEND reclist.
reclist-rec_type = 'U'.
reclist-receiver = p_email.
APPEND reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99. -
Convert contents of a formatted excel cell to HTML format
Hi All,
Background: I am writing a script that uploads some test cases written in excel into Quality Center. For those who are familiar with the QC Excel Addin, this script would do a pretty similar job except for reducing
the steps involved. I'm using Office 2007 running on Win 7 Pro.
Need: I have a situation where the contents of a formatted excel cell need to be converted to HTML tags representing the same formattin in the excel cell. For example a cell containg the text: "Verify
if help topics in Macro section are
hyperlinked" should be converted to
<html><b>Verify</b> if help topics in <u>Macro section</u> are <i>hyperlinked</i></html>
Question: Is there an inbuilt function in Excel/VBAn accomplish this? Or is a macro required? Any other ideas to accomplish this?
Note: Whatever used for converting (an inbuilt function or a macro) should support new line characters and colors.
Any help or redirection to solutions is appreciated.
Thanks, John.
--Thanks, John Jacob TharakanHere is the function I wrote. This handles the conversion character by character.
Function fnConvert2HTML(myCell As Range) As String
Dim bldTagOn, itlTagOn, ulnTagOn, colTagOn As Boolean
Dim i, chrCount As Integer
Dim chrCol, chrLastCol, htmlTxt As String
bldTagOn = False
itlTagOn = False
ulnTagOn = False
colTagOn = False
chrCol = "NONE"
htmlTxt = "<html>"
chrCount = myCell.Characters.Count
For i = 1 To chrCount
With myCell.Characters(i, 1)
If (.Font.Color) Then
chrCol = fnGetCol(.Font.Color)
If Not colTagOn Then
htmlTxt = htmlTxt & "<font color=#" & chrCol & ">"
colTagOn = True
Else
If chrCol <> chrLastCol Then htmlTxt = htmlTxt & "</font><font color=#" & chrCol & ">"
End If
Else
chrCol = "NONE"
If colTagOn Then
htmlTxt = htmlTxt & "</font>"
colTagOn = False
End If
End If
chrLastCol = chrCol
If .Font.Bold = True Then
If Not bldTagOn Then
htmlTxt = htmlTxt & "<b>"
bldTagOn = True
End If
Else
If bldTagOn Then
htmlTxt = htmlTxt & "</b>"
bldTagOn = False
End If
End If
If .Font.Italic = True Then
If Not itlTagOn Then
htmlTxt = htmlTxt & "<i>"
itlTagOn = True
End If
Else
If itlTagOn Then
htmlTxt = htmlTxt & "</i>"
itlTagOn = False
End If
End If
If .Font.Underline > 0 Then
If Not ulnTagOn Then
htmlTxt = htmlTxt & "<u>"
ulnTagOn = True
End If
Else
If ulnTagOn Then
htmlTxt = htmlTxt & "</u>"
ulnTagOn = False
End If
End If
If (Asc(.Text) = 10) Then
htmlTxt = htmlTxt & "<br>"
Else
htmlTxt = htmlTxt & .Text
End If
End With
Next
If colTagOn Then
htmlTxt = htmlTxt & "</font>"
colTagOn = False
End If
If bldTagOn Then
htmlTxt = htmlTxt & "</b>"
bldTagOn = False
End If
If itlTagOn Then
htmlTxt = htmlTxt & "</i>"
itlTagOn = False
End If
If ulnTagOn Then
htmlTxt = htmlTxt & "</u>"
ulnTagOn = False
End If
htmlTxt = htmlTxt & "</html>"
fnConvert2HTML = htmlTxt
End Function
Function fnGetCol(strCol As String) As String
Dim rVal, gVal, bVal As String
strCol = Right("000000" & Hex(strCol), 6)
bVal = Left(strCol, 2)
gVal = Mid(strCol, 3, 2)
rVal = Right(strCol, 2)
fnGetCol = rVal & gVal & bVal
End Function
--Thanks, John Jacob Tharakan -
How to Download displayed output to Excel Using Bsp Application
Hi Experts,
please give me some idea because I am New In BSP.
How to Download displayed output to Excel Using Bsp Application.
If any sample code please do send me.
In my condition I am getting data in 2-3 table view formats on one page and i want download that in Excel.
please help me.
Regards & Thanks,
YogeshHi,
This is more a question for the BSP forum.
Anyway, as such it's realy easy since you can use HTML in order to import to Excel. All you need to do is add
runtime->server->response->set_header_field( name = 'Contnet-Type'
value = 'application/vnd.ms-excel' ).
runtime->server->response->delete_header_field( name = 'Cache-Control' ).
runtime->server->response->delete_header_field( name = 'Expires' ).
runtime->server->response->delete_header_field( name = 'Pragma' ).
Also check threads like
Download BSP data into Excel
export bsp-table to excel
Export BSP Table to Excel
Eddy
PS. Reward useful answers and earn points yourself -
ALV TO EXCEL Using 'ALV_XXL_CALL'
Hi,
This is very urgent. you will reward points.
We are trying to convert ALV TO EXCEL using this FM 'ALV_XXL_CALL'
we are getting' Type conflict Error'.
i_fieldcat TYPE slis_t_fieldcat_alv. " Field catalog
w_fieldcat TYPE slis_fieldcat_alv.
Column 1
w_fieldcat-col_pos = v_pos.
w_fieldcat-row_pos = 1.
w_fieldcat-tabname = 'I_OUTPUT'.
w_fieldcat-fieldname = c_deptno. "Dept code
w_fieldcat-seltext_l = 'Afdeling'(001).
w_fieldcat-just = c_just.
w_fieldcat-fix_column = 'X'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
Column 2
v_pos = v_pos + 1.
w_fieldcat-col_pos = v_pos.
w_fieldcat-row_pos = 1.
w_fieldcat-tabname = 'I_OUTPUT'.
w_fieldcat-fieldname = c_deptname. "Dept name
w_fieldcat-seltext_l = 'Naam afdeling'(002).
w_fieldcat-just = c_just.
w_fieldcat-fix_column = 'X'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
i_tabname = 'I_OUTPUT'
it_fieldcat = i_fieldcat[]
tables
it_outtab = i_output[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3
please let me know row pos & col pos is correct to convert Excel and also what is field in field catalog for columm heading in Excel sheet? Give me some sample code.hi,
check your fieldname parameter in fieldcat. pass it in caps btween ''
check my example program
REPORT ZSKC_ALV_XXL.
TYPE-POOLS : KKBLO.
DATA : ITAB LIKE T100 OCCURS 0,
T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
START-OF-SELECTION.
Get data.
SELECT * UP TO 20 ROWS
FROM T100
INTO TABLE ITAB
WHERE SPRSL = SY-LANGU.
CHECK SY-SUBRC EQ 0.
Create the field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'T100'
CHANGING
CT_FIELDCAT = T_FCAT_LVC[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
make sure you pass the correct internal table name in the field catalog.
t_fcat_lvC-tabname = 'ITAB'.
MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
Transfer to KKBLO format.
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = T_FCAT_LVC[]
IMPORTING
ET_FIELDCAT_KKBLO = T_FCAT_KKB
EXCEPTIONS
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
Call XXL.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'ITAB'
IT_FIELDCAT = T_FCAT_KKB
TABLES
IT_OUTTAB = ITAB[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC 0.
ENDIF.
regards
prasanth -
Sending a formatted Excel sheet as an attachment in a mail.
Hi ,
I have been using following code to to send formatted excel sheet as attachment in email.
in the below code I want to change the format of cell from Bold to Underline.
I have replaced Bold with Underline for below code but it is not working can anyone suggest on this.
Department
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ).
r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ).
r_data = l_document->create_simple_element( name = 'Data' value = 'MATNR' parent = r_cell ).
r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ).
r_format->set_attribute_ns( name = 'Bold' prefix = 'ss' value = '1' ).
Creating a ixml Factory
l_ixml = cl_ixml=>create( ).
Creating the DOM Object Model
l_document = l_ixml->create_document( ).
Create Root Node 'Workbook'
l_element_root = l_document->create_simple_element( name = 'Workbook' parent = l_document ). l_element_root->set_attribute( name = 'xmlns' value = 'urn:schemas-microsoft-com:office:spreadsheet' ). ns_attribute = l_document->create_namespace_decl( name = 'ss' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:spreadsheet' ). l_element_root->set_attribute_node( ns_attribute ). ns_attribute = l_document->create_namespace_decl( name = 'x' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:excel' ). l_element_root->set_attribute_node( ns_attribute ).
Create node for document properties.
r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT' parent = l_element_root ). l_value = sy-uname. l_document->create_simple_element( name = 'Author' value = l_value parent = r_element_properties ).
Styles
r_styles = l_document->create_simple_element( name = 'Styles' parent = l_element_root ).
Style for Header
r_style = l_document->create_simple_element( name = 'Style' parent = r_styles ). r_style->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Header' ). r_format = l_document->create_simple_element( name = 'Font' parent = r_style ).
Worksheet
r_worksheet = l_document->create_simple_element( name = 'Worksheet' parent = l_element_root ). r_worksheet->set_attribute_ns( name = 'Name' prefix = 'ss' value = 'PO Details' ).
Table
r_table = l_document->create_simple_element( name = 'Table' parent = r_worksheet ). r_table->set_attribute_ns( name = 'FullColumns' prefix = 'x' value = '1' ). r_table->set_attribute_ns( name = 'FullRows' prefix = 'x' value = '1' ).
Column Formatting
r_column = l_document->create_simple_element( name = 'Column' parent = r_table ). r_column->set_attribute_ns( name = 'Width' prefix = 'ss' value = '70' ). r_column = l_document->create_simple_element( name = 'Column' parent = r_table ). r_column->set_attribute_ns( name = 'Width' prefix = 'ss' value = '70' ). r_column = l_document->create_simple_element( name = 'Column' parent = r_table ). r_column->set_attribute_ns( name = 'Width' prefix = 'ss' value = '70' ). r_column = l_document->create_simple_element( name = 'Column' parent = r_table ). r_column->set_attribute_ns( name = 'Width' prefix = 'ss' value = '70' ). r_column = l_document->create_simple_element( name = 'Column' parent = r_table ). r_column->set_attribute_ns( name = 'Width' prefix = 'ss' value = '70' ).
Blank Row
r_row = l_document->create_simple_element( name = 'Row' parent = r_table ).
Column Headers Row
r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). r_row->set_attribute_ns( name = 'AutoFitHeight' prefix = 'ss' value = '1' ).
Sr. No.
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'EBELN' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ).
User Name
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'EBELP' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ).
Full Name
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'AEDAT' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ).
Department
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'MATNR' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). r_format->set_attribute_ns( name = 'Bold' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Interior' parent = r_style ). r_format->set_attribute_ns( name = 'Color' prefix = 'ss' value = '#C0C0C0' ). r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss' value = 'Solid' ). r_format = l_document->create_simple_element( name = 'Alignment' parent = r_style ). r_format->set_attribute_ns( name = 'Vertical' prefix = 'ss' value = 'Center' ). r_format->set_attribute_ns( name = 'WrapText' prefix = 'ss' value = '1' ).
Data Table
LOOP AT it_ekpo INTO wa_ekpo. r_row = l_document->create_simple_element( name = 'Row' parent = r_table ).
Sr. No.
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ).
r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ).
l_value = sy-tabix.
CONDENSE l_value NO-GAPS.
r_data = l_document->create_simple_element( name = 'Data' value = l_value parent = r_cell ). " Data
r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'Number' ). " Cell format
EBELN
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). l_value = wa_ekpo-ebeln. r_data = l_document->create_simple_element( name = 'Data' value = l_value parent = r_cell ). " Data r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). " Cell format
EBELP
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). l_value = wa_ekpo-ebelp. r_data = l_document->create_simple_element( name = 'Data' value = l_value parent = r_cell ). " Data r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). " Cell format
AEDAT
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). l_value = wa_ekpo-aedat. r_data = l_document->create_simple_element( name = 'Data' value = l_value parent = r_cell ). " Data r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). " Cell format
MATNR
r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). l_value = wa_ekpo-matnr. r_data = l_document->create_simple_element( name = 'Data' value = l_value parent = r_cell ). " Data r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). " Cell format ENDLOOP.
Creating a Stream Factory
l_streamfactory = l_ixml->create_stream_factory( ).
Connect Internal XML Table to Stream Factory
l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
Rendering the Document
l_renderer = l_ixml->create_renderer( ostream = l_ostream document = l_document ). l_rc = l_renderer->render( ).
Saving the XML Document
l_xml_size = l_ostream->get_num_written_raw( ).
Before sending the mail,
LOOP AT l_xml_table INTO wa_xml.
CLEAR objbin.
objbin-line = wa_xml-data.
APPEND objbin to BINARY_CONTENT.
ENDLOOP.
Here, objbin is of type SOLIX and BINARY_CONTENT is of type SOLIX_TAB.
Now, call the method,
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING I_ATTACHMENT_TYPE = 'XLS'
I_ATTACHMENT_SUBJECT = 'My attachment'
I_ATT_CONTENT_HEX = BINARY_CONTENT .Try this..
r_format->set_attribute_ns( name = 'Underline' prefix = 'ss' value = 'Single' ). -
What Format Is Used for eprint Emails?
I'm interested in generating eprint jobs from a Linux machine, so I'm wondering what format is used, and how you cope with email gateways which can accomodate messages of limited size.
Can somebody assist please?
Regards ..Hi Graham,
Try keeping the email size to less than 5MB for faster printing.
http://h71036.www7.hp.com/hho/us/en/ep/articles/eprint-mobile-printing.html
What e-mail clients can I use?The following e-mail clients have been tested by HP ePrint*:
Outlook 2003, 2007
Hotmail, Yahoo! Mail, Gmail
Apple Mail (iPhone, iPad, Macbook, Macbook Pro )
BlackBerry mail client
Nokia/Symbian client (Nokia)
What attachments can I send?HP ePrint will print e-mail attachments for the following file types**:
Microsoft Word
Microsoft PowerPoint
Microsoft Outlook
Microsoft Excel
HTML
Text files (.txt)
PDF
Images (bmp, jpg, png, gif, tiff)
Do e-mail attachments have size limits? There is a 5 MB total limit, and a maximum of 10 attachments to a single e-mail. E-mails that exceed these limits will not print.
Hope this helps.
I work for HP. -
Hi,
I just recognized that the excel files which I can download from my OBI/Answers reports or which I used to send to customers are HTML formated excel files. I also found a remark in the Oracle OBI documentation.
Now my problem ...those files are much bigger then the ordinary excel files. Opening those files and saving them again as pure excel decreases the size by the factor 10x.
Unluckily some of those files a bigger then 10MB which is the size limit of mails of our mail server. My question is there a way to create normal, non-html formatted excel files (especially for sending them)?
Thanks.The link is very helpful but unluckily it is no solution (maybe there is no solution). If the excel file is in MHTML format it is much too big ...on the other hand it needs to be Excel 2003. So finally the question is still whether it is possible to get am Excel 2003 file without MHTML?
-
Hi,
I am new to BODS.Is it possible to have an set of records as output in Excel using BODS. I really appreciate your quick response.
Thanks,
KumarHi Kumar,
In the current version 3.2, BODS only accepts Excel as a source file. However, you can create CSV and other flat files that you can import into Excel, or you can import XML target files, or export to a database and create an Excel extract.
Using Excel as a target format is not supported.
Christian -
Formatting Excel while rendering from Servlet
I am invoking & displaying contents/data from servlet to Excel using following:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition"," attachment; filename=\"ClientOperationsReport.csv\"");
Before displaying I need to set the formatting parameters of excel, like setting page orientation to landscape, setting column types to date/numeric, etc.
Can this be done?1) Use a 3rd party Java-based .xls generator. See Google.
2) Use textbased csv files which can be opened automatically in the right columns in Excel.
If you go ahead with csv, check http://balusc.xs4all.nl/srv/dev-j2p-csv.html However it handles csv upload, this might give you an idea about the csv design and handling.
Maybe you are looking for
-
Subtotal in ALV using class cl_salv_table
Hello All, I am displaying a LAV using the class 'cl_salv_table'. I want to do a sub total on a field and at the end of each plant data I want to display the custom text "Total for Plant 'P1' " in the subtotal line. Please help me solve this. Thanks,
-
Aspect Ratio Issues in Premier Pro CS 5.5
I'm trying to produce a DVD for my daughter's school and my wife bought me a copy of CS 5.5 to help (thanks lovely wife!). I made a number of rookie mistakes when originally trying to produce the final video, but I think I have managed to correct mos
-
Cannot update or install iSight from Apple site.
I have downloaded this update from the Apple website and my computer is not allowing me to install it: http://support.apple.com/kb/DL502 When I try and open up the udate I get this message from Apple: "iSightUpdater103.pkg" can't be opened because it
-
Output A File To A CDROM!
Hi to all! I have made some Java applications, but now I have a major problem. I want to create an application that outputs a ZIP file to a CD-R. I don't really know if there are some methods in Java that would help me do that, or I should create my
-
How do I remove the iwebsite name from my personal domain name?
I have successfully setup my MobileMe account to use my personal domain name with my website created in iWeb '08. How can I make my web address read www.mydomain.com/welcome as opposed to www.mydomain.com/iwebsitename/welcome ?