2007 Jul 02 8:52 AM
I am having 5 records in ITAB and all these needs to be in the excel attachment along with a mail.
But, when I open the attachment when sent in the mail.
I have all the records in the First Cell.. 1A...
But I need each record in each Colum like 1A, 2A, 3A .....5A.
Please help. I have used the following code.
Actually this will be used in Back ground...
I have gone checked many post in this forum but no one talks abt this in Back ground..
Can any one please help.
My requirement in a nut shell .....
Background -> ITAB -> EXCEL -> Attachment - > Mail - Display should be proper.
I will reward with full points for any positive help.
REPLY ASAP.
Regards
Ramesh
2007 Jul 02 8:57 AM
Hello,
DO like this.
CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
CON_TAB TYPE X VALUE '09'. "OK for non Unicode
DATA: IT_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
DATA: WA_ATTACHMENT TYPE SOLISTI1.
loop at itab.
if sy-tabix = 1.
concatenate CON_CRET itab-field1 CON_TAB WA_ATTACHMENT.
else.
concatenate WA_ATTACHMENT itab-field1 SEPARATED BY CON_TAB.
endif.
APPEND WA_ATTACHMENT TO IT_ATTACHMENT.
endloop.
Hope this solves ur problem,
Vasanth
I am having 5 records in ITAB and all these needs to be in the excel attachment along with a mail.
But, when I open the attachment when sent in the mail.
I have all the records in the First Cell.. 1A...
But I need each record in each Colum like 1A, 2A, 3A .....5A.
Please help. I have used the following code.
Actually this will be used in Back ground...
I have gone checked many post in this forum but no one talks abt this in Back ground..
Can any one please help.
My requirement in a nut shell .....
Background -> ITAB -> EXCEL -> Attachment - > Mail - Display should be proper.
I will reward with full points for any positive help.
REPLY ASAP.
Regards
Ramesh
2007 Jul 02 8:57 AM
Hello,
DO like this.
CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
CON_TAB TYPE X VALUE '09'. "OK for non Unicode
DATA: IT_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
DATA: WA_ATTACHMENT TYPE SOLISTI1.
loop at itab.
if sy-tabix = 1.
concatenate CON_CRET itab-field1 CON_TAB WA_ATTACHMENT.
else.
concatenate WA_ATTACHMENT itab-field1 SEPARATED BY CON_TAB.
endif.
APPEND WA_ATTACHMENT TO IT_ATTACHMENT.
endloop.
Hope this solves ur problem,
Vasanth
2007 Jul 02 9:02 AM
Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.
PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.
DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.
SELECT * FROM t001 INTO TABLE t100_Lines.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
i_filename = p_file
TABLES
i_tab_sap_data = t100_Lines.
Regards,
Aparna
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |