Skip to Content
0
Jul 03, 2009 at 05:17 AM

l_descr_ref ?=cl_abap_typedescr=>describe_by_data( gt_tab ).

1494 Views

Hi,

I have written the code as follows to get the components of the file uploaded.But it goes for dump at the statement written at subject line: And it says " However, the current content of the source variable does not fit into

the target variable." please help!!!

TYPES: BEGIN OF ttab_type,

rec(1000) TYPE c,

END OF ttab_type.

DATA:gt_tab TYPE TABLE OF ttab_type.

DATA: l_descr_ref TYPE REF TO cl_abap_structdescr,

g_line TYPE string,

gt_field TYPE crmt_mktimex_field_tab.

DATA: lt_table TYPE REF TO data,

lt_line TYPE REF TO data,

ls_xfc TYPE lvc_s_fcat,

ls_ifc TYPE lvc_t_fcat,

lt_details TYPE abap_compdescr_tab,

lw_details TYPE abap_compdescr.

FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,

<dyn_wa>,

<dyn_field>.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = pfile1

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = gt_tab

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

EXIT.

ENDIF.

l_descr_ref ?=

cl_abap_typedescr=>describe_by_data( gt_tab ).

lt_details[] = l_descr_ref->components[].

Edited by: Ginger on Jul 3, 2009 1:18 AM