Skip to Content
author's profile photo Former Member
Former Member

"Deep data objects not supported" when writing into a file

Hello everybody,

I am having some issues about a program that i made which puts the content of any table in a file that i created.

The problem is when my table (transparent table) has a deep data type in it (example : a string field, so with undefined length).

Here is my code :

  DATA : lt_gentable TYPE REF TO data.
  DATA : ls_gentable TYPE REF TO data.
  FIELD-SYMBOLS : <ft_lines> TYPE STANDARD TABLE.
  FIELD-SYMBOLS : <fs_line> TYPE ANY.

  CREATE DATA lt_gentable TYPE TABLE OF (p_tab).
  CREATE DATA ls_gentable TYPE (p_tab).

  "creation of links
  ASSIGN ls_gentable->* TO <fs_line>.
  ASSIGN lt_gentable->* TO <ft_lines>.



  DATA : l_fname     TYPE char80.

  CONCATENATE '\dir\dir2\' l_fname_log INTO l_fname.
  OPEN DATASET l_fname FOR OUTPUT IN BINARY MODE.

  OPEN CURSOR WITH HOLD l_c FOR SELECT * FROM (p_tab).
  DO.
    FETCH NEXT CURSOR l_c INTO TABLE <ft_lines> PACKAGE SIZE p_size.
    IF sy-subrc = 0.

      LOOP AT <ft_lines> INTO <fs_line>.
        TRANSFER <fs_line> TO l_fname.   <=====> GOES INTO DUMP BECAUSE MY TABLE (p_tab) has a string field
      ENDLOOP.

      CLEAR <ft_lines>.
    ELSE.
      CLOSE CURSOR l_c.
      EXIT.
    ENDIF.
  ENDDO.

  CLOSE DATASET l_fname.

Here is the message i am getting :

At the statement

"TRANSFER f TO ..."

no deep data objects are supported at the a

for strings.

Elementary deep data types are internal tabl

data object) references and strings (STRING,

General deep data objects are elementary dee

that contain deep data objects.

In this particular case, the operand "f" has

internal identification "v".

List of internal ABAP types:

C Text (Character)

N Numerical text

D Date (YYYYMMDD)

T Time (HHMMSS)

X Hexadecimal

I Integer

P Packed number

F Floating point number

h Internal table

r Object reference

l Data reference

g String of type C

y String of type X

s 2-byte integer with plus/minus sign

b 1-byte integer without plus/minus sig

u Structure (flat structure)

v Structure (deep structure)

Can you help me to go through this issue ?

Any kind of help would be appreciated.

Christian

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 29, 2011 at 10:35 AM

    Sandra is correct I agree with him,

    TRANSFER dobj TO dset [LENGTH len]

    [NO END OF LINE].

    dobj must be character-type . Use String.

    Please read the F1 help for the TRANSFER Statement and also please check the example

    In your case assign the <fs> to Casting File asfollows

    DATA: file TYPE string VALUE `flights.dat`,

    wa TYPE spfli.

    FIELD-SYMBOLS TYPE x.

    ASSIGN wa TO CASTING.

    TRANSFER TO file.

    Hope this helps...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you for your answers,

      It put me on the good way.

      In fact, we have to write fields one by one.

      But the problem with string fields and rawstrings is that your don't know the length. Then when you want to write the file, it is impossible to know what length you have to read.

      The solution i have is to write first the length of the string written and then the string of length size. It is the only way i got to read correctly the file generated on the other way.

      Thanks you for your help

      Christian

  • Posted on Jun 29, 2011 at 02:54 AM

    Hi Christian,

    TRANSFER can write a data object of type string or xstring (and other types as described in the doc), but you can't have a structure with a string. So, you'll have to transfer fields of the structure one field at a time.

    Sandra

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.