11-17-2011 5:51 AM
Hi All,
can anyone please guide me in this issue.
My requirement is to uploading the Excel data into sap, in that excel one field contains around 400 characters.
When i am uploading the excel file into sap database table, it takes upto 255 characters.
so i changed the datatype to string and tried again, now this time it throws an error as mentioned below.
"ZBOQ" must be a flat structure. You cannot use internal tables,
strings, references, or structures as components. .
Thanks in Advance,
Ramesh.
11-17-2011 8:47 AM
Hi Ramesh,
which function module did you use to upload excel to SAP?
It is advisable to use 'TEXT_CONVERT_XLS_TO_SAP' function module.For that particular field you can use string data type.
Thanks and Regards,
Maheswari A.
11-17-2011 9:54 AM
Hi Maheswari,
I used ALSM_EXCEL_TO_INTERNAL_TABLE function module,
Actually i am facing the problem at table level, field takes the value upto 255 characters only.
my requirement is to take the total text from the internal table and it has to be update at database level.
Thanks for your reply
11-17-2011 9:41 AM
Hi,
You could resolve the problem by saving your excel file as tab delimted file ( as .txt ) and
use FM GUI_UPLOAD which has no restrictions on length.
example :
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = l_file
HAS_FIELD_SEPARATOR = 'X' "tab delimiter
TABLES
DATA_TAB = itab
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
reg
11-17-2011 9:59 AM
Hi Ikshula,
Here i am not facing any problem with excel.
whey i am trying to upload the data by using program it is throwing an error as mentioned below.
"ZBOQ" must be a flat structure. You cannot use internal tables,
strings, references, or structures as components. .
how to resolve this error.
Thanks for your reply.
11-21-2011 2:28 PM
If you are having issues at table level, try using the datatype LCHR or LRAW ..they would be helpful..
But if your data is less than 255 chars it might create data loss issues...
Regards.
Edited by: prafull88 on Nov 21, 2011 3:43 PM
11-17-2011 12:17 PM
Have you tried LCHAR..???
you refer the datatypes at below link
[DATA TYPES ABAP|http://help.sap.com/saphelp_wp/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/content.htm]
11-19-2011 9:32 AM
hi,
Please use FM "TEXT_CONVERT_XLS_TO_SAP". this will work fine without any problem for the field you are getting error just use type string,
Cheers
Ankitesh
11-19-2011 12:14 PM
Try to create your table field with type SSTRING / RAWSTRING. and then try to maintain the length of your requirement. Hope this helps.
Regards,
11-22-2011 5:49 AM
Hi Ramesh,
have you declared any field in the database table of type string?
if yes then kindly do not do that, instead you can declare char of the length you require. i hope once you do that the error would not appear.
Thanks and regards,
Sahai.S
11-23-2011 5:34 AM
Hi Sahai,
yes i tried like that also, but in the table it is accepting upto 255 characters only.
thats why i am taking string datatype.
Thanks for your reply.
11-29-2011 12:07 PM
As ALSM_EXCEL_TO_INTERNAL_TABLE is not released (even if many people use it) and has several limitations, SAP explained this in OSS Note 933420 - ALSM_EXCEL_TO_INTERNAL_TABLE.
You may use OLE2 to read your data from Excel, there are some wiki, and ALSM_EXCEL_TO_INTERNAL_TABLE is a good sample with a select/paste/read clipboard much faster than reading data cell per cell.
11-29-2011 1:30 PM
Hi Sahai,
>
> yes i tried like that also, but in the table it is accepting upto 255 characters only.
>
> thats why i am taking string datatype.
>
>
> Thanks for your reply.
Hi,
you can define char field of length 500 in the table and in your code you can use string now try, it will work and keeping 500 is not the limit you can keep the length according to your requirement .
Regards,
Sahai.S
11-29-2011 2:11 PM
12-02-2011 10:43 AM
Hi Ramesh,
All your internal table data showing compelte string data... But it is went to DataBase with 255 chars only.. i am rt?
If mu guessing rt.. then u have to check table like below...
1. you internal table dattype for that perticula field is LCHR
2. Mainatin the same data type in the Data Base table also