Application Development and Automation 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: 
Read only

Dump while using a Dynamic Internal Table

Former Member
0 Likes
706

Hello Experts,

Im trying to use a dynamic internal table for mapping data from VBRK & VBRP into a single final structure, without creating a 'Z' structure or a final table defining all the fields.

my code looks like this:

FORM format_data .

DATA: new_line TYPE REF TO data.

FIELD-SYMBOLS: <fs> type any.

CREATE DATA new_line LIKE LINE OF <dyntable>.

ASSIGN new_line->* TO <fs>.

LOOP AT t_vbrk ASSIGNING <fs_vbrk>.

ASSIGN COMPONENT sy-index OF STRUCTURE <fs_vbrk> TO <fs>.

INSERT <fs> INTO TABLE <dyntable>.

ENDLOOP.

ENDFORM. " FORMAT_DATA

Here <dyntable> is the table containing fields combined from VBRK & VBRP, exclusing those which are common for both.

Moreover <fs> also has the same structure as <dyntable>. Even then im getting a dump in the insert statement.

DUMP ERROR:

Line types of an internal table and a work area not compatible.

In this case, the condition is not satisfied because the internal table

"<DYNTABLE>" has the line type "u" and the length 1672, but the work area " wa"

has the type "IT_VBRK" and the length 1672.

im passing the following into lt structure:

DATA: lt TYPE lvc_t_fcat.

DATA: ls TYPE lvc_s_fcat.

LOOP AT ddfields.

READ TABLE lt INTO ls WITH KEY fieldname = ddfields-fieldname.

IF sy-subrc <> 0.

ls-fieldname = ddfields-fieldname.

ls-ref_field = ddfields-fieldname.

ls-ref_table = iname-low.

APPEND ls TO lt.

ENDIF.

ENDLOOP.

ENDLOOP.

Do i need to pass anything more?

Please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
533

HI.

I think so you are getting DUMP by fields symbol.better clear all field symbol after reassign it

Regards.

jay

3 REPLIES 3
Read only

Former Member
0 Likes
534

HI.

I think so you are getting DUMP by fields symbol.better clear all field symbol after reassign it

Regards.

jay

Read only

0 Likes
533

Hi Jay,

all field symbols are initial & cleared.

i've tried everything

Regards,

Amit

Read only

0 Likes
533

Hello all,

my problem is solved. closing this thread.

FYI.

im using move-corresponding which solved my problem

LOOP AT t_vbrk ASSIGNING <fs_vbrk>.

MOVE-CORRESPONDING <fs_vbrk> TO <fs>.

INSERT <fs> INTO TABLE <dyntable>.

ENDLOOP.

Regards,

Amit