06-03-2013 11:11 AM
How to convert internal table data into excel file and it should send it as a zip attachment with out using OOPs
06-03-2013 1:19 PM
Hi,
first of all you need to convert xstring to binary and then binary to ftext like this
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = xstring
TABLES
binary_tab = binary.
DESCRIBE TABLE binary LINES lv_size.
lv_size = lv_size * 255.
CALL FUNCTION 'SCMS_BINARY_TO_FTEXT'
EXPORTING
input_length = lv_size
TABLES
binary_tab = binary
ftext_tab = ftext
EXCEPTIONS
failed = 1
OTHERS = 2.
06-03-2013 1:02 PM
Ramesh,
here is a discussion made on the topic.
http://scn.sap.com/thread/832484
Hope this helps,
~Athreya
06-03-2013 1:19 PM
Hi,
first of all you need to convert xstring to binary and then binary to ftext like this
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = xstring
TABLES
binary_tab = binary.
DESCRIBE TABLE binary LINES lv_size.
lv_size = lv_size * 255.
CALL FUNCTION 'SCMS_BINARY_TO_FTEXT'
EXPORTING
input_length = lv_size
TABLES
binary_tab = binary
ftext_tab = ftext
EXCEPTIONS
failed = 1
OTHERS = 2.
06-04-2013 6:25 AM
Pankaj,
After using the below code how we can make ZIP with Excel?
It is not working.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = xstring
TABLES
binary_tab = binary.
DESCRIBE TABLE binary LINES lv_size.
lv_size = lv_size * 255.
CALL FUNCTION 'SCMS_BINARY_TO_FTEXT'
EXPORTING
input_length = lv_size
TABLES
binary_tab = binary
ftext_tab = ftext
EXCEPTIONS
failed = 1
OTHERS = 2.
06-04-2013 7:05 AM
06-04-2013 12:10 PM
06-04-2013 2:32 PM
Hi,
You can use this function GUI_EXEC.
Let say you want to use winzip to zip the file then what you should do like this:
use this command --> ' -min -a D:\WALCOTT.ZIP D:\MBARANG.TXT'
D:\MBARANG.TXT --> path to the file you want to Zip
D:\WALCOTT.ZIP --> result zip file
The command above is depends on the software you use to zip.
then
DATA: cmdguiexec(150).
cmdguiexec = cmd.
CALL FUNCTION 'GUI_EXEC'
EXPORTING
command = cmdguiexec.
Hope this help you.
Regards
Pankaj
06-05-2013 4:48 AM
Pankaj,
My requirement.
1. Generate excel sheet as a ZIP file from internal table data.
2. Send mail with zip file as a attachment for the email ids assigned in the program.
3. This program runs in background.
This program should develop with out using OOPs.
06-05-2013 5:59 AM
Why, specifically can you not use oops? Anyway, simply calling provided methods and using provided classes is not object oriented programming. You'd be hard put nowadays to write anything remotely technical without having to access some classes.
You can use abap2xlsx (a collection of classes) which produces a zipped xml format Excel file. Then use CL_BCS and associated classes to send the file. Simple solution. Elegant, supportable. Plenty of material on here on how to use these.
Unless you can come up with a good reason why you cannot use classes and methods to fulfil the business requirement (which is what matters, not some obscure nonsensical internal politics), I will lock this thread. There is no point in reinventing the wheel.
Oh, and here's the kicker: it is not possible to generate excel files in background without usings abap2xlsx without either a) investing a huge amount on time building your own xlsx constructor or b) spending money on a third party product. Tell that to your managers. The business doesn't care what technology you use so long as you fulfill the functionality requirements.
11-22-2013 7:47 AM
Hi Ramesh,
If you find the solution of your requirement,Please share your code,because i have also same requirement.
Thanks