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: 

How to save blob data (variable length string) in a customized table?

Former Member
0 Kudos

Dear Friends

I have written a very simple program to update table with 2 fields which

looks as follows.

========================================================

Table name ZTESTBLOBDATA

Field Key Init Data Element Data Type Length

ID Checked ZID NUMC 2

BLOB ZBLOB STRING 0

=========================================================

FOllowing is the sample program that I have written (Transaction SE38).

=========================================================

REPORT ZTESTBLOBPROG

TABLES: ZTESTBLOBDATA

data : itab like ZTESTBLOPDATA occurs 1 with header line.

select * from ztestblobdata into table itab.

ztestblobdata-id = sy-dbcnt +1.

ztestblobdata -blob = 'abcdefghijklmnopqrstuvwxyz.'.

insert ztestblobdata.

=========================================================

When I try to save and activate the program, I get the following

error message

'ztestblopdata' must be a flat structure. You cannot use internal

tables, strings, references, or structures as components.

==========================================================

Using the data type STRING is a must since it is a variable length

data which varies from few characters to few gig.

How can go around this problem.

Any feedback will be highly appreciated.

PS. I have checked old postings on SDN, spoken to my ABAP contacts and also couple of instructors from SAP when I took XI courses but didn't get a satisfactory answers.

Edited by: Ram Prasad on Oct 15, 2008 12:28 PM

4 REPLIES 4

Former Member
0 Kudos

Have a look at how SAP stores IDOCs in the database (look for tables with EDI...). The IDOC content is basically one long string in a field.

0 Kudos

Thanks a lot for the response.

The string that we are getting is from another application via netweaver XI integration and is being sent as a string which has to be saved in an SAP table. I am not sure if IDOC option will suit our needs, but will definitely read more about it.

If there is any other suggestion of feedback I would appreciate it a lot.;

Tks

Ram

0 Kudos

Not that you need to apply IDOCs.

I was merely suggesting that you should take a look at the DB tables where the IDOC's are saved. IDOC data are also with a "variable" length (depending on the IDOC type) and stored in one single field.

Former Member
0 Kudos

Thanks for all the help. I changed the ABAP code a bit and also instead of using abap syntax 'INSERT' I used 'MODIFY' and this solved the problem.

Ram

Edited by: Ram Prasad on Oct 20, 2008 3:59 PM