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: 

convert old internal table to new internal table

adalbert_biadatz2
Discoverer
0 Kudos
112

Hi,

can anybody tell me, how to convert an old internal table with header into a new internal table without header. My first idea was to copy all records, but it might be memory expensive.

I worte a method that has a changing parameter:

CHANGING

data_tab TYPE STANDARD TABLE

...

CALL METHOD lcl_downloader=>download

EXPORTING

filename = datei

filetype = 'DAT'

CHANGING

data_tab = aus_tab.

When I am calling the method, I get this error:

AUS_TAB is not type-compatible with formal parameter DATA_TAB.

The DATA_TAB was created in a peace of old ABAP code.

DATA: BEGIN OF aus_tab OCCURS 100, ...

Please let me know, if there is a possibility to cast the tables.

Best regards!

Adalbert

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
81

Simply specify the body of the internal table by using [], Should work.

CALL METHOD lcl_downloader=>download
EXPORTING
filename = datei
filetype = 'DAT'
CHANGING
data_tab = aus_tab[].

Regards,

Rich Heilman

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
82

Simply specify the body of the internal table by using [], Should work.

CALL METHOD lcl_downloader=>download
EXPORTING
filename = datei
filetype = 'DAT'
CHANGING
data_tab = aus_tab[].

Regards,

Rich Heilman