Fixing columns while downloading using GUI_DOWNLOAD!!
Hi,
I have declared an internal table which is downloaded using GUI_DOWNLOAD and after downloading the required outpout should appear in their own place for example:
MATNR MEINS PLANS
123 test1 test2
12 test3 test3
but whats actually happening ...
123test1test2
12test3test3
how to fix the columns so that field value appear in that location only and from the same postion for all the records once downloaded..
Regards
Gunjan
Hi Gunjan,
You can try this:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = v_filename
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = ' '
For ASCII download, if you specify the field separator as spaces, then it will automatically separate fields with TABS.
Hope this helps.
Thanks,
Rajesh
Similar Messages
-
Download using GUI_download
Hi all,
i am trying to download the internal table which have 10 field, into the EXCEL file,
at the same time i wanted into the downloaded file
field name also appear....how can we do that,,
while downloading its appearing in a one column,
i want to shift the every field in different column,
Any idea about that how i will acheive this
Thanks for your help..
ManishHi manish,
1. For the same purpose
i have developed an INDEPENDENT SUBROUTINE/FORM
in which we pass just two things :
a) itab
b) file name with full path
2. It then downloads the file
(ALONG WITH THE FIELD NAMES AT THE TOP)
(We have to use GUI_DOWNLOAD two times,
once for downloading data,
and once for downloading the field names separated
by tab)
3. Just copy paste in new program.
report abc.
data : itab like table of t001 with header line.
select * from t001 into table itab.
perform mydownload tables itab using 'D:\t001.txt'.
INDEPENDENT FORM
form mydownload tables ptab using filename.
DAta
DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.
DATA : allfields(300) TYPE c.
DATA : fld(100) TYPE c.
data : begin of htab occurs 0,
allfields(300) type c,
end of htab.
Get component list
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = sy-repid
fieldname = 'ITAB'
TABLES
components = components.
construct
LOOP AT components.
CONCATENATE components-compname
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO fld.
CONCATENATE allfields fld INTO allfields .
ENDLOOP.
htab-allfields = allfields.
append htab.
download first field list
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'D:\t001.txt'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = htab
then download file data
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = filename
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ptab
endform.
regards,
amit m. -
Problem with header download using GUI_DOWNLOAD
Hi folks,
Iam facing a particular problem while downloading an internal table to excel file using GUI_DOWNLOAD and file type as 'DBF'.
Once i download the file, iam getting an automatic header with contents as "F1, F2, F3,...." for all the columns. But, i want to put my own header there. Is there any way out ?
Thanks and Regards,
Vijay.hi,
may be this code will be helpful to u
Just take one field in header(internal table) of type c. and push all the field headings into it.
and give that internal table to fieldnames it will resolve the problem.
DATA:BEGIN OF HEADER OCCURS 0,
F1(30) TYPE C ,
END OF HEADER.
DATA:BEGIN OF ITEM OCCURS 0,
IT1(30) TYPE C,
IT2(3) TYPE C,
IT3(4) TYPE C,
END OF ITEM.
HEADER-F1 = 'NAME'.
APPEND HEADER.
CLEAR HEADER.
HEADER-F1 = 'AGE'.
APPEND HEADER.
CLEAR HEADER.
HEADER-F1 = 'STAT'.
APPEND HEADER.
CLEAR HEADER.
ITEM-IT1 = 'MANOHAR'.
ITEM-IT2 = '124'.
ITEM-IT3 = 'T'.
APPEND ITEM.
CLEAR ITEM.
ITEM-IT1 = 'SAI'.
ITEM-IT2 = '24'.
ITEM-IT3 = 'T'.
APPEND ITEM.
CLEAR ITEM.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\FILE13.XLS'
FILETYPE = 'DBF'
tables
data_tab = ITEM
FIELDNAMES = HEADER.
regards,
manohar. -
Headings not downloaded using GUI_DOWNLOAD, used DBF as a file type
Hello,
I have used the function module to download the data into an excel file using GUI_DOWNLOAD FM.
I have given the file type as 'DBF', because if I give DAT type then the data for the amount not downloading properly.
and preceeding zero's are not dowloaded properly. Hence used DBF.
But when I use DBF file type , the header texts are not downloaded properly.
CALL FUNCTION GUI_DOWNLOAD
EXPORTING
filename = lw_file
filetype = DBF
TABLES
data_tab = t_output
fieldnames = t_head
fill the header texts for all the fields
TYPES: BEGIN OF ty_head,
name(24),
END OF ty_head.
data: wa_head TYPE ty_head,
t_output TYPE STANDARD TABLE OF ty_output,
wa_head-name = text-t01.
condense wa_head-name.
APPEND wa_head TO t_head.
CLEAR wa_head.
wa_head-name = text-t02.
APPEND wa_head TO t_head.
CLEAR wa_head.
wa_head-name = text-t03.
APPEND wa_head TO t_head.
CLEAR wa_head.
This is the code I have used...but the text is not displaying fully in the file.
If I use DAT, then data will be wrong in some cases.(like zeros.amount in decimals).
Thanks,
AVHI,
I suggest prepare the data in the internal table t_output as per your requirement first so as to avoid the data anomaly & then you can happily used DAT.
Regards
Abhii... -
ALV truncation while download using List--Save/send--File--Spread sheet
Experts,
In ALV output, I am trying to download using menu item
"List --> Save/send --> File --> Spread sheet" then in the popup appears
here if i GIVE the FILE NAME THEN,material number is getting truncated.
If I don't give any file name it is storing as ".xls" and not getting truncated.
How to correct this or avoid this truncation.
OR
If we can't do correction about truncation ...my function consultant is asking to
to disable "List --> Save/send --> File".
Thanks in advance.
SamSolved by my own....
We need to pass
i_fieldcat-no_zero = 'X'.
so that the zeros at the end won't get truncated. -
Getting save as dialog while downloading using download servlet
Hi Folks,
I am developing a web based video download application.In this i intend to download the video file by calling a download servlet.
Though the application works ,that is it downloads the file, the video file is straight away being played by the media player.My objective is to save it in the client machine at the desired location of the hard disk and then play the same later at cient's convenience. This is not happenening with my application.
Pl suggest me as how to get the save as dialog box to save the video file at will.
The site is to be lauched in a weeks time.Pl help!!!
thanks and regards
sathiyam K GHi rupak,
Thanks for the tip.I actually did all the things u said.But the difference is that i rely on http download.
I mean i do not use the servlet output stream to download the video file.If i do so it takes about 20 mins for a 10 MB sample file,to be downloaded via a broad band T1 link.
So i just use href to depend on http by which the download speed is accelerated and my one clip of video of 100MB average size can be downloaded in about 15 min. duration.
If this is not the correct way of working for the video download will u pl suggest me any other way through servlet, i can download with the above specified speed.
i am clear if i use the servlet output stream the download process is deadly slow.
so pl suggest!!
thanks again
regards
sathiyam K G -
Is it possible to have a fixed column width and a URL link?
I am trying to achieve having a popup link on a column within a SQL report but also have the report column a certain width. I can have either or however not at the same time.
What I did was created a SQL report, edited a column and gave it a URL redirect (page in application) as normal.
For the fixed column width, I used:
<div style="width:250px; height:54px; overflow:hidden" title="#Comments#">#Comments#</div>On Column Formatting / HTML Expression
And for the popup URL, I used:
onclick="window.open(this.href,'_blank','resizable=0,scrollbars=0,width=650,height=300,menubar=0,location=0');return false;" title="Comments"On the Column Link / Link AttributesAndy thank you for your reply, however I either am not completly understanding or there is a problem elsewhere.
I have changed to the code to fit the needs of the application as so:
!http://i41.tinypic.com/2m6mrh4.jpg!
App ID: 523
Page: 23
Item: P23_STATUS_COMMENT
Column to select: Comments
Whenever clicking on the link, the following error is given:
Expecting p_company or wwv_flow_company cookie to contain security group id of application owner.
Error ERR-7620 Could not determine workspace for application ().{code} -
Error while downloading output in excel format using FM Gui_download
Hello All,
<removed by moderator>
While downloading the necessary output of a Ztransaction in excel format the excel file only shows one 1 record whereas in the output there were 88 records.
When I am downloading it in other formats like Rich text etc. the data is getting downloaded correctly as per the output.
Now this problem is occuring in Production & Quality whereas in Development the excel file is downloading data correctly.
I have compared the code in the different clients as well as debugged it but the code is the same in each case.
There is no data corruption in the final internal table as well.
So what else can be done?....
The data needs to be downloaded as it is in the output in the excel format.
Kindly give me some suggestion and help me out in this regard.
Edited by: Thomas Zloch on Nov 1, 2011 10:04 AMHi,
Did you the use the GUO_download using the following values:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = fullpath
filetype = 'ASC'
codepage = space
write_bom = 'X'
TABLES -
Data missing while downloading the data using GUI_DOWNLOAD
Hi experts,
I'm uploading the Production Order data through excel and in the transaction level it's happening fine.
After running the BDC I'm fetching the Production Order Number(AUFNR) and it's Status from the respective tables and downloading the data along with the Production Order Number(AUFNR) and it's Status using GUI_DOWNLOAD. (Version is 4.6 C)
After downloading some of the Production Order Numbers(AUFNR) and it's Status are missing in the Excel Log sheet . But it's very much there in the SAP tables and also in the transaction screen level.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_bin_filesize
filename = v_name
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_final
EXCEPTIONS
file_write_error = 1
no_batch = 2
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Kindly give me your suggestions regarding this.
Thanks in advance.
JessiHi,
I am not sure why it is not coming .
But try by uncomment the bin_filesize.
Because generally the size(bin_filesize) specification is for binary files .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
*bin_filesize = v_bin_filesize "Comment This
filename = v_name
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_final.
Regards,
Raghava Channooru -
Manipulating excel file while using GUI_DOWNLOAD
hi all,
while using GUI_UPLOAD i want to
1) fix the width of the column of excel file
2) define the font of the data in excel file
3) change background color of the cells in excel file.
please suggest as to how can this be done?using GUI_DOWNLOAD you can't change the data in excel sheet...if you want to do the things you need to use OLE concpets for downloading of data to Excel sheet wherein you can do most of the options excel can handle..
Check within SDN as there are blogs for downloading data to Excel sheet using OLE concepts.. -
Blank spaces while using GUI_DOWNLOAD for Chinese characters
Hi,
While using GUI_DOWNLOAD for chinese characters I have used a code page option of 8300 for Chinese.
The file which is getting downloaded in a notepad has some Chinese characters coming under some headings.
After that columns other columns are getting shifted towards the right.
This is working correctly for English characters.
Can someone please help me.
Now I am using CL_GUI_FRONT_END_SERVICES=>GUI_DOWNLOAD.
What special options should I pass now.
Regards,
SubhashiniHi,
I only solved my problem by using different code pages 8400 and 8300 for Chinese and Taiwanese characters.
I fixed the lengths of the fields by converting them to hexadecimal string and back to string using these function modules as below.
DATA:lv_xstring TYPE xstring,
lv_temp TYPE string.
DATA: lv_conv TYPE REF TO cl_abap_conv_in_ce.
lv_temp = p_name.
CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
EXPORTING
codepage_to = p_codepage
unicode_string = lv_temp
out_len = p_outlen
IMPORTING
xstring_stream = lv_xstring
EXCEPTIONS
invalid_codepage = 1
invalid_string = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
from_codepage = p_codepage
in_xstring = lv_xstring
out_len = p_outlen
IMPORTING
out_string = p_string.
Create a Conversion Instance
lv_conv = cl_abap_conv_in_ce=>create(
encoding = p_codepage
input = lv_xstring ).
v_conv->read( IMPORTING data = p_string ).
Regards,
Subhashini -
How to create column header text while downloading file
How can we create column header text while downloading file using function GUI_DOWNLOAD(in SAP Release 4.6c) because there is no FIELDNAMES parameter in
4.6c version.Hii,
Check this sample code. I have called GUI_DOWNLOAD twice. Onetime to download header of table and next time data of table
REPORT z_file_download.
DATA: w_name(90) TYPE c.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
price LIKE sflight-price,
currency LIKE sflight-currency,
END OF fs_flight.
DATA:
BEGIN OF fs_head,
carrid(10) TYPE c,
connid(10) TYPE c,
fldate(10) TYPE c,
price(10) TYPE c,
curr(10) TYPE c,
END OF fs_head.
DATA:
t_head LIKE
TABLE OF
fs_head.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
fs_head-carrid = 'CARRID'.
fs_head-connid = 'CONNID'.
fs_head-fldate = 'FLDATE'.
fs_head-price = 'PRICE'.
fs_head-curr = 'CURRENCY'.
APPEND fs_head TO t_head.
SELECT-OPTIONS:
s_carrid FOR fs_flight-carrid.
START-OF-SELECTION.
SELECT carrid
connid
fldate
price
currency
FROM sflight
INTO TABLE t_flight
WHERE carrid IN s_carrid.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\flight.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_head
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\flight.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_flight
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
MESSAGE 'Download successful' TYPE 'I'.
ENDIF.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Abhijeet -
Problem on zero's while using gui_download
Hi,
While downloading the internal table content for ex. 000010 to Excel sheet by using GUI_DOWNLOAD , zeros are truncated and becomes 10(in this case).
Is it any possible way to get as like 000010?
Thanksgive the FILETYPE as <b>DBF</b> and checkout if it works
or
in the excel file , right click on that column>format cellschoose text -
Avoid splitting of columns ALV report while download output to Excel sheet
Hi friends,
I have 170 columns in my ALV report
while downloading the report to Excel sheet
the column descriptions and values are splitting in two lines.
How can i avoid the problem.
before calling REUSE_ALV_GRID_DISPLAY function module in my code
for the Layout i assigned LS_LAYOUT-MAX_SIZE = 1023.
but still the problem is not solved.
Please help me in this Issue.
Thanks in Advance,
GaneshHi friends,
I dont want to use and Keyboard shiftcntrl....
or dont want to change any code in ALV report
by simply assigning some value to any of the export parameter in ALV function module
can we achieve the functionality
Thanks in Advance,
Ganesh -
Error while downloading data Using RSCRM_BAPI
Hi Folks,
I am getting the below mentioned error message while downloading the data from BW report to csv file using RSCRM_BAPI.
Can anyone help on this error ?
Internal error in method CHECK_TABLE_NAME (RSCRMBW_EX_NAMESPACE_GET)hi lakshmi:
I also tried to use this t-code. but this has lots of restrictions..and its not recommended to use this t-code for complex queries.There are OSS NOtes out there for restrictions for this t-code.
I got to know from other forums on SDN that there is other RSCRMBW_REPORT FM. which is better to use. but not able to use it... there is specific way for that FM. If you try that and if it works for you please let me also know.
Also, try to look at this forums:
Error Using RSCRM_BAPI T-Code
Problem with RSCRM_BAPI (extraction to Fixed Lenght txt file)
RSCRM_BAPI Schedule and monitor
RSCRM_BAPI
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ba5e590-0201-0010-59b1-cab51fd245b7
Hope this helps.
KSmith
Maybe you are looking for
-
My apple I'd has stopped asking for my password when downloading apps to my iPad. I want it to ask every time. I edited it unknowingly and I need to change it back. Please help! Thx
-
Cost apportionments batch modify
Hi, anybody knows how to batch modify cost apportionments to co-product in materail master data? tks a lot! Duplicate post locked Edited by: Rob Burbank on Dec 29, 2009 1:10 PM
-
It will ntolet me copy paste the embed code by any means not by mouse gestures or by Ctrl C and V If I put the code found on discussions and change the ID in the 2 places when I add to the page it does not show in the page It worked before and now it
-
Where is mail stored under Tiger?
I want to back up old correspondence, both outgoing and incoming. Where are they stored? Thanks.
-
Help from Adobe Premiere Elements 11 users needed
I was a big fan of iMovie 6. Not a fan of any iMovie updates since then. I'm looking for a video editing program that is closer to the old iMovie as opposed to the new one. I would not call myself a novice filmmaker, but do not need anything clos