Download greater than 255 characters from alv into excel sheet
Hi,
I have an ALV grid display report where the last field contains close to 600 characters of text.
When I use the Export -> Local File -> Spreadsheet option and save it in an excel sheet, only first 255 characters are getting downloaded into excelsheet and rest is not gettting downloaded.
Solution I have is: Keep a button on the screen. If that button is clicked, use GUI_DOWNLOAD FM and the entire text (all 600 chars) gets downloaded.
Is there any other solution to the above problem?
I tried downloading the alv report into XML format and opened as an excel document, but even then only first 255 characters are apearing in excel cell.
The domain has length 2048 chars for the final internal table in alv, so there is no problem with data element or domain.
OIn debugging mode, I am able to see all the 600 chars in the final internal table before alv display.
It looks like there is a constraint in alv that is can display only 255 characters in a cell.
ALso, I tried converting the grid display to list display and then download into excel , but the result is same.
Please help.
please search first:
http://www.sdn.sap.com/irj/scn/advancedsearch;jsessionid=%28J2EE3417400%29ID0634234250DB10563517489488469157End?query=downloadmorethan255char
Similar Messages
-
Greater than 255 characters not allowed - CSV attachment
While sending the data as a CSV attachemnent, its not allowing more than 255 characters per line.
I want to send more than 255 characters in a line (in the CSV attacment. how to do this ?
The function module which i used is
SO_new_document_att_send_appi1.
or else suggest me a function module used to send csv attachement more than 255 characters in a line
ThanksCheck below code and adjust your code for compress/decompress...
DATA : l_email_title TYPE sood1-objdes.
DATA : l_file_name TYPE soobjchgi1-obj_descr.
DATA : lit_email_receiver TYPE zphr1_email_tab.
DATA : lit_email_msg LIKE soli.
DATA : lit_attachment LIKE soli.
DATA: l_lines LIKE sy-tabix,
l_msg_lines LIKE sy-tabix.
Creation of the document to be sent
CLEAR: l_email_title,
l_file_name,
lit_email_receiver,
lit_email_msg,
lit_attachment,
gf_doc_chng,
it_objtxt,
it_objbody,
it_objpack,
it_objhead,
it_reclist.
REFRESH: it_objtxt,
it_objbody,
it_objpack,
it_objhead,
it_reclist.
*Passing mail subject
gf_doc_chng-obj_name = text-035.
gf_doc_chng-obj_descr = text-036.
Fill the document data.
gf_doc_chng-doc_size = 1.
Populate the subject/generic message attributes
gf_doc_chng-obj_langu = sy-langu.
gf_doc_chng-obj_name = c_saprpt.
gf_doc_chng-sensitivty = c_value_f.
Fill the document data and get size of attachment
DESCRIBE TABLE it_output_soli LINES l_lines.
gf_doc_chng-doc_size =
( l_lines - 1 ) * 255 + STRLEN( it_output_soli ).
gf_doc_chng-obj_langu = sy-langu.
gf_doc_chng-obj_name = c_saprpt.
gf_doc_chng-sensitivty = c_value_f.
*Passing text for mail body
it_objbody = space.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = c_hi.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = space.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = text-036.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = space.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = c_thanks.
APPEND it_objbody.
CLEAR it_objbody.
it_objbody = space.
APPEND it_objbody.
CLEAR it_objbody.
DESCRIBE TABLE it_objbody LINES l_msg_lines.
READ TABLE it_objbody INDEX l_msg_lines.
gf_doc_chng-doc_size = ( l_msg_lines - 1 ) * 255 + STRLEN( it_objbody
Creation of the entry for the compressed document
it_objpack-transf_bin = ' '.
it_objpack-head_start = 1.
it_objpack-head_num = 0.
it_objpack-body_start = 1.
it_objpack-body_num = l_msg_lines.
it_objpack-doc_type = c_doc_type.
APPEND it_objpack.
CLEAR it_objpack.
LOOP AT it_output_soli.
it_objtxt = it_output_soli.
APPEND it_objtxt.
CLEAR it_objtxt.
ENDLOOP.
Passing the heading of the report
it_objhead = text-037.
APPEND it_objhead.
CLEAR it_objhead.
*To compress the table to size of 255 characters
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = it_objtxt
out = it_comprsd.
IF sy-subrc <> 0.
ENDIF.
To decompress the compressed table
CALL FUNCTION 'TABLE_DECOMPRESS'
TABLES
in = it_comprsd
out = it_decomprsd.
IF sy-subrc <> 0.
ENDIF.
Creation of the document attachment
CLEAR : l_msg_lines,l_lines.
DESCRIBE TABLE it_decomprsd LINES l_lines.
IF l_lines <> 0. "Don't create attachment if no data is present
Creation of the entry for the compressed attachment
it_objpack-transf_bin = c_value_x.
it_objpack-head_start = 1.
it_objpack-head_num = 1.
it_objpack-body_start = 1.
it_objpack-body_num = l_lines.
it_objpack-doc_type = c_excel.
it_objpack-obj_name = sy-repid.
it_objpack-obj_descr = text-036.
it_objpack-doc_size = l_lines * 255.
APPEND it_objpack.
CLEAR it_objpack.
ENDIF.
LOOP AT s_email.
it_reclist-receiver = s_email-low.
it_reclist-rec_type = c_rec_type.
it_reclist-express = c_value_x.
APPEND it_reclist.
ENDLOOP.
*Passing maild of the user(who runs the report)
with extension @eur.appliedbiosystems.com
CLEAR it_reclist.
CONCATENATE sy-uname text-031 INTO it_reclist-receiver.
it_reclist-rec_type = c_rec_type.
it_reclist-express = c_value_x.
APPEND it_reclist.
with extension @applera.com
CLEAR it_reclist.
CONCATENATE sy-uname text-032 INTO it_reclist-receiver.
it_reclist-rec_type = c_rec_type.
it_reclist-express = c_value_x.
APPEND it_reclist.
*Sending mail with attachment
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = gf_doc_chng
put_in_outbox = c_val
commit_work = c_val
TABLES
packing_list = it_objpack
contents_bin = it_decomprsd
contents_txt = it_objbody
receivers = it_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc IS NOT INITIAL.
WRITE: / text-034.
ELSE.
WRITE: / text-033.
ENDIF. -
Download from ALV to excel sheet.
When i am downloading the Alv to excel sheet. I want to get the field descritption also in the excel sheet.
Refer:
https://forums.sdn.sap.com/click.jspa?searchID=14433981&messageID=3603627 -
Export more than 253 characters from ALV column to excel
Hi
I have one problem. In internal table, i have one column which is having 2500 characters. I have to export this column in excel but i am able to export only 253 characters max from alv standard export. How can i export complete column to excel from ALV?
Regards
ManishCreate a new pf status and add a excel button in the menu. While creating new menu, use the standard SAP menu and just change the excel button. SY-UCOMM would &EXCEL. Use GUI_DOWNLOAD to download the excel or the file. It is not achievable using the standard SAP download option.
-
Download Alv into excel sheet according to variant fields
Hi All,
I have more than 100 fields in the ALV report, now i want to download the report according to the fields are choosen in the variant. I am getting all the fields in excel sheet but i need some fileds that is selected in the variant.
Thanks in advance.
Rudhiruse your own excel button and program this steps:
1°
* Get the frontend fieldcatalog
CALL METHOD go_grid->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = lt_fieldcat.
DELETE lt_fieldcat WHERE no_out EQ 'X'.
2°
*create dynamic table with the frontend fieldcatalog
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcat
IMPORTING
ep_table = lt_data
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc EQ 0.
ASSIGN lt_data->* TO <lt_table>.
ENDIF.
3° Fill the dynamic table
4° export to excel using
CALL FUNCTION 'XXL_SIMPLE_API'
TABLES
col_text = xmplt_v1
data = <lt_table>
online_text = xmplt_o1
print_text = xmplt_p1
EXCEPTIONS
dim_mismatch_data = 1
file_open_error =2
file_write_error = 3
inv_winsys =4
inv_xxl =5
OTHERS = 6.
Check the complete example here -
How to download data displayed in a BSP page into Excel sheet
Hi,
I'm displaying an internal table data into tableview of a BSP page. I want to provide a feature to download the tableview contents to Excel sheet from Internet Explorer. How do I do it? Can someone guide me.
Kedhar.Hi Kedhar,
welcome to SDN. You should try to use the Search functionality here. Then you will find this Weblog:
<a href="/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table">Creating a BSP Extension for Downloading a Table</a>.
You can award points if this answer was helpfull.
Regards
Gregor -
Issue with downloaing from ALV to Excel sheet
Hi All,
When we download the ALV Report to excel sheet, the first line/first column (A11) of excel sheet will have today's date.
Since my customer uses the excel sheet for further processing into a non-SAP system, we need to provide the excel sheet with the cell A11 (First line's firls column) as blank.
How can we deliver this requirement?
Your help will be sincerely appreciated....
Regards
PavanOne option is there
Give him 1 push button on toolbar other wise you can write below function module in
start of selection code also.
1 ) modify u r internal table according to requirement.
2) after that call WS_DOWNLOAD function module.
Check below code for u r reff.
*Modify itab according to u r requirement.
Loop at IST_DWN.
IST_DWN-KUNNR2_DESC = SPACE.
IST_DWN-KUNNR3_DESC = W_ZPPCSR-KUNNR3_DESC .
APPEND IST_DWN.
CLEAR DATE.
ENDLOOP.
*F4 Help for file menu
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = PATH.
RLGRAP-FILETYPE = 'DAT'.
Download fm
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = PATH
FILETYPE = RLGRAP-FILETYPE
MODE = XMODE
IMPORTING
FILELENGTH = L_FILELENGTH
TABLES
DATA_TAB = IST_DWN
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
OTHERS = 3.
Salil ... -
How to export alv into excel sheet without using toolbar button
hi,
i have developed ALV using FM methord on that i have created one button when user will click on that button
hole ALV should export in to excel as it is and that ALV is Heaving top of page contain also i want that shuld
also copy please help me for that please send me the sample code for that
Edited by: ankita khare on Nov 3, 2008 9:42 AMCheck this:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:/test.xls'
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = t_output
Regards. -
Download ICONS from ALV to EXCEL
Dear Friends,
IS there a way of downloading the ICON image exactly
from alv to EXCEL,right now,when the icon is downloaded
from alv to the excel,i can only see ascii characters in
the icon column in the excel.
kind regards
kaushik hegdeHi Jeff,
Please check if following analysis is helpful to you.
Analysis/Solution:
When we export ALV data to excel worksheet, as sap notes say the maximum lenght allowed is 1023 charaters and the max no of columns supported is 90.
(I never faced any issue related to no of columns as it worked fine for columns >90 too)
Issue occured when row size of exported data gets more than 1023 character.
Therefore the row data must not exceed 1023 character, otherwise column splits and moves to next row.
One additional aspect generally missed is that:
When data in any particular column changes it's length, alv header also changes its lengh (short text, medium text, long text; depending on the length of of the longest cell in the column)
therefore even if you have total length of row less than 1023 character, there might be cases when your ALV header size exceeds this length.
Reducing the header size (by forcing to use short text or specifying own header names) should resolve the issue.
Regards,
Parveen -
Sending Emails with Attachments greater than 255 chars in 4.6C
Hi,
I have a requirement in which i have to send mails with attachments greater than 255 characters. The attachment would be a tab-delimited .TXT file. Since i am working on 4.6C, i don't have the luxury of using the FM 'SCMS_STRING_TO_FTEXT'.
It's very urgent. So any help in this regards would be greatly appreciated.
Thank you.
BalajiHi,
Internal table to be passed to SOLIST1 type int, table and then compress this table using fm "table_compress" with the compressed table then call fm "table_decompress" and pass this to function module SO_NEW_DOCUMENT_ATT_SEND_API1.
Keep in mind the following variable
i_packing_list-transf_bin = 'X'.
aRs -
SAP Query:Error 'List is wider than 255 characters '
Hi all,
i m new in SAP Query.
one query is already done.
one change is come out.
requirement is - Add one extra column
when i m going to add one extra coulumn and test it then message is come out.............
List is wider than 255 characters (generation not possible)
Message no. AQ255
Diagnosis
You attempted to define a query where the line width of the generated list is greater than 255 characters.
You define the line width on the Title, Format screen which permits a maximum width of 255 characters. However, when defining statistics and ranked lists, you can implicitly increase this value, since the lines cannot be broken up. This is the case here. An implicit increase in the width of the list would result in a list wider than 255 characters. For this reason, the query cannot be executed.
Procedure
Check which of the statistics or ranked lists is responsible and modify it so that the resulting list width is no greater than 255 characters.
plz help me and suggest me as soon as possiblehi Shafiq ,
i am aslo facing same problem of (List is wider than 255 characters )
There is limitation of 255 characters .. can we extend that .
When we check by editing program in sq01 it show only 255 character limitation .
Regards
Deepak. -
How to transfer data more than 255 char from excel sheet to internal table.
Hello Experts,
I have a requirement where i have a text field in the excel sheet of more than 255 char and need to be updated in the text element. To do that i need to transfer the excel sheet data to an internal table where one of the field is more than 255 char.
in the standard function module it works only upto 255 char. Can you help me if we have some other way to get more than 255 char in the internal table from excel sheet.
Thanks in Advance.
BR,
RaJ.Using .xls, it is not possible transfer data more than 255 characters from excel sheet. However if the excel sheet is saved as Comma Delimited format or Tab Delimited format, then using GUI_DOWNLOAD function module data more than 255 characters can be transferred.
File name should be : .csv (Comma Delimited format) or .txt (Tab Delimited format)
File Type would still remain 'ASC' while calling function module GUI_DOWNLOAD
Also In the internal table declare the field type as String or LCHAR.
Eg:
TYPES: begin of ty_file,
col_a TYPE string,
end of ty_file.
DATA: i_file type standard table
of ty_file
with header line
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\test.csv'
TABLES
DATA_TAB = i_file -
Downloading the data into excel sheet , how can i maintain page numbers
I need some information. In output screen pagenumber is displayed.
when i am downloading the data from se38 into excel sheet.
How can i write the code to display the page number in excel sheet . waiting for your responseHi
Please see below code for ur requirement.
DATA: BEGIN OF li_field OCCURS 0,
field(16) TYPE c,
END OF li_field.
CLEAR li_field[].
REFRESH li_field.
li_field-field = text-t01.
APPEND li_field.
CLEAR li_field.
li_field-field = text-006.
APPEND li_field.
CLEAR li_field.
li_field-field = text-t04.
APPEND li_field.
CLEAR li_field.
li_field-field = text-t05.
APPEND li_field.
CLEAR li_field.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = file_path
TABLES
data_tab = data_table
fieldnames = li_field
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8.
please reward points if helpful -
ALV Cell with more than 255 characters.
Hello Guru's,
I need to display a longtext in ALV with other details. I am using READ_TEXT to get the Longtext and appending it to Internal table field, which i have defined as a string. I have debugged the code and it is containing around 450 characters. But, when i am trying to display using "REUSE_ALV_GRID_DISPLAY" it is only displaying 255 characters.
Please suggest a solution.
Thanks,
Sudhir.Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
The report output can contain up to 90 columns in the display with the wide array of display options.
The commonly used ALV functions used for this purpose are;
1. REUSE_ALV_VARIANT_DEFAULT_GET
2. REUSE_ALV_VARIANT_F4
3. REUSE_ALV_VARIANT_EXISTENCE
4. REUSE_ALV_EVENTS_GET
5. REUSE_ALV_COMMENTARY_WRITE
6. REUSE_ALV_FIELDCATALOG_MERGE
7. REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_GRID_DISPLAY
9. REUSE_ALV_POPUP_TO_SELECT -
SQ01 Output fields having more than 255 characters
Hello,
I need to show query output more than 255 charaters but system is not allowing
Here is the Error message:
List is wider than 255 characters (generation not possible)
I used SQ01 as t-code to create query.
How can i show my output more than 255 characters
ThanksRefer SAP Note 857823, ALV grid cannot display more than 128 characters per field and will truncate all the characters beyond if it's an ABAP program
From my experience it will not display the field at all in SQ01.
You need to write an abap program and split the field into two fields of length 128 and display side by side.
Work around: If you cannot write abap program uncheck (no display in query) that field in SQ02 and generate it. Execute your query and copy the key field use se16n to input in the key fields and use import to excel sheet function to get the required data.
Maybe you are looking for
-
Using Photoshop elements 6 as external editor in aperture
I am new to aperture2, have imported photos into the aperture library, from a folder on the harddrive. I have set photoshop elements as the external editor. When i select a photo for external editing i get redirected to elements, do the editing, but
-
Using cntl C and cntl V to copy data from a JTable into another file j2sdk1.4.0 copied the column names along with the data. j2sdk1.4.1_04 does not copy the column names anymore. Is there any way to get the previous functionality?
-
A class containing some methods and EventListeners.By introspection I want to get only the methods and EventListeners. But MethodDescriptor is returning all the things while EventSetDescriptor returning nun of these. How to get name of the EventListe
-
Hi, I tried using the following code to create dynamic page format. Im working on 4.6c and the following code seems to not work. This code is written in the initialization tab of Global Definition Section. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ data: lx_
-
Linker error. Xcode 3.1.3 + iPhone
Hi i'm pretty new to XCode, I am extending an example project and have had no problems until now. A small but annoying block to my progress has turned up in trying to create and use a c++ class in my project. I have created a .cpp and .h through the