on 01-20-2014 5:32 PM
Hello ,
I am downloading excel file using class~method
CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE
but I am getting a blank column at first position(A). All the data are correctly downloaded starting from Column B.
Steps I have done :
1. Get data from App server using Open dataset and populate internal table
2. Convert internal table into string
3. convert string into xstring
4. call the above method
Please let me know where I am doing wrong.
Thanks
Use the following dummy code.
" Header details.
CONCATENATE
<Header details..>
cl_abap_char_utilities=>newline
INTO lv_text2
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
" Actual data..
LOOP AT lt_srvr_mstr INTO ls_srvr_mstr.
<Main Data>
cl_abap_char_utilities=>newline
INTO lv_text1
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CONCATENATE lv_text2 lv_text1 INTO lv_text.
CLEAR lv_text2.
CLEAR ls_srvr_mstr.
ENDLOOP.
DATA : lv_xstring TYPE xstring.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = lv_text
IMPORTING
buffer = lv_xstring
............
.............
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Chandra ,
Thanks for your input .
Just one correction :
LOOP AT lt_srvr_mstr INTO ls_srvr_mstr.
<Main Data>
cl_abap_char_utilities=>newline
INTO lv_text1
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CONCATENATE lv_text2 lv_text1 INTO lv_text.
CLEAR lv_text2.
CLEAR ls_srvr_mstr.
ENDLOOP.
here CLEAR lv_text1 should be in place of CLEAR lv_text2.
Hi Jitendra,
While converting Internal table records into String, you might be using the statement as below.
loop ....
concatenate lv_string
..... (table fields)
.....(table fields )
cl_abap_char_utilities=>new_line
INTO lv_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
endloop.
Remove lv_string immediately which is after concatenate, otherwise it introduces Blank Column.
loop ....
concatenate
..... (table fields)
.....(table fields )
cl_abap_char_utilities=>new_line
INTO lv_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
endloop.
Hope this is helpful.
Regards,
Ravikiran.k
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitendra,
I suspect something is going wrong while converting data in step 2 & 3.
Please go through the below links
Exporting Internal Table contents to an Excel File
Download a file into excel sheet - Web Dynpro ABAP - SCN Wiki
If your issue is still not solved, please share the piece of code to convert data to excel.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.