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

insert in custom table

Former Member
0 Likes
803

hi mates,

im trying to insert a row in ztable using abap code. im gettin an error ' type of database table and work area(or internal table)

are not unicode convertible'. find my code below. and help me .

tables: z50911_chkemp.

parameters: empnum like z50911_chkemp-empno,

empnam like z50911_chkemp-name,

emploc like z50911_chkemp-location.

types: begin of z_chk,

empno type z50911_chkemp-empno,

name type z50911_chkemp-name,

loc type z50911_chkemp-location,

  • include type Z50911_STRUCT.

end of z_chk.

data: z_it type table of z_chk,

z_wa type z_chk.

start-of-selection.

z_wa-empno = empnum.

z_wa-name = empnam.

z_wa-loc = emploc.

append z_wa to z_it.

insert z50911_chkemp from table z_it.

*modify z50911_chkemp.

if sy-subrc = 0.

message e000(10) with 'record inserted successfully'.

endif.

regards

mano

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
765

Hi

the internal table declaration should be same as of Ztable it should have all the fields including MANDT also

cheeck the same and change accordingly

Regards

Shiva

3 REPLIES 3
Read only

Former Member
0 Likes
765

Hello,

While inserting data/row into a table u need to make sure that the internal table used for inserting is having the same structure of the table to be inserted.I hope these 2 in ur code is having mismatch in the structure.

Check the same .

Neeraj

Read only

0 Likes
765

yeap i have checked that:

my z table structure has three fields and one mandt field.

my internal table has three fields same as z table.

regards

mano

Read only

Former Member
0 Likes
766

Hi

the internal table declaration should be same as of Ztable it should have all the fields including MANDT also

cheeck the same and change accordingly

Regards

Shiva