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

Problem With Insert statement using field symbols with unicode enabled

Former Member
0 Likes
1,094

I was writng a function module for dyanamic operations on the table. We are using the field symbols, function module is unicode enabled.

Assign statements are working fine, with which we created work are <fs_wa_header> and internal table <fs_tb_item> dynamically based on the table name (IM_TB_HENAME) which we get as import parameter.

we have query which is giving us dump.

INSERT (IM_TB_HENAME) FROM <FS_WA_HEADER>.

6 REPLIES 6
Read only

Former Member
0 Likes
775

Check the entry in (IM_TB_HENAME) is already exist, and change INSERT on MODIFY. May be it's help you ...

Read only

Former Member
0 Likes
775

Hi

INSERT (IM_TB_HENAME) FROM <FS_WA_HEADER> is good for inserting a line in the database, so IM_TB_HENAME has to have the name of dictionary table.

U should write:

INSERT <FS_WA_HEADER> INTO (IM_TB_HENAME).

But I believe you can't use the variable IM_TB_HENAME, you should use another field-symbols:

ASSIGN (IM_TB_HNAME) TO <FS_TB_ITEM>.

INSERT <FS_WA_HEADER> INTO <FS_TB_ITEM>.

Max

Read only

0 Likes
775

Hi Max

IM_TB_HENAME is the import parameter for table name which is a dictionary table not an internal table, then how we can assign it to any field symbol.

I want to make it very much clear IM_TB_HENAME is name for database table.

Read only

0 Likes
775

So I suppose you've a code like this (?):

LOOP AT <FS_TB_ITEM> ASSIGNING <FS_WA_HEADER>.
  INSERT (IM_TB_HNAME) FROM <FS_WA_HEADER>.
ENDLOOP.

If it's so, you should know us which dump you're obtaining.

Max

Read only

Former Member
0 Likes
775

Hi,

Try to use Modify or Move-corresponding instead of Insert.

Regards,

Anoop

Read only

0 Likes
775

IM_TB_HENAME is the name of dictionary table which we taking as import parameter, for making it dynamic, it is not an internal table so no move-corresponding or move statement will work