Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: Field value updation in the database table

Former Member
0 Kudos

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.

14 REPLIES 14

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

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

surajarafath
Contributor
0 Kudos

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]

Former Member
0 Kudos

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

former_member186099
Contributor
0 Kudos

Try to create your table field with type SSTRING / RAWSTRING. and then try to maintain the length of your requirement. Hope this helps.

Regards,

sahai
Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

Hi Ramesh,

have you tried with the datatypes LCHR or LRAW ??

0 Kudos

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